1 ## ******************************************************************************
3 ## * Copyright (C) 1999-2012, 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 LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
48 ifeq ($(PKGDATA_OPTS),)
49 PKGDATA_OPTS = -O pkgdata.inc
52 ## generic settings for data - common.
54 INSTALLTO=$(DESTDIR)$(ICUDATA_DIR)
58 ifeq ($(UCONVMSG_MODE),static)
59 DEFS += -DUCONVMSG_LINK=$(MSGNAME)
60 UCONVMSG_LIB = $(RESDIR)/$(LIBPREFIX)$(STATIC_PREFIX_WHEN_USED)$(MSGNAME).$(A)
61 LIBS += $(UCONVMSG_LIB)
67 ifeq ($(UCONVMSG_MODE),dll)
68 DEFS += -DUCONVMSG_LINK=$(MSGNAME)
69 LIBS += -L$(RESDIR) -l$(MSGNAME)
74 OBJECTS = uconv.o uwmsg.o
76 DEPS = $(OBJECTS:.o=.d)
78 ## List of phony targets
79 .PHONY : all all-local install install-local clean clean-local \
80 distclean resclean distclean-local dist dist-local check check-local resfiles package-resfiles install-resfiles install-man
85 ## List of standard targets
88 install: install-local
90 distclean : distclean-local
94 all-local: $(TARGET) resfiles $(ALL_MAN_FILES)
96 install-local: all-local install-target install-resfiles install-man
98 install-target: all-local
99 $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
100 $(INSTALL) $(TARGET) $(DESTDIR)$(bindir)
104 clean-local: resclean
105 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) $(RESFILES)
106 $(RMV) $(OBJECTS) $(TARGET)
109 @#-$(INVOKE) $(TOOLBINDIR)/pkgdata --clean -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
110 $(RMV) pkgdata.inc $(RESDIR)
112 distclean-local: clean-local
113 $(RMV) Makefile $(DEPS)
115 check-local: $(TARGET)
116 ifneq (,$(filter $(PKGDATA_MODE),files common))
117 @echo "Currently, pkgdata is in \"$(PKGDATA_MODE)\" mode."
118 @echo "To test uconv, run this manually after installing ICU:"
119 @echo "\"./$(TARGET) -f ibm-37 $(srcdir)/samples/ibm-37-test.txt\""
121 $(INVOKE) ./$(TARGET) -f ibm-37 $(srcdir)/samples/ibm-37-test.txt
124 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
126 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
128 pkgdata.inc: pkgdataMakefile
129 $(MAKE) -f pkgdataMakefile
133 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
135 $(TARGET_STUB_NAME).$(SECTION): $(srcdir)/$(TARGET_STUB_NAME).$(SECTION).in pkgdata.inc
137 && CONFIG_FILES=$(subdir)/$(TARGET_STUB_NAME).$(SECTION) CONFIG_HEADERS= $(SHELL) ./config.status
139 $(TARGET) : $(OBJECTS) $(UCONVMSG_LIB)
140 $(LINK.cc) $(OUTOPT)$@ $(OBJECTS) $(LIBS)
143 resfiles: $(RESFILES) package-resfiles
145 ifeq ($(UCONVMSG_STATIC),YES)
146 $(UCONVMSG_LIB): resfiles
150 package-resfiles: $(RESFILES) $(RESDIR)/$(RESDIR).lst pkgdata.inc
151 $(INVOKE) $(PKGDATA_INVOKE_OPTS) $(TOOLBINDIR)/pkgdata -p $(MSGNAME) $(PKGDATA_OPTS) -m $(PKGMODE) -s $(RESDIR) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
153 $(RESDIR)/$(RESDIR).lst: Makefile $(srcdir)/resfiles.mk
154 @$(MKINSTALLDIRS) $(RESDIR)
156 @for file in $(RESFILES:$(RESDIR)/%.res=%.res); do \
160 # no install for static mode
161 ifneq ($(UCONVMSG_MODE),static)
162 install-resfiles: $(RESFILES) $(RESDIR)/$(RESDIR).lst pkgdata.inc
163 $(MKINSTALLDIRS) $(DESTDIR)$(ICUDATA_DIR)
164 $(INVOKE) $(TOOLBINDIR)/pkgdata -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -I $(INSTALLTO) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
170 $(UCONVMSG_LIB): resfiles
172 $(MSGNAME)/%.res: $(srcdir)/$(RESOURCESDIR)/%.txt
173 $(MKINSTALLDIRS) $(@D)
174 $(INVOKE) $(TOOLBINDIR)/genrb -e UTF-8 -s $(^D) -d $(@D) $(^F)
176 install-man: $(ALL_MAN_FILES)
177 $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
178 $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)