## ******************************************************************************
## *
-## * Copyright (C) 1999-2006, International Business Machines
+## * Copyright (C) 1999-2014, International Business Machines
## * Corporation and others. All Rights Reserved.
## *
## *******************************************************************************
## Target information
TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil
+CPPFLAGS += -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit
LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
ifeq ($(PKGDATA_OPTS),)
## generic settings for data - common.
PKGMODE=common
INSTALLTO=$(DESTDIR)$(ICUDATA_DIR)
-UCONVMSG_LIB=dummy
+UCONVMSG_LIB=package-resfiles
## Static mode
ifeq ($(UCONVMSG_MODE),static)
DEFS += -DUCONVMSG_LINK=$(MSGNAME)
-UCONVMSG_LIB = $(RESDIR)/$(LIBPREFIX)$(MSGNAME).$(A)
+UCONVMSG_LIB = $(RESDIR)/$(LIBPREFIX)$(STATIC_PREFIX_WHEN_USED)$(MSGNAME).$(A)
LIBS += $(UCONVMSG_LIB)
PKGMODE=static
INSTALLTO=$(libdir)
## List of phony targets
.PHONY : all all-local install install-local clean clean-local \
-distclean resclean distclean-local dist dist-local check check-local resfiles package-resfiles install-resfiles install-man
+distclean resclean distclean-local dist dist-local \
+check check-local build-dir package-resfiles install-resfiles install-man
## Clear suffix list
.SUFFIXES :
dist: dist-local
check: check-local
-all-local: $(TARGET) resfiles $(ALL_MAN_FILES)
+all-local: build-dir $(TARGET) $(ALL_MAN_FILES)
install-local: all-local install-target install-resfiles install-man
$(RMV) $(OBJECTS) $(TARGET)
resclean:
- @#-$(INVOKE) $(BINDIR)/pkgdata --clean -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
+ @#-$(INVOKE) $(TOOLBINDIR)/pkgdata --clean -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
$(RMV) pkgdata.inc $(RESDIR)
distclean-local: clean-local
$(RMV) Makefile $(DEPS)
-check-local:
+check-local: $(TARGET)
+ifneq (,$(filter $(PKGDATA_MODE),files common))
+ @echo "Currently, pkgdata is in \"$(PKGDATA_MODE)\" mode."
+ @echo "To test uconv, run this manually after installing ICU:"
+ @echo "\"./$(TARGET) -f ibm-37 $(srcdir)/samples/ibm-37-test.txt\""
+else
+ $(INVOKE) ./$(TARGET) -f ibm-37 $(srcdir)/samples/ibm-37-test.txt
+endif
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-pkgdata.inc: $(srcdir)/pkgdata.inc.in $(top_builddir)/config.status
+pkgdata.inc: pkgdataMakefile
+ $(MAKE) -f pkgdataMakefile
+
+build-dir:
+ @$(MKINSTALLDIRS) $(RESDIR)
+
+pkgdataMakefile:
cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(TARGET_STUB_NAME).$(SECTION): $(srcdir)/$(TARGET_STUB_NAME).$(SECTION).in pkgdata.inc
cd $(top_builddir) \
$(TARGET) : $(OBJECTS) $(UCONVMSG_LIB)
$(LINK.cc) $(OUTOPT)$@ $(OBJECTS) $(LIBS)
+ $(POST_BUILD_STEP)
-resfiles: $(RESFILES) package-resfiles
-
-ifeq ($(UCONVMSG_STATIC),YES)
-$(UCONVMSG_LIB): resfiles
+# The | is an order-only prerequisite. This helps when the -j option is used,
+# and we don't want the files to be built before the directories are built.
+ifneq ($(filter order-only,$(.FEATURES)),)
+$(RESFILES) $(RESDIR)/$(RESDIR).lst: | build-dir
endif
-
-package-resfiles: $(RESDIR)/$(RESDIR).lst pkgdata.inc
- $(INVOKE) $(PKGDATA_INVOKE_OPTS) $(BINDIR)/pkgdata -p $(MSGNAME) $(PKGDATA_OPTS) -m $(PKGMODE) -s $(RESDIR) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
+$(UCONVMSG_LIB): $(RESFILES) $(RESDIR)/$(RESDIR).lst pkgdata.inc
+ $(INVOKE) $(PKGDATA_INVOKE_OPTS) $(TOOLBINDIR)/pkgdata -p $(MSGNAME) $(PKGDATA_OPTS) -m $(PKGMODE) -s $(RESDIR) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
$(RESDIR)/$(RESDIR).lst: Makefile $(srcdir)/resfiles.mk
- @$(MKINSTALLDIRS) $(RESDIR)
@-$(RMV) $@
@for file in $(RESFILES:$(RESDIR)/%.res=%.res); do \
echo $$file >> $@; \
# no install for static mode
ifneq ($(UCONVMSG_MODE),static)
-install-resfiles: $(RESFILES)
+install-resfiles: $(RESFILES) $(RESDIR)/$(RESDIR).lst pkgdata.inc
$(MKINSTALLDIRS) $(DESTDIR)$(ICUDATA_DIR)
- $(INVOKE) $(BINDIR)/pkgdata -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -I $(INSTALLTO) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
+ $(INVOKE) $(TOOLBINDIR)/pkgdata -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -I $(INSTALLTO) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
else
install-resfiles:
endif
-##
-$(UCONVMSG_LIB): resfiles
-
$(MSGNAME)/%.res: $(srcdir)/$(RESOURCESDIR)/%.txt
- $(MKINSTALLDIRS) $(@D)
- $(INVOKE) $(BINDIR)/genrb -e UTF-8 -s $(^D) -d $(@D) $(^F)
+ $(INVOKE) $(TOOLBINDIR)/genrb -e UTF-8 -s $(^D) -d $(@D) $(^F)
install-man: $(ALL_MAN_FILES)
$(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)