1 ## ******************************************************************************
3 ## * Copyright (C) 1999-2014, International Business Machines
4 ## * Corporation and others. All Rights Reserved.
6 ## *******************************************************************************
7 ## Makefile.in for ICU - uconv
10 ## Set the following to dll or static or common..
12 ##############################################################
15 top_srcdir=@top_srcdir@
20 include $(top_builddir)/icudefs.mk
24 # RESSRC comes from resfiles.mk
26 include $(srcdir)/resfiles.mk
29 RESFILES=$(RESSRC:$(RESOURCESDIR)$(FILESEPCHAR)%.txt=$(RESDIR)/%.res)
33 TARGET_STUB_NAME = uconv
37 ALL_MAN_FILES = $(TARGET_STUB_NAME).$(SECTION)
39 ## Extra files to remove for 'make clean'
40 CLEANFILES = *~ $(DEPS) $(ALL_MAN_FILES)
43 TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
45 CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil
46 CPPFLAGS += -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit
47 LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
49 ifeq ($(PKGDATA_OPTS),)
50 PKGDATA_OPTS = -O pkgdata.inc
53 ## generic settings for data - common.
55 INSTALLTO=$(DESTDIR)$(ICUDATA_DIR)
56 UCONVMSG_LIB=package-resfiles
59 ifeq ($(UCONVMSG_MODE),static)
60 DEFS += -DUCONVMSG_LINK=$(MSGNAME)
61 UCONVMSG_LIB = $(RESDIR)/$(LIBPREFIX)$(STATIC_PREFIX_WHEN_USED)$(MSGNAME).$(A)
62 LIBS += $(UCONVMSG_LIB)
68 ifeq ($(UCONVMSG_MODE),dll)
69 DEFS += -DUCONVMSG_LINK=$(MSGNAME)
70 LIBS += -L$(RESDIR) -l$(MSGNAME)
75 OBJECTS = uconv.o uwmsg.o
77 DEPS = $(OBJECTS:.o=.d)
79 ## List of phony targets
80 .PHONY : all all-local install install-local clean clean-local \
81 distclean resclean distclean-local dist dist-local \
82 check check-local build-dir package-resfiles install-resfiles install-man
87 ## List of standard targets
90 install: install-local
92 distclean : distclean-local
96 all-local: build-dir $(TARGET) $(ALL_MAN_FILES)
98 install-local: all-local install-target install-resfiles install-man
100 install-target: all-local
101 $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
102 $(INSTALL) $(TARGET) $(DESTDIR)$(bindir)
106 clean-local: resclean
107 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) $(RESFILES)
108 $(RMV) $(OBJECTS) $(TARGET)
111 @#-$(INVOKE) $(TOOLBINDIR)/pkgdata --clean -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
112 $(RMV) pkgdata.inc $(RESDIR)
114 distclean-local: clean-local
115 $(RMV) Makefile $(DEPS)
117 check-local: $(TARGET)
118 ifneq (,$(filter $(PKGDATA_MODE),files common))
119 @echo "Currently, pkgdata is in \"$(PKGDATA_MODE)\" mode."
120 @echo "To test uconv, run this manually after installing ICU:"
121 @echo "\"./$(TARGET) -f ibm-37 $(srcdir)/samples/ibm-37-test.txt\""
123 $(INVOKE) ./$(TARGET) -f ibm-37 $(srcdir)/samples/ibm-37-test.txt
126 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
128 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
130 pkgdata.inc: pkgdataMakefile
131 $(MAKE) -f pkgdataMakefile
134 @$(MKINSTALLDIRS) $(RESDIR)
138 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
140 $(TARGET_STUB_NAME).$(SECTION): $(srcdir)/$(TARGET_STUB_NAME).$(SECTION).in pkgdata.inc
142 && CONFIG_FILES=$(subdir)/$(TARGET_STUB_NAME).$(SECTION) CONFIG_HEADERS= $(SHELL) ./config.status
144 $(TARGET) : $(OBJECTS) $(UCONVMSG_LIB)
145 $(LINK.cc) $(OUTOPT)$@ $(OBJECTS) $(LIBS)
148 # The | is an order-only prerequisite. This helps when the -j option is used,
149 # and we don't want the files to be built before the directories are built.
150 ifneq ($(filter order-only,$(.FEATURES)),)
151 $(RESFILES) $(RESDIR)/$(RESDIR).lst: | build-dir
154 $(UCONVMSG_LIB): $(RESFILES) $(RESDIR)/$(RESDIR).lst pkgdata.inc
155 $(INVOKE) $(PKGDATA_INVOKE_OPTS) $(TOOLBINDIR)/pkgdata -p $(MSGNAME) $(PKGDATA_OPTS) -m $(PKGMODE) -s $(RESDIR) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
157 $(RESDIR)/$(RESDIR).lst: Makefile $(srcdir)/resfiles.mk
159 @for file in $(RESFILES:$(RESDIR)/%.res=%.res); do \
163 # no install for static mode
164 ifneq ($(UCONVMSG_MODE),static)
165 install-resfiles: $(RESFILES) $(RESDIR)/$(RESDIR).lst pkgdata.inc
166 $(MKINSTALLDIRS) $(DESTDIR)$(ICUDATA_DIR)
167 $(INVOKE) $(TOOLBINDIR)/pkgdata -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -I $(INSTALLTO) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
172 $(MSGNAME)/%.res: $(srcdir)/$(RESOURCESDIR)/%.txt
173 $(INVOKE) $(TOOLBINDIR)/genrb -e UTF-8 -s $(^D) -d $(@D) $(^F)
175 install-man: $(ALL_MAN_FILES)
176 $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
177 $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)