]> git.saurik.com Git - apple/icu.git/blob - icuSources/extra/uconv/Makefile.in
ICU-57166.0.1.tar.gz
[apple/icu.git] / icuSources / extra / uconv / Makefile.in
1 ## ******************************************************************************
2 ## *
3 ## * Copyright (C) 1999-2014, International Business Machines
4 ## * Corporation and others. All Rights Reserved.
5 ## *
6 ## *******************************************************************************
7 ## Makefile.in for ICU - uconv
8 ## Steven R. Loomis
9
10 ## Set the following to dll or static or common..
11 UCONVMSG_MODE=static
12 ##############################################################
13
14 srcdir=@srcdir@
15 top_srcdir=@top_srcdir@
16
17 top_builddir = ../..
18 subdir = extra/uconv
19
20 include $(top_builddir)/icudefs.mk
21
22 MSGNAME=uconvmsg
23
24 # RESSRC comes from resfiles.mk
25 FILESEPCHAR=/
26 include $(srcdir)/resfiles.mk
27
28 RESDIR=$(MSGNAME)
29 RESFILES=$(RESSRC:$(RESOURCESDIR)$(FILESEPCHAR)%.txt=$(RESDIR)/%.res)
30
31 ##
32
33 TARGET_STUB_NAME = uconv
34
35 SECTION = 1
36
37 ALL_MAN_FILES = $(TARGET_STUB_NAME).$(SECTION)
38
39 ## Extra files to remove for 'make clean'
40 CLEANFILES = *~ $(DEPS) $(ALL_MAN_FILES)
41
42 ## Target information
43 TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
44
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)
48
49 ifeq ($(PKGDATA_OPTS),)
50 PKGDATA_OPTS = -O pkgdata.inc
51 endif
52
53 ## generic settings for data - common.
54 PKGMODE=common
55 INSTALLTO=$(DESTDIR)$(ICUDATA_DIR)
56 UCONVMSG_LIB=package-resfiles
57
58 ## Static mode
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)
63 PKGMODE=static
64 INSTALLTO=$(libdir)
65 endif
66
67 ## DLL mode
68 ifeq ($(UCONVMSG_MODE),dll)
69 DEFS += -DUCONVMSG_LINK=$(MSGNAME)
70 LIBS += -L$(RESDIR) -l$(MSGNAME)
71 PKGMODE=dll
72 INSTALLTO=$(libdir)
73 endif
74
75 OBJECTS = uconv.o uwmsg.o
76
77 DEPS = $(OBJECTS:.o=.d)
78
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
83
84 ## Clear suffix list
85 .SUFFIXES :
86
87 ## List of standard targets
88 all: all-local
89
90 install: install-local
91 clean: clean-local
92 distclean : distclean-local
93 dist: dist-local
94 check: check-local
95
96 all-local: build-dir $(TARGET) $(ALL_MAN_FILES)
97
98 install-local: all-local install-target install-resfiles install-man
99
100 install-target: all-local
101 $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
102 $(INSTALL) $(TARGET) $(DESTDIR)$(bindir)
103
104 dist-local:
105
106 clean-local: resclean
107 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) $(RESFILES)
108 $(RMV) $(OBJECTS) $(TARGET)
109
110 resclean:
111 @#-$(INVOKE) $(TOOLBINDIR)/pkgdata --clean -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
112 $(RMV) pkgdata.inc $(RESDIR)
113
114 distclean-local: clean-local
115 $(RMV) Makefile $(DEPS)
116
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\""
122 else
123 $(INVOKE) ./$(TARGET) -f ibm-37 $(srcdir)/samples/ibm-37-test.txt
124 endif
125
126 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
127 cd $(top_builddir) \
128 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
129
130 pkgdata.inc: pkgdataMakefile
131 $(MAKE) -f pkgdataMakefile
132
133 build-dir:
134 @$(MKINSTALLDIRS) $(RESDIR)
135
136 pkgdataMakefile:
137 cd $(top_builddir) \
138 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
139
140 $(TARGET_STUB_NAME).$(SECTION): $(srcdir)/$(TARGET_STUB_NAME).$(SECTION).in pkgdata.inc
141 cd $(top_builddir) \
142 && CONFIG_FILES=$(subdir)/$(TARGET_STUB_NAME).$(SECTION) CONFIG_HEADERS= $(SHELL) ./config.status
143
144 $(TARGET) : $(OBJECTS) $(UCONVMSG_LIB)
145 $(LINK.cc) $(OUTOPT)$@ $(OBJECTS) $(LIBS)
146 $(POST_BUILD_STEP)
147
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
152 endif
153
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
156
157 $(RESDIR)/$(RESDIR).lst: Makefile $(srcdir)/resfiles.mk
158 @-$(RMV) $@
159 @for file in $(RESFILES:$(RESDIR)/%.res=%.res); do \
160 echo $$file >> $@; \
161 done;
162
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
168 else
169 install-resfiles:
170 endif
171
172 $(MSGNAME)/%.res: $(srcdir)/$(RESOURCESDIR)/%.txt
173 $(INVOKE) $(TOOLBINDIR)/genrb -e UTF-8 -s $(^D) -d $(@D) $(^F)
174
175 install-man: $(ALL_MAN_FILES)
176 $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
177 $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
178
179
180