]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | ## ****************************************************************************** |
2 | ## * | |
57a6839d | 3 | ## * Copyright (C) 1999-2014, International Business Machines |
b75a7d8f A |
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) | |
73c04bcf | 29 | RESFILES=$(RESSRC:$(RESOURCESDIR)$(FILESEPCHAR)%.txt=$(RESDIR)/%.res) |
b75a7d8f A |
30 | |
31 | ## | |
32 | ||
374ca955 A |
33 | TARGET_STUB_NAME = uconv |
34 | ||
b75a7d8f A |
35 | SECTION = 1 |
36 | ||
374ca955 | 37 | ALL_MAN_FILES = $(TARGET_STUB_NAME).$(SECTION) |
b75a7d8f A |
38 | |
39 | ## Extra files to remove for 'make clean' | |
40 | CLEANFILES = *~ $(DEPS) $(ALL_MAN_FILES) | |
41 | ||
42 | ## Target information | |
374ca955 | 43 | TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT) |
b75a7d8f | 44 | |
4388f060 | 45 | CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil |
57a6839d | 46 | CPPFLAGS += -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit |
b75a7d8f A |
47 | LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M) |
48 | ||
374ca955 A |
49 | ifeq ($(PKGDATA_OPTS),) |
50 | PKGDATA_OPTS = -O pkgdata.inc | |
51 | endif | |
52 | ||
b75a7d8f A |
53 | ## generic settings for data - common. |
54 | PKGMODE=common | |
55 | INSTALLTO=$(DESTDIR)$(ICUDATA_DIR) | |
51004dcb | 56 | UCONVMSG_LIB=package-resfiles |
b75a7d8f A |
57 | |
58 | ## Static mode | |
59 | ifeq ($(UCONVMSG_MODE),static) | |
60 | DEFS += -DUCONVMSG_LINK=$(MSGNAME) | |
4388f060 | 61 | UCONVMSG_LIB = $(RESDIR)/$(LIBPREFIX)$(STATIC_PREFIX_WHEN_USED)$(MSGNAME).$(A) |
b75a7d8f 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 \ | |
51004dcb A |
81 | distclean resclean distclean-local dist dist-local \ |
82 | check check-local build-dir package-resfiles install-resfiles install-man | |
b75a7d8f A |
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 | ||
51004dcb | 96 | all-local: build-dir $(TARGET) $(ALL_MAN_FILES) |
b75a7d8f A |
97 | |
98 | install-local: all-local install-target install-resfiles install-man | |
99 | ||
100 | install-target: all-local | |
101 | $(MKINSTALLDIRS) $(DESTDIR)$(bindir) | |
374ca955 | 102 | $(INSTALL) $(TARGET) $(DESTDIR)$(bindir) |
b75a7d8f A |
103 | |
104 | dist-local: | |
105 | ||
106 | clean-local: resclean | |
107 | test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) $(RESFILES) | |
108 | $(RMV) $(OBJECTS) $(TARGET) | |
109 | ||
110 | resclean: | |
729e4ab9 | 111 | @#-$(INVOKE) $(TOOLBINDIR)/pkgdata --clean -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst |
b75a7d8f A |
112 | $(RMV) pkgdata.inc $(RESDIR) |
113 | ||
114 | distclean-local: clean-local | |
115 | $(RMV) Makefile $(DEPS) | |
116 | ||
729e4ab9 A |
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 | |
b75a7d8f | 125 | |
73c04bcf | 126 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
b75a7d8f A |
127 | cd $(top_builddir) \ |
128 | && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status | |
129 | ||
729e4ab9 A |
130 | pkgdata.inc: pkgdataMakefile |
131 | $(MAKE) -f pkgdataMakefile | |
132 | ||
51004dcb A |
133 | build-dir: |
134 | @$(MKINSTALLDIRS) $(RESDIR) | |
135 | ||
729e4ab9 | 136 | pkgdataMakefile: |
b75a7d8f | 137 | cd $(top_builddir) \ |
729e4ab9 | 138 | && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status |
b75a7d8f | 139 | |
73c04bcf | 140 | $(TARGET_STUB_NAME).$(SECTION): $(srcdir)/$(TARGET_STUB_NAME).$(SECTION).in pkgdata.inc |
374ca955 | 141 | cd $(top_builddir) \ |
73c04bcf | 142 | && CONFIG_FILES=$(subdir)/$(TARGET_STUB_NAME).$(SECTION) CONFIG_HEADERS= $(SHELL) ./config.status |
374ca955 | 143 | |
b75a7d8f | 144 | $(TARGET) : $(OBJECTS) $(UCONVMSG_LIB) |
374ca955 | 145 | $(LINK.cc) $(OUTOPT)$@ $(OBJECTS) $(LIBS) |
46f4442e | 146 | $(POST_BUILD_STEP) |
b75a7d8f | 147 | |
51004dcb A |
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 | |
b75a7d8f A |
152 | endif |
153 | ||
51004dcb | 154 | $(UCONVMSG_LIB): $(RESFILES) $(RESDIR)/$(RESDIR).lst pkgdata.inc |
729e4ab9 | 155 | $(INVOKE) $(PKGDATA_INVOKE_OPTS) $(TOOLBINDIR)/pkgdata -p $(MSGNAME) $(PKGDATA_OPTS) -m $(PKGMODE) -s $(RESDIR) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst |
b75a7d8f | 156 | |
73c04bcf | 157 | $(RESDIR)/$(RESDIR).lst: Makefile $(srcdir)/resfiles.mk |
b75a7d8f | 158 | @-$(RMV) $@ |
73c04bcf A |
159 | @for file in $(RESFILES:$(RESDIR)/%.res=%.res); do \ |
160 | echo $$file >> $@; \ | |
b75a7d8f A |
161 | done; |
162 | ||
163 | # no install for static mode | |
164 | ifneq ($(UCONVMSG_MODE),static) | |
4388f060 | 165 | install-resfiles: $(RESFILES) $(RESDIR)/$(RESDIR).lst pkgdata.inc |
b75a7d8f | 166 | $(MKINSTALLDIRS) $(DESTDIR)$(ICUDATA_DIR) |
729e4ab9 | 167 | $(INVOKE) $(TOOLBINDIR)/pkgdata -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -I $(INSTALLTO) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst |
73c04bcf A |
168 | else |
169 | install-resfiles: | |
b75a7d8f A |
170 | endif |
171 | ||
73c04bcf | 172 | $(MSGNAME)/%.res: $(srcdir)/$(RESOURCESDIR)/%.txt |
729e4ab9 | 173 | $(INVOKE) $(TOOLBINDIR)/genrb -e UTF-8 -s $(^D) -d $(@D) $(^F) |
b75a7d8f A |
174 | |
175 | install-man: $(ALL_MAN_FILES) | |
176 | $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION) | |
177 | $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION) | |
178 | ||
b75a7d8f | 179 | |
b75a7d8f | 180 |