2003-09-15 22:42:00 +00:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2006-02-24 19:47:47 +00:00
|
|
|
* Copyright (C) 2000-2006, International Business Machines
|
2003-09-15 22:42:00 +00:00
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
*
|
|
|
|
***************************************************************************
|
2004-05-12 19:58:49 +00:00
|
|
|
* file name: make.c
|
2003-09-15 22:42:00 +00:00
|
|
|
* encoding: ANSI X3.4 (1968)
|
|
|
|
* tab size: 8 (not used)
|
|
|
|
* indentation:4
|
|
|
|
*
|
|
|
|
* created on: 2000jul18
|
|
|
|
* created by: Vladimir Weinstein
|
|
|
|
* created on: 2000may17
|
|
|
|
* created by: Steven \u24C7 Loomis
|
|
|
|
* merged on: 2003sep14
|
|
|
|
* merged by: George Rhoten
|
|
|
|
* merged from nmake.c and gmake.c
|
|
|
|
*
|
|
|
|
* Emit a NMAKE or GNU makefile
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "unicode/utypes.h"
|
2004-10-19 03:15:10 +00:00
|
|
|
#include "unicode/putil.h"
|
2003-09-15 22:42:00 +00:00
|
|
|
#include "makefile.h"
|
|
|
|
#include "cstring.h"
|
2006-02-26 21:55:55 +00:00
|
|
|
#include "cmemory.h"
|
2003-09-15 22:42:00 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2004-11-02 00:27:43 +00:00
|
|
|
#ifdef U_MAKE_IS_NMAKE
|
2003-09-15 22:42:00 +00:00
|
|
|
|
|
|
|
char linebuf[2048];
|
|
|
|
|
|
|
|
/* Write any setup/initialization stuff */
|
|
|
|
void
|
|
|
|
pkg_mak_writeHeader(FileStream *f, const UPKGOptions *o)
|
|
|
|
{
|
2004-04-22 23:27:20 +00:00
|
|
|
const char *appendVersion = NULL;
|
2006-02-26 21:55:55 +00:00
|
|
|
char *srcDir = convertToNativePathSeparators(uprv_strdup(o->srcDir));
|
|
|
|
|
2004-04-22 23:27:20 +00:00
|
|
|
if(o->version && !uprv_strstr(o->shortName,o->version)) { /* do not append version if
|
|
|
|
already contained in the name */
|
|
|
|
appendVersion = o->version;
|
|
|
|
}
|
|
|
|
|
2004-04-14 20:08:16 +00:00
|
|
|
sprintf(linebuf, "## Makefile for %s (%s) created by pkgdata\n"
|
2003-09-15 22:42:00 +00:00
|
|
|
"## from ICU Version %s\n"
|
|
|
|
"\n",
|
|
|
|
o->shortName,
|
2004-04-14 20:08:16 +00:00
|
|
|
o->libName,
|
2003-09-15 22:42:00 +00:00
|
|
|
U_ICU_VERSION);
|
|
|
|
T_FileStream_writeLine(f, linebuf);
|
|
|
|
|
2003-09-26 04:46:24 +00:00
|
|
|
sprintf(linebuf, "NAME=%s%s\n"
|
2003-09-15 22:42:00 +00:00
|
|
|
"CNAME=%s\n"
|
2004-05-12 19:58:49 +00:00
|
|
|
"LIBNAME=%s\n"
|
2004-04-14 20:08:16 +00:00
|
|
|
"SRCDIR=%s\n"
|
2003-09-15 22:42:00 +00:00
|
|
|
"TARGETDIR=%s\n"
|
|
|
|
"TEMP_DIR=%s\n"
|
|
|
|
"MODE=%s\n"
|
|
|
|
"MAKEFILE=%s\n"
|
|
|
|
"ENTRYPOINT=%s\n"
|
2003-09-26 04:46:24 +00:00
|
|
|
"TARGET_VERSION=%s\n"
|
2004-06-15 17:53:28 +00:00
|
|
|
"MKINSTALLDIRS=mkdir\n"
|
2006-02-26 21:55:55 +00:00
|
|
|
"INSTALL_DATA=copy\n"
|
2006-02-27 04:20:12 +00:00
|
|
|
"RMV=del /F"
|
2003-09-15 22:42:00 +00:00
|
|
|
"\n\n\n",
|
|
|
|
o->shortName,
|
2004-04-22 23:27:20 +00:00
|
|
|
(appendVersion ? appendVersion : ""),
|
2003-09-15 22:42:00 +00:00
|
|
|
o->cShortName,
|
2004-05-12 19:58:49 +00:00
|
|
|
o->libName,
|
2006-02-26 21:55:55 +00:00
|
|
|
srcDir,
|
2003-09-15 22:42:00 +00:00
|
|
|
o->targetDir,
|
|
|
|
o->tmpDir,
|
|
|
|
o->mode,
|
|
|
|
o->makeFile,
|
2003-09-26 04:46:24 +00:00
|
|
|
o->entryName,
|
2004-05-12 19:58:49 +00:00
|
|
|
o->version);
|
2003-09-15 22:42:00 +00:00
|
|
|
T_FileStream_writeLine(f, linebuf);
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
sprintf(linebuf, "## List files [%d] containing data files to process (note: - means stdin)\n"
|
|
|
|
"LISTFILES= ",
|
|
|
|
pkg_countCharList(o->fileListFiles));
|
|
|
|
T_FileStream_writeLine(f, linebuf);
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
pkg_writeCharListWrap(f, o->fileListFiles, " ", " \\\n", 0);
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
T_FileStream_writeLine(f, "\n\n\n");
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
sprintf(linebuf, "## Data Files [%d]\n"
|
|
|
|
"DATAFILES= ",
|
|
|
|
pkg_countCharList(o->files));
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
T_FileStream_writeLine(f, linebuf);
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
pkg_writeCharListWrap(f, o->files, " ", " \\\n", -1);
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
T_FileStream_writeLine(f, "\n\n\n");
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
sprintf(linebuf, "## Data File Paths [%d]\n"
|
2004-05-30 09:03:43 +00:00
|
|
|
"DATAFILEPATHS= ",
|
|
|
|
pkg_countCharList(o->filePaths));
|
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
T_FileStream_writeLine(f, linebuf);
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
pkg_writeCharListWrap(f, o->filePaths, " ", " \\\n", 1);
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
T_FileStream_writeLine(f, "\n\n\n");
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2006-02-26 21:55:55 +00:00
|
|
|
uprv_free(srcDir);
|
2003-09-15 22:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Write a stanza in the makefile, with specified "target: parents... \n\n\tcommands" [etc] */
|
|
|
|
void
|
|
|
|
pkg_mak_writeStanza(FileStream *f, const UPKGOptions *o,
|
|
|
|
const char *target,
|
|
|
|
CharList* parents,
|
|
|
|
CharList* commands )
|
|
|
|
{
|
2003-12-11 05:00:40 +00:00
|
|
|
T_FileStream_write(f, target, (int32_t)uprv_strlen(target));
|
2003-09-15 22:42:00 +00:00
|
|
|
T_FileStream_write(f, " : ", 3);
|
|
|
|
pkg_writeCharList(f, parents, " ",1);
|
|
|
|
T_FileStream_write(f, "\n", 1);
|
|
|
|
|
|
|
|
if(commands)
|
|
|
|
{
|
|
|
|
T_FileStream_write(f, "\t", 1);
|
|
|
|
pkg_writeCharList(f, commands, "\n\t",0);
|
|
|
|
}
|
|
|
|
T_FileStream_write(f, "\n\n", 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* write any cleanup/post stuff */
|
|
|
|
void
|
|
|
|
pkg_mak_writeFooter(FileStream *f, const UPKGOptions *o)
|
|
|
|
{
|
|
|
|
char buf[256];
|
|
|
|
sprintf(buf, "\n\n# End of makefile for %s [%s mode]\n\n", o->shortName, o->mode);
|
2003-12-11 05:00:40 +00:00
|
|
|
T_FileStream_write(f, buf, (int32_t)uprv_strlen(buf));
|
2003-09-15 22:42:00 +00:00
|
|
|
}
|
|
|
|
|
2005-02-17 00:19:44 +00:00
|
|
|
#else /* #ifdef U_MAKE_IS_NMAKE */
|
2003-09-15 22:42:00 +00:00
|
|
|
|
|
|
|
#include "cmemory.h"
|
|
|
|
#include "filestrm.h"
|
|
|
|
#include "toolutil.h"
|
|
|
|
#include "unewdata.h"
|
|
|
|
#include "uoptions.h"
|
|
|
|
#include "pkgtypes.h"
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
char linebuf[2048];
|
|
|
|
|
|
|
|
/* Write any setup/initialization stuff */
|
|
|
|
void
|
|
|
|
pkg_mak_writeHeader(FileStream *f, const UPKGOptions *o)
|
|
|
|
{
|
|
|
|
sprintf(linebuf, "## Makefile for %s created by pkgdata\n"
|
|
|
|
"## from ICU Version %s\n"
|
|
|
|
"\n",
|
|
|
|
o->shortName,
|
|
|
|
U_ICU_VERSION);
|
|
|
|
T_FileStream_writeLine(f, linebuf);
|
|
|
|
|
|
|
|
sprintf(linebuf, "NAME=%s\n"
|
2004-04-14 20:08:16 +00:00
|
|
|
"LIBNAME=%s\n"
|
2003-09-15 22:42:00 +00:00
|
|
|
"CNAME=%s\n"
|
|
|
|
"TARGETDIR=%s\n"
|
|
|
|
"TEMP_DIR=%s\n"
|
|
|
|
"srcdir=$(TEMP_DIR)\n"
|
2004-04-14 20:08:16 +00:00
|
|
|
"SRCDIR=%s\n"
|
2003-09-15 22:42:00 +00:00
|
|
|
"MODE=%s\n"
|
|
|
|
"MAKEFILE=%s\n"
|
|
|
|
"ENTRYPOINT=%s\n"
|
|
|
|
"include %s\n"
|
|
|
|
"\n\n\n",
|
|
|
|
o->shortName,
|
2004-04-14 20:08:16 +00:00
|
|
|
o->libName,
|
2003-09-15 22:42:00 +00:00
|
|
|
o->cShortName,
|
|
|
|
o->targetDir,
|
|
|
|
o->tmpDir,
|
2004-04-14 20:08:16 +00:00
|
|
|
o->srcDir,
|
2003-09-15 22:42:00 +00:00
|
|
|
o->mode,
|
|
|
|
o->makeFile,
|
|
|
|
o->entryName,
|
|
|
|
o->options);
|
|
|
|
T_FileStream_writeLine(f, linebuf);
|
|
|
|
|
|
|
|
/* TEMP_PATH and TARG_PATH will be empty if the respective dir is . */
|
|
|
|
/* Avoid //'s and .'s which confuse make ! */
|
|
|
|
if(!strcmp(o->tmpDir,"."))
|
|
|
|
{
|
|
|
|
T_FileStream_writeLine(f, "TEMP_PATH=\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
T_FileStream_writeLine(f, "TEMP_PATH=$(TEMP_DIR)/\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!strcmp(o->targetDir,"."))
|
|
|
|
{
|
|
|
|
T_FileStream_writeLine(f, "TARG_PATH=\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
T_FileStream_writeLine(f, "TARG_PATH=$(TARGETDIR)/\n");
|
|
|
|
}
|
2004-05-30 09:03:43 +00:00
|
|
|
|
|
|
|
sprintf(linebuf, "## List files [%u] containing data files to process (note: - means stdin)\n"
|
2003-09-15 22:42:00 +00:00
|
|
|
"LISTFILES= ",
|
2004-05-30 09:03:43 +00:00
|
|
|
(int)pkg_countCharList(o->fileListFiles));
|
2003-09-15 22:42:00 +00:00
|
|
|
T_FileStream_writeLine(f, linebuf);
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
pkg_writeCharListWrap(f, o->fileListFiles, " ", " \\\n",0);
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
T_FileStream_writeLine(f, "\n\n\n");
|
2004-05-30 09:03:43 +00:00
|
|
|
|
|
|
|
sprintf(linebuf, "## Data Files [%u]\n"
|
2003-09-15 22:42:00 +00:00
|
|
|
"DATAFILES= ",
|
2004-05-30 09:03:43 +00:00
|
|
|
(int)pkg_countCharList(o->files));
|
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
T_FileStream_writeLine(f, linebuf);
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
pkg_writeCharListWrap(f, o->files, " ", " \\\n",-1);
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
T_FileStream_writeLine(f, "\n\n\n");
|
2004-05-30 09:03:43 +00:00
|
|
|
|
|
|
|
sprintf(linebuf, "## Data File Paths [%u]\n"
|
2003-09-15 22:42:00 +00:00
|
|
|
"DATAFILEPATHS= ",
|
2004-05-30 09:03:43 +00:00
|
|
|
(int)pkg_countCharList(o->filePaths));
|
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
T_FileStream_writeLine(f, linebuf);
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
pkg_writeCharListWrap(f, o->filePaths, " ", " \\\n",0);
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
T_FileStream_writeLine(f, "\n\n\n");
|
2004-05-30 09:03:43 +00:00
|
|
|
|
2003-09-15 22:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Write a stanza in the makefile, with specified "target: parents... \n\n\tcommands" [etc] */
|
|
|
|
void
|
|
|
|
pkg_mak_writeStanza(FileStream *f, const UPKGOptions *o,
|
|
|
|
const char *target,
|
|
|
|
CharList* parents,
|
|
|
|
CharList* commands)
|
|
|
|
{
|
2004-04-15 07:43:10 +00:00
|
|
|
T_FileStream_write(f, target, uprv_strlen(target));
|
2003-09-15 22:42:00 +00:00
|
|
|
T_FileStream_write(f, " : ", 3);
|
|
|
|
pkg_writeCharList(f, parents, " ",0);
|
|
|
|
T_FileStream_write(f, "\n", 1);
|
|
|
|
|
|
|
|
if(commands)
|
|
|
|
{
|
|
|
|
T_FileStream_write(f, "\t", 1);
|
|
|
|
pkg_writeCharList(f, commands, "\n\t",0);
|
|
|
|
}
|
|
|
|
T_FileStream_write(f, "\n\n", 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* write any cleanup/post stuff */
|
|
|
|
void
|
|
|
|
pkg_mak_writeFooter(FileStream *f, const UPKGOptions *o)
|
|
|
|
{
|
|
|
|
T_FileStream_writeLine(f, "\nrebuild: clean all\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
pkg_mak_writeObjRules(UPKGOptions *o, FileStream *makefile, CharList **objects, const char* objSuffix)
|
|
|
|
{
|
|
|
|
const char *p, *baseName;
|
|
|
|
char *tmpPtr;
|
|
|
|
char tmp[1024];
|
|
|
|
char stanza[1024];
|
|
|
|
char cfile[1024];
|
|
|
|
CharList *oTail = NULL;
|
|
|
|
CharList *infiles;
|
|
|
|
CharList *parents = NULL, *commands = NULL;
|
|
|
|
int32_t genFileOffset = 0; /* offset from beginning of .c and .o file name, use to chop off package name for AS/400 */
|
2006-02-24 19:47:47 +00:00
|
|
|
char *parentPath;
|
|
|
|
const char *tchar;
|
|
|
|
char tree[1024];
|
2004-04-14 20:08:16 +00:00
|
|
|
|
2006-02-24 19:47:47 +00:00
|
|
|
infiles = o->files; /* raw files - no paths other than tree paths */
|
2003-09-15 22:42:00 +00:00
|
|
|
|
|
|
|
#if defined (OS400)
|
|
|
|
if(infiles != NULL) {
|
|
|
|
baseName = findBasename(infiles->str);
|
|
|
|
p = uprv_strchr(baseName, '_');
|
|
|
|
if(p != NULL) {
|
|
|
|
genFileOffset = (p-baseName)+1; /* "package_" - name + underscore */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
for(;infiles;infiles = infiles->next) {
|
2006-02-24 19:47:47 +00:00
|
|
|
baseName = infiles->str; /* skip the icudt28b/ part */
|
2004-04-14 20:08:16 +00:00
|
|
|
p = uprv_strrchr(baseName, '.');
|
|
|
|
if( (p == NULL) || (*p == '\0' ) ) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2006-02-24 19:47:47 +00:00
|
|
|
uprv_strncpy(tmp, baseName, p-baseName);
|
|
|
|
p++;
|
|
|
|
|
|
|
|
uprv_strcpy(tmp+(p-1-baseName), "_"); /* to append */
|
|
|
|
uprv_strcat(tmp, p);
|
|
|
|
uprv_strcat(tmp, objSuffix );
|
|
|
|
|
|
|
|
/* iSeries cannot have '-' in the .o objects. */
|
|
|
|
for( tmpPtr = tmp; *tmpPtr; tmpPtr++ ) {
|
|
|
|
if ( *tmpPtr == U_FILE_SEP_CHAR ) { /* map tree names with underscores */
|
|
|
|
*tmpPtr = '_';
|
|
|
|
}
|
|
|
|
if ( *tmpPtr == '-' ) {
|
|
|
|
*tmpPtr = '_';
|
2003-09-15 22:42:00 +00:00
|
|
|
}
|
2004-04-14 20:08:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
*objects = pkg_appendToList(*objects, &oTail, uprv_strdup(tmp + genFileOffset)); /* Offset for AS/400 */
|
|
|
|
|
|
|
|
/* write source list */
|
2004-04-15 07:43:10 +00:00
|
|
|
uprv_strcpy(cfile,tmp);
|
|
|
|
uprv_strcpy(cfile+uprv_strlen(cfile)-uprv_strlen(objSuffix), ".c" ); /* replace .o with .c */
|
2004-04-14 20:08:16 +00:00
|
|
|
|
|
|
|
/* Make up parents.. */
|
2006-02-24 19:47:47 +00:00
|
|
|
parentPath = uprv_malloc(1+uprv_strlen(baseName) + uprv_strlen("$(SRCDIR)/"));
|
|
|
|
sprintf(parentPath, "$(SRCDIR)/%s", baseName);
|
|
|
|
parents = pkg_appendToList(parents, NULL, parentPath);
|
2004-04-14 20:08:16 +00:00
|
|
|
|
|
|
|
/* make up commands.. */
|
|
|
|
/* search for tree.. */
|
2004-04-28 00:11:02 +00:00
|
|
|
if((tchar=uprv_strchr(baseName, '/'))) {
|
2004-04-14 20:08:16 +00:00
|
|
|
tree[0]='_';
|
|
|
|
strncpy(tree+1,baseName,tchar-baseName);
|
|
|
|
tree[tchar-baseName+1]=0;
|
|
|
|
} else {
|
|
|
|
tree[0] = 0;
|
2003-09-15 22:42:00 +00:00
|
|
|
}
|
2004-05-18 18:42:44 +00:00
|
|
|
#ifdef OS400
|
|
|
|
sprintf(stanza, "$(INVOKE) $(GENCCODE) -n $(CNAME)%s -d $(TEMP_DIR) $(SRCDIR)/%s", tree, infiles->str);
|
|
|
|
#else
|
2004-04-14 20:08:16 +00:00
|
|
|
sprintf(stanza, "$(INVOKE) $(GENCCODE) -n $(CNAME)%s -d $(TEMP_DIR) $<", tree);
|
2004-05-18 18:42:44 +00:00
|
|
|
#endif
|
2004-04-14 20:08:16 +00:00
|
|
|
|
2006-02-24 19:47:47 +00:00
|
|
|
if(uprv_strchr(baseName, '/')) {
|
2004-04-14 20:08:16 +00:00
|
|
|
/* append actual file - ex: coll_en_res otherwise the tree name will be lost */
|
|
|
|
strcat(stanza, " -f ");
|
|
|
|
strncat(stanza, tmp, (strlen(tmp)-strlen(objSuffix)));
|
|
|
|
}
|
|
|
|
|
|
|
|
commands = pkg_appendToList(commands, NULL, uprv_strdup(stanza));
|
|
|
|
|
2004-05-18 18:42:44 +00:00
|
|
|
#ifdef OS400
|
|
|
|
/* This builds the file into one .c file */
|
|
|
|
sprintf(stanza, "@cat $(TEMP_PATH)%s >> $(TEMP_PATH)/$(NAME)all.c", cfile);
|
|
|
|
commands = pkg_appendToList(commands, NULL, uprv_strdup(stanza));
|
|
|
|
|
|
|
|
sprintf(stanza, "@$(RMV) $(TEMP_DIR)/%s", cfile);
|
|
|
|
commands = pkg_appendToList(commands, NULL, uprv_strdup(stanza));
|
|
|
|
|
|
|
|
T_FileStream_write(makefile, "\t", 1);
|
|
|
|
pkg_writeCharList(makefile, commands, "\n\t",0);
|
|
|
|
T_FileStream_write(makefile, "\n\n", 2);
|
|
|
|
#else
|
2004-04-14 20:08:16 +00:00
|
|
|
if(genFileOffset > 0) { /* for AS/400 */
|
|
|
|
sprintf(stanza, "@mv $(TEMP_PATH)%s $(TEMP_PATH)%s", cfile, cfile+genFileOffset);
|
2003-09-15 22:42:00 +00:00
|
|
|
commands = pkg_appendToList(commands, NULL, uprv_strdup(stanza));
|
2004-04-14 20:08:16 +00:00
|
|
|
}
|
|
|
|
|
2005-03-20 13:53:04 +00:00
|
|
|
sprintf(stanza, "@$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $(TEMP_DIR)/%s", cfile+genFileOffset); /* for AS/400 */
|
2004-04-14 20:08:16 +00:00
|
|
|
commands = pkg_appendToList(commands, NULL, uprv_strdup(stanza));
|
|
|
|
|
|
|
|
sprintf(stanza, "@$(RMV) $(TEMP_DIR)/%s", cfile+genFileOffset);
|
|
|
|
commands = pkg_appendToList(commands, NULL, uprv_strdup(stanza));
|
|
|
|
|
|
|
|
sprintf(stanza, "$(TEMP_PATH)%s", tmp+genFileOffset); /* for AS/400 */
|
|
|
|
pkg_mak_writeStanza(makefile, o, stanza, parents, commands);
|
2004-05-18 18:42:44 +00:00
|
|
|
#endif
|
2004-04-14 20:08:16 +00:00
|
|
|
|
|
|
|
pkg_deleteList(parents);
|
|
|
|
pkg_deleteList(commands);
|
|
|
|
parents = NULL;
|
|
|
|
commands = NULL;
|
|
|
|
}
|
2003-09-15 22:42:00 +00:00
|
|
|
}
|
|
|
|
|
2005-02-17 00:19:44 +00:00
|
|
|
#endif /* #ifdef U_MAKE_IS_NMAKE */
|
2003-09-15 22:42:00 +00:00
|
|
|
|
2004-03-02 00:38:39 +00:00
|
|
|
void
|
|
|
|
pkg_mak_writeAssemblyHeader(FileStream *f, const UPKGOptions *o)
|
|
|
|
{
|
|
|
|
T_FileStream_writeLine(f, "\n");
|
2004-03-11 21:49:06 +00:00
|
|
|
T_FileStream_writeLine(f, "ifneq ($(GENCCODE_ASSEMBLY),)\n");
|
2004-03-02 00:38:39 +00:00
|
|
|
T_FileStream_writeLine(f, "\n");
|
|
|
|
T_FileStream_writeLine(f, "BASE_OBJECTS=$(NAME)_dat.o\n");
|
|
|
|
T_FileStream_writeLine(f, "\n");
|
2004-03-09 02:20:05 +00:00
|
|
|
T_FileStream_writeLine(f, "$(TEMP_DIR)/$(NAME).dat: $(CMNLIST) $(DATAFILEPATHS)\n");
|
2006-02-24 19:47:47 +00:00
|
|
|
T_FileStream_writeLine(f, "\t$(INVOKE) $(GENCMN) -c -e $(ENTRYPOINT) -n $(NAME) -s $(SRCDIR) -t dat -d $(TEMP_DIR) 0 $(CMNLIST)\n");
|
2004-03-02 00:38:39 +00:00
|
|
|
T_FileStream_writeLine(f, "\n");
|
|
|
|
T_FileStream_writeLine(f, "$(TEMP_DIR)/$(NAME)_dat.o : $(TEMP_DIR)/$(NAME).dat\n");
|
|
|
|
T_FileStream_writeLine(f, "\t$(INVOKE) $(GENCCODE) $(GENCCODE_ASSEMBLY) -n $(NAME) -e $(ENTRYPOINT) -d $(TEMP_DIR) $<\n");
|
|
|
|
T_FileStream_writeLine(f, "\t$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $(TEMP_DIR)/$(NAME)_dat"ASM_SUFFIX"\n");
|
|
|
|
T_FileStream_writeLine(f, "\t$(RMV) $(TEMP_DIR)/$(NAME)_dat"ASM_SUFFIX"\n");
|
|
|
|
T_FileStream_writeLine(f, "\n");
|
|
|
|
T_FileStream_writeLine(f, "else\n");
|
|
|
|
T_FileStream_writeLine(f, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
pkg_mak_writeAssemblyFooter(FileStream *f, const UPKGOptions *o)
|
|
|
|
{
|
|
|
|
T_FileStream_writeLine(f, "\nendif\n");
|
|
|
|
}
|
|
|
|
|