/******************************************************************************
*
-* Copyright (C) 2002, International Business Machines
+* Copyright (C) 2002-2006, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
*/
#include "unicode/utypes.h"
+#include "unicode/putil.h"
#include "unicode/uloc.h"
#include "cmemory.h"
#include "cstring.h"
/** set if AR is NOT to be called implicitly by gnumake
** (i.e. if the form libblah.a($(OBJECTS) doesnt work)
**/
+#if !defined(NO_IMPLICIT_AR)
#if defined(OS400) || defined(OS390)
# define NO_IMPLICIT_AR 1
#else
# define NO_IMPLICIT_AR 0
#endif
+#endif
void pkg_sttc_writeReadme(struct UPKGOptions_ *o, const char *libName, UErrorCode *status)
{
"\n\n"
"4. Now, you may access this data with a 'path' of \"%s\" as in the following example:\n"
"\n"
- " ... ures_open( \"%s\", \"%s\", &err ); \n",
- libName, o->shortName, o->shortName, uloc_getDefault());
+ " ... ures_open( \"%s\", NULL /* Get the default locale */, &err ); \n",
+ libName, o->shortName, o->shortName);
T_FileStream_writeLine(out, tmp);
T_FileStream_close(out);
}
-#ifndef WIN32
+#ifndef U_MAKE_IS_NMAKE
#include "makefile.h"
return;
}
- uprv_strcpy(tmp, LIB_PREFIX);
- uprv_strcat(tmp, o->cShortName);
+ uprv_strcpy(tmp, LIB_STATIC_PREFIX);
+ uprv_strcat(tmp, o->libName);
uprv_strcat(tmp, UDATA_LIB_SUFFIX);
o->outFiles = pkg_appendToList(o->outFiles, &tail, uprv_strdup(tmp));
- pkg_sttc_writeReadme(o, tmp, status);
+ if (!o->quiet) {
+ pkg_sttc_writeReadme(o, tmp, status);
+ }
if(U_FAILURE(*status)) {
return;
}
uprv_strcat(tmp, "\n\n");
T_FileStream_writeLine(makefile, tmp);
+#ifdef OS400
+ /* New for iSeries: All packaged data in one .c */
+ sprintf(tmp, "# Create a file which contains all .c data files/structures\n"
+ "$(TEMP_DIR)/$(NAME)all.c: $(CMNLIST)\n\n");
+ T_FileStream_writeLine(makefile, tmp);
+#endif
+
/* Write compile rules */
pkg_mak_writeObjRules(o, makefile, &objects, ".$(STATIC_O)"); /* use special .o suffix */
"\tdone;\n\n");
}
+ pkg_mak_writeAssemblyHeader(makefile, o);
+
sprintf(tmp,"$(TEMP_PATH)$(NAME)_dat.$(STATIC_O) : $(TEMP_PATH)$(NAME)_dat.c\n"
"\t$(COMPILE.c) -o $@ $<\n\n");
T_FileStream_writeLine(makefile, tmp);
T_FileStream_writeLine(makefile, "# 'TOCOBJ' contains C Table of Contents objects [if any]\n");
sprintf(tmp, "$(TEMP_PATH)$(NAME)_dat.c: $(CMNLIST)\n"
- "\t$(INVOKE) $(GENCMN) -e $(ENTRYPOINT) -n $(NAME) -S -d $(TEMP_DIR) 0 $(CMNLIST)\n\n");
+ "\t$(INVOKE) $(GENCMN) -e $(ENTRYPOINT) -n $(NAME) -S -s $(SRCDIR) -d $(TEMP_DIR) 0 $(CMNLIST)\n\n");
+ T_FileStream_writeLine(makefile, tmp);
+
+ sprintf(tmp, "TOCOBJ= $(NAME)_dat.$(STATIC_O)\n\n");
T_FileStream_writeLine(makefile, tmp);
- sprintf(tmp, "TOCOBJ= $(NAME)_dat%s \n\n", OBJ_SUFFIX);
+#ifdef OS400
+ /* New for iSeries: All packaged data in one .c */
+ sprintf(tmp,"$(TEMP_PATH)$(NAME)all.$(STATIC_O) : $(TEMP_PATH)$(NAME)all.c\n"
+ "\t$(COMPILE.c) -o $@ $<\n\n");
T_FileStream_writeLine(makefile, tmp);
+
+ T_FileStream_writeLine(makefile, "# 'ALLDATAOBJ' contains all .c data structures\n");
+
+ sprintf(tmp, "ALLDATAOBJ= $(NAME)all%s \n\n", OBJ_SUFFIX);
+ T_FileStream_writeLine(makefile, tmp);
+#endif
+
sprintf(tmp, "TOCSYM= $(ENTRYPOINT)_dat \n\n"); /* entrypoint not always shortname! */
T_FileStream_writeLine(makefile, tmp);
T_FileStream_writeLine(makefile, "BASE_OBJECTS= $(TOCOBJ) ");
+#ifdef OS400
+ T_FileStream_writeLine(makefile, "$(ALLDATAOBJ) ");
+#else
pkg_writeCharListWrap(makefile, objects, " ", " \\\n",0);
+#endif
+ pkg_mak_writeAssemblyFooter(makefile, o);
+
T_FileStream_writeLine(makefile, "\n\n");
T_FileStream_writeLine(makefile, "OBJECTS=$(BASE_OBJECTS:%=$(TEMP_PATH)%)\n\n");