]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | ## ****************************************************************************** |
2 | ## * | |
729e4ab9 | 3 | ## * Copyright (C) 1999-2009, 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 A |
44 | |
45 | CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil | |
46 | LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M) | |
47 | ||
374ca955 A |
48 | ifeq ($(PKGDATA_OPTS),) |
49 | PKGDATA_OPTS = -O pkgdata.inc | |
50 | endif | |
51 | ||
b75a7d8f A |
52 | ## generic settings for data - common. |
53 | PKGMODE=common | |
54 | INSTALLTO=$(DESTDIR)$(ICUDATA_DIR) | |
55 | UCONVMSG_LIB=dummy | |
56 | ||
57 | ## Static mode | |
58 | ifeq ($(UCONVMSG_MODE),static) | |
59 | DEFS += -DUCONVMSG_LINK=$(MSGNAME) | |
374ca955 | 60 | UCONVMSG_LIB = $(RESDIR)/$(LIBPREFIX)$(MSGNAME).$(A) |
b75a7d8f A |
61 | LIBS += $(UCONVMSG_LIB) |
62 | PKGMODE=static | |
63 | INSTALLTO=$(libdir) | |
64 | endif | |
65 | ||
66 | ## DLL mode | |
67 | ifeq ($(UCONVMSG_MODE),dll) | |
68 | DEFS += -DUCONVMSG_LINK=$(MSGNAME) | |
69 | LIBS += -L$(RESDIR) -l$(MSGNAME) | |
70 | PKGMODE=dll | |
71 | INSTALLTO=$(libdir) | |
72 | endif | |
73 | ||
74 | OBJECTS = uconv.o uwmsg.o | |
75 | ||
76 | DEPS = $(OBJECTS:.o=.d) | |
77 | ||
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 | |
81 | ||
82 | ## Clear suffix list | |
83 | .SUFFIXES : | |
84 | ||
85 | ## List of standard targets | |
86 | all: all-local | |
87 | ||
88 | install: install-local | |
89 | clean: clean-local | |
90 | distclean : distclean-local | |
91 | dist: dist-local | |
92 | check: check-local | |
93 | ||
94 | all-local: $(TARGET) resfiles $(ALL_MAN_FILES) | |
95 | ||
96 | install-local: all-local install-target install-resfiles install-man | |
97 | ||
98 | install-target: all-local | |
99 | $(MKINSTALLDIRS) $(DESTDIR)$(bindir) | |
374ca955 | 100 | $(INSTALL) $(TARGET) $(DESTDIR)$(bindir) |
b75a7d8f A |
101 | |
102 | dist-local: | |
103 | ||
104 | clean-local: resclean | |
105 | test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) $(RESFILES) | |
106 | $(RMV) $(OBJECTS) $(TARGET) | |
107 | ||
108 | resclean: | |
729e4ab9 | 109 | @#-$(INVOKE) $(TOOLBINDIR)/pkgdata --clean -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst |
b75a7d8f A |
110 | $(RMV) pkgdata.inc $(RESDIR) |
111 | ||
112 | distclean-local: clean-local | |
113 | $(RMV) Makefile $(DEPS) | |
114 | ||
729e4ab9 A |
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\"" | |
120 | else | |
121 | $(INVOKE) ./$(TARGET) -f ibm-37 $(srcdir)/samples/ibm-37-test.txt | |
122 | endif | |
b75a7d8f | 123 | |
73c04bcf | 124 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
b75a7d8f A |
125 | cd $(top_builddir) \ |
126 | && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status | |
127 | ||
729e4ab9 A |
128 | pkgdata.inc: pkgdataMakefile |
129 | $(MAKE) -f pkgdataMakefile | |
130 | ||
131 | pkgdataMakefile: | |
b75a7d8f | 132 | cd $(top_builddir) \ |
729e4ab9 | 133 | && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status |
b75a7d8f | 134 | |
73c04bcf | 135 | $(TARGET_STUB_NAME).$(SECTION): $(srcdir)/$(TARGET_STUB_NAME).$(SECTION).in pkgdata.inc |
374ca955 | 136 | cd $(top_builddir) \ |
73c04bcf | 137 | && CONFIG_FILES=$(subdir)/$(TARGET_STUB_NAME).$(SECTION) CONFIG_HEADERS= $(SHELL) ./config.status |
374ca955 | 138 | |
b75a7d8f | 139 | $(TARGET) : $(OBJECTS) $(UCONVMSG_LIB) |
374ca955 | 140 | $(LINK.cc) $(OUTOPT)$@ $(OBJECTS) $(LIBS) |
46f4442e | 141 | $(POST_BUILD_STEP) |
b75a7d8f A |
142 | |
143 | resfiles: $(RESFILES) package-resfiles | |
144 | ||
145 | ifeq ($(UCONVMSG_STATIC),YES) | |
146 | $(UCONVMSG_LIB): resfiles | |
147 | endif | |
148 | ||
149 | ||
150 | package-resfiles: $(RESDIR)/$(RESDIR).lst pkgdata.inc | |
729e4ab9 | 151 | $(INVOKE) $(PKGDATA_INVOKE_OPTS) $(TOOLBINDIR)/pkgdata -p $(MSGNAME) $(PKGDATA_OPTS) -m $(PKGMODE) -s $(RESDIR) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst |
b75a7d8f | 152 | |
73c04bcf | 153 | $(RESDIR)/$(RESDIR).lst: Makefile $(srcdir)/resfiles.mk |
b75a7d8f A |
154 | @$(MKINSTALLDIRS) $(RESDIR) |
155 | @-$(RMV) $@ | |
73c04bcf A |
156 | @for file in $(RESFILES:$(RESDIR)/%.res=%.res); do \ |
157 | echo $$file >> $@; \ | |
b75a7d8f A |
158 | done; |
159 | ||
160 | # no install for static mode | |
161 | ifneq ($(UCONVMSG_MODE),static) | |
162 | install-resfiles: $(RESFILES) | |
163 | $(MKINSTALLDIRS) $(DESTDIR)$(ICUDATA_DIR) | |
729e4ab9 | 164 | $(INVOKE) $(TOOLBINDIR)/pkgdata -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -I $(INSTALLTO) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst |
73c04bcf A |
165 | else |
166 | install-resfiles: | |
b75a7d8f A |
167 | endif |
168 | ||
169 | ## | |
170 | $(UCONVMSG_LIB): resfiles | |
171 | ||
73c04bcf | 172 | $(MSGNAME)/%.res: $(srcdir)/$(RESOURCESDIR)/%.txt |
b75a7d8f | 173 | $(MKINSTALLDIRS) $(@D) |
729e4ab9 | 174 | $(INVOKE) $(TOOLBINDIR)/genrb -e UTF-8 -s $(^D) -d $(@D) $(^F) |
b75a7d8f A |
175 | |
176 | install-man: $(ALL_MAN_FILES) | |
177 | $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION) | |
178 | $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION) | |
179 | ||
b75a7d8f | 180 | |
b75a7d8f | 181 |