]>
Commit | Line | Data |
---|---|---|
f3c0d7a5 A |
1 | ## Copyright (C) 2016 and later: Unicode, Inc. and others. |
2 | ## License & terms of use: http://www.unicode.org/copyright.html | |
b75a7d8f A |
3 | ## ****************************************************************************** |
4 | ## * | |
57a6839d | 5 | ## * Copyright (C) 1999-2014, International Business Machines |
b75a7d8f A |
6 | ## * Corporation and others. All Rights Reserved. |
7 | ## * | |
8 | ## ******************************************************************************* | |
9 | ## Makefile.in for ICU - uconv | |
10 | ## Steven R. Loomis | |
11 | ||
12 | ## Set the following to dll or static or common.. | |
13 | UCONVMSG_MODE=static | |
14 | ############################################################## | |
15 | ||
16 | srcdir=@srcdir@ | |
17 | top_srcdir=@top_srcdir@ | |
18 | ||
19 | top_builddir = ../.. | |
20 | subdir = extra/uconv | |
21 | ||
22 | include $(top_builddir)/icudefs.mk | |
23 | ||
24 | MSGNAME=uconvmsg | |
25 | ||
26 | # RESSRC comes from resfiles.mk | |
27 | FILESEPCHAR=/ | |
28 | include $(srcdir)/resfiles.mk | |
29 | ||
30 | RESDIR=$(MSGNAME) | |
73c04bcf | 31 | RESFILES=$(RESSRC:$(RESOURCESDIR)$(FILESEPCHAR)%.txt=$(RESDIR)/%.res) |
b75a7d8f A |
32 | |
33 | ## | |
34 | ||
374ca955 A |
35 | TARGET_STUB_NAME = uconv |
36 | ||
b75a7d8f A |
37 | SECTION = 1 |
38 | ||
374ca955 | 39 | ALL_MAN_FILES = $(TARGET_STUB_NAME).$(SECTION) |
b75a7d8f A |
40 | |
41 | ## Extra files to remove for 'make clean' | |
42 | CLEANFILES = *~ $(DEPS) $(ALL_MAN_FILES) | |
43 | ||
44 | ## Target information | |
374ca955 | 45 | TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT) |
b75a7d8f | 46 | |
f3c0d7a5 | 47 | CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil |
57a6839d | 48 | CPPFLAGS += -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit |
b75a7d8f A |
49 | LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M) |
50 | ||
374ca955 A |
51 | ifeq ($(PKGDATA_OPTS),) |
52 | PKGDATA_OPTS = -O pkgdata.inc | |
53 | endif | |
54 | ||
b75a7d8f A |
55 | ## generic settings for data - common. |
56 | PKGMODE=common | |
57 | INSTALLTO=$(DESTDIR)$(ICUDATA_DIR) | |
51004dcb | 58 | UCONVMSG_LIB=package-resfiles |
b75a7d8f A |
59 | |
60 | ## Static mode | |
61 | ifeq ($(UCONVMSG_MODE),static) | |
62 | DEFS += -DUCONVMSG_LINK=$(MSGNAME) | |
4388f060 | 63 | UCONVMSG_LIB = $(RESDIR)/$(LIBPREFIX)$(STATIC_PREFIX_WHEN_USED)$(MSGNAME).$(A) |
b75a7d8f A |
64 | LIBS += $(UCONVMSG_LIB) |
65 | PKGMODE=static | |
66 | INSTALLTO=$(libdir) | |
67 | endif | |
68 | ||
69 | ## DLL mode | |
70 | ifeq ($(UCONVMSG_MODE),dll) | |
71 | DEFS += -DUCONVMSG_LINK=$(MSGNAME) | |
72 | LIBS += -L$(RESDIR) -l$(MSGNAME) | |
73 | PKGMODE=dll | |
74 | INSTALLTO=$(libdir) | |
75 | endif | |
76 | ||
77 | OBJECTS = uconv.o uwmsg.o | |
78 | ||
79 | DEPS = $(OBJECTS:.o=.d) | |
80 | ||
81 | ## List of phony targets | |
82 | .PHONY : all all-local install install-local clean clean-local \ | |
51004dcb A |
83 | distclean resclean distclean-local dist dist-local \ |
84 | check check-local build-dir package-resfiles install-resfiles install-man | |
b75a7d8f A |
85 | |
86 | ## Clear suffix list | |
87 | .SUFFIXES : | |
88 | ||
89 | ## List of standard targets | |
90 | all: all-local | |
91 | ||
92 | install: install-local | |
93 | clean: clean-local | |
94 | distclean : distclean-local | |
95 | dist: dist-local | |
96 | check: check-local | |
97 | ||
51004dcb | 98 | all-local: build-dir $(TARGET) $(ALL_MAN_FILES) |
b75a7d8f A |
99 | |
100 | install-local: all-local install-target install-resfiles install-man | |
101 | ||
102 | install-target: all-local | |
103 | $(MKINSTALLDIRS) $(DESTDIR)$(bindir) | |
374ca955 | 104 | $(INSTALL) $(TARGET) $(DESTDIR)$(bindir) |
b75a7d8f A |
105 | |
106 | dist-local: | |
107 | ||
108 | clean-local: resclean | |
109 | test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) $(RESFILES) | |
110 | $(RMV) $(OBJECTS) $(TARGET) | |
111 | ||
112 | resclean: | |
729e4ab9 | 113 | @#-$(INVOKE) $(TOOLBINDIR)/pkgdata --clean -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst |
b75a7d8f A |
114 | $(RMV) pkgdata.inc $(RESDIR) |
115 | ||
116 | distclean-local: clean-local | |
117 | $(RMV) Makefile $(DEPS) | |
118 | ||
729e4ab9 A |
119 | check-local: $(TARGET) |
120 | ifneq (,$(filter $(PKGDATA_MODE),files common)) | |
121 | @echo "Currently, pkgdata is in \"$(PKGDATA_MODE)\" mode." | |
122 | @echo "To test uconv, run this manually after installing ICU:" | |
123 | @echo "\"./$(TARGET) -f ibm-37 $(srcdir)/samples/ibm-37-test.txt\"" | |
124 | else | |
125 | $(INVOKE) ./$(TARGET) -f ibm-37 $(srcdir)/samples/ibm-37-test.txt | |
126 | endif | |
b75a7d8f | 127 | |
73c04bcf | 128 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
b75a7d8f A |
129 | cd $(top_builddir) \ |
130 | && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status | |
131 | ||
729e4ab9 A |
132 | pkgdata.inc: pkgdataMakefile |
133 | $(MAKE) -f pkgdataMakefile | |
134 | ||
51004dcb A |
135 | build-dir: |
136 | @$(MKINSTALLDIRS) $(RESDIR) | |
137 | ||
729e4ab9 | 138 | pkgdataMakefile: |
b75a7d8f | 139 | cd $(top_builddir) \ |
729e4ab9 | 140 | && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status |
b75a7d8f | 141 | |
73c04bcf | 142 | $(TARGET_STUB_NAME).$(SECTION): $(srcdir)/$(TARGET_STUB_NAME).$(SECTION).in pkgdata.inc |
374ca955 | 143 | cd $(top_builddir) \ |
73c04bcf | 144 | && CONFIG_FILES=$(subdir)/$(TARGET_STUB_NAME).$(SECTION) CONFIG_HEADERS= $(SHELL) ./config.status |
374ca955 | 145 | |
b75a7d8f | 146 | $(TARGET) : $(OBJECTS) $(UCONVMSG_LIB) |
374ca955 | 147 | $(LINK.cc) $(OUTOPT)$@ $(OBJECTS) $(LIBS) |
46f4442e | 148 | $(POST_BUILD_STEP) |
b75a7d8f | 149 | |
51004dcb A |
150 | # The | is an order-only prerequisite. This helps when the -j option is used, |
151 | # and we don't want the files to be built before the directories are built. | |
152 | ifneq ($(filter order-only,$(.FEATURES)),) | |
153 | $(RESFILES) $(RESDIR)/$(RESDIR).lst: | build-dir | |
b75a7d8f A |
154 | endif |
155 | ||
51004dcb | 156 | $(UCONVMSG_LIB): $(RESFILES) $(RESDIR)/$(RESDIR).lst pkgdata.inc |
729e4ab9 | 157 | $(INVOKE) $(PKGDATA_INVOKE_OPTS) $(TOOLBINDIR)/pkgdata -p $(MSGNAME) $(PKGDATA_OPTS) -m $(PKGMODE) -s $(RESDIR) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst |
b75a7d8f | 158 | |
73c04bcf | 159 | $(RESDIR)/$(RESDIR).lst: Makefile $(srcdir)/resfiles.mk |
b75a7d8f | 160 | @-$(RMV) $@ |
73c04bcf A |
161 | @for file in $(RESFILES:$(RESDIR)/%.res=%.res); do \ |
162 | echo $$file >> $@; \ | |
b75a7d8f A |
163 | done; |
164 | ||
165 | # no install for static mode | |
166 | ifneq ($(UCONVMSG_MODE),static) | |
4388f060 | 167 | install-resfiles: $(RESFILES) $(RESDIR)/$(RESDIR).lst pkgdata.inc |
b75a7d8f | 168 | $(MKINSTALLDIRS) $(DESTDIR)$(ICUDATA_DIR) |
729e4ab9 | 169 | $(INVOKE) $(TOOLBINDIR)/pkgdata -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -I $(INSTALLTO) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst |
73c04bcf A |
170 | else |
171 | install-resfiles: | |
b75a7d8f A |
172 | endif |
173 | ||
73c04bcf | 174 | $(MSGNAME)/%.res: $(srcdir)/$(RESOURCESDIR)/%.txt |
729e4ab9 | 175 | $(INVOKE) $(TOOLBINDIR)/genrb -e UTF-8 -s $(^D) -d $(@D) $(^F) |
b75a7d8f A |
176 | |
177 | install-man: $(ALL_MAN_FILES) | |
178 | $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION) | |
179 | $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION) | |
180 | ||
b75a7d8f | 181 | |
b75a7d8f | 182 |