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: 2000may15
13
* created by: Steven \u24C7 Loomis
15
* This program packages the ICU data into different forms
16
* (DLL, common data, etc.)
21
#include "unicode/utypes.h"
31
void pkg_mode_common(UPKGOptions *o, FileStream *makefile, UErrorCode *status)
34
CharList *tail = NULL;
36
uprv_strcpy(tmp, UDATA_CMN_PREFIX);
37
uprv_strcat(tmp, o->shortName);
38
uprv_strcat(tmp, UDATA_CMN_SUFFIX);
40
if(!uprv_strcmp(o->mode, "common")) {
41
/* If we're not the main mode.. don't change the output file list */
43
/* We should be the only item. So we don't care about the order. */
44
o->outFiles = pkg_appendToList(o->outFiles, &tail, uprv_strdup(tmp));
46
if(o->nooutput || o->verbose) {
47
fprintf(stdout, "# Output file: %s%s%s\n", o->targetDir, U_FILE_SEP_STRING, tmp);
51
*status = U_ZERO_ERROR;
55
sprintf(tmp, "# File to make:\nTARGET=%s%s%s\n\nTARGETNAME=%s\n", o->targetDir,
59
T_FileStream_writeLine(makefile, tmp);
61
/* We're in another mode. but, set the target so they can find us.. */
62
T_FileStream_writeLine(makefile, "TARGET=");
63
T_FileStream_writeLine(makefile, tmp);
64
T_FileStream_writeLine(makefile, "\n\n");
66
} /* end [check to make sure we are in mode 'common' ] */
68
sprintf(tmp, "# List file for gencmn:\n"
69
"CMNLIST=%s%s%s_common.lst\n\n",
73
T_FileStream_writeLine(makefile, tmp);
75
sprintf(tmp, "all: $(TARGET)\n\n");
76
T_FileStream_writeLine(makefile, tmp);
78
T_FileStream_writeLine(makefile, "$(TARGET): $(CMNLIST) $(DATAFILEPATHS)\n"
79
"\t$(INVOKE) $(GENCMN) -n $(NAME) -c -d $(TARGETDIR) 0 $(CMNLIST)\n\n");
81
if(o->hadStdin == FALSE) { /* shortcut */
82
T_FileStream_writeLine(makefile, "$(CMNLIST): $(LISTFILES)\n"
83
"\tcat $(LISTFILES) > $(CMNLIST)\n\n");
85
T_FileStream_writeLine(makefile, "$(CMNLIST): \n"
86
"\t@echo \"generating $@ (list of data files)\"\n"
88
"\t@for file in $(DATAFILEPATHS); do \\\n"
89
"\t echo $$file >> $@; \\\n"
93
if(!uprv_strcmp(o->mode, "common")) { /* only install/clean in our own mode */
94
T_FileStream_writeLine(makefile, "CLEANFILES= $(CMNLIST) $(TARGET)\n\nclean:\n\t-$(RMV) $(CLEANFILES) $(MAKEFILE)");
95
T_FileStream_writeLine(makefile, "\n\n");
97
sprintf(tmp, "install: $(TARGET)\n"
98
"\t$(INSTALL_DATA) $(TARGET) $(INSTALLTO)%s$(TARGETNAME)\n\n",
101
T_FileStream_writeLine(makefile, tmp);