]>
git.saurik.com Git - apple/icu.git/blob - icuSources/tools/pkgdata/nmake.c
1 /**************************************************************************
3 * Copyright (C) 2000, International Business Machines
4 * Corporation and others. All Rights Reserved.
6 ***************************************************************************
8 * encoding: ANSI X3.4 (1968)
9 * tab size: 8 (not used)
12 * created on: 2000jul18
13 * created by: Vladimir Weinstein
15 * Emit a NMAKE makefile
24 /* Write any setup/initialization stuff */
26 pkg_mak_writeHeader(FileStream
*f
, const UPKGOptions
*o
)
28 sprintf(linebuf
, "## Makefile for %s created by pkgdata\n"
29 "## from ICU Version %s\n"
33 T_FileStream_writeLine(f
, linebuf
);
35 sprintf(linebuf
, "NAME=%s\n"
50 T_FileStream_writeLine(f
, linebuf
);
52 sprintf(linebuf
, "## List files [%d] containing data files to process (note: - means stdin)\n"
54 pkg_countCharList(o
->fileListFiles
));
55 T_FileStream_writeLine(f
, linebuf
);
57 pkg_writeCharListWrap(f
, o
->fileListFiles
, " ", " \\\n", 0);
59 T_FileStream_writeLine(f
, "\n\n\n");
61 sprintf(linebuf
, "## Data Files [%d]\n"
63 pkg_countCharList(o
->files
));
65 T_FileStream_writeLine(f
, linebuf
);
67 pkg_writeCharListWrap(f
, o
->files
, " ", " \\\n", -1);
69 T_FileStream_writeLine(f
, "\n\n\n");
71 sprintf(linebuf
, "## Data File Paths [%d]\n"
73 pkg_countCharList(o
->filePaths
));
75 T_FileStream_writeLine(f
, linebuf
);
77 pkg_writeCharListWrap(f
, o
->filePaths
, " ", " \\\n", 1);
79 T_FileStream_writeLine(f
, "\n\n\n");
83 /* Write a stanza in the makefile, with specified "target: parents... \n\n\tcommands" [etc] */
85 pkg_mak_writeStanza(FileStream
*f
, const UPKGOptions
*o
,
90 T_FileStream_write(f
, target
, uprv_strlen(target
));
91 T_FileStream_write(f
, " : ", 3);
92 pkg_writeCharList(f
, parents
, " ",1);
93 T_FileStream_write(f
, "\n", 1);
97 T_FileStream_write(f
, "\t", 1);
98 pkg_writeCharList(f
, commands
, "\n\t",0);
100 T_FileStream_write(f
, "\n\n", 2);
103 /* write any cleanup/post stuff */
105 pkg_mak_writeFooter(FileStream
*f
, const UPKGOptions
*o
)
108 sprintf(buf
, "\n\n# End of makefile for %s [%s mode]\n\n", o
->shortName
, o
->mode
);
109 T_FileStream_write(f
, buf
, uprv_strlen(buf
));