]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | ## ****************************************************************************** |
2 | ## * | |
3 | ## * Copyright (C) 1999-2000, 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)/$(RESOURCESDIR)$(FILESEPCHAR)$(MSGNAME)_%.res) | |
30 | ||
31 | ## | |
32 | ||
33 | SECTION = 1 | |
34 | ||
35 | ALL_MAN_FILES = $(TARGET).$(SECTION) | |
36 | ||
37 | ## Extra files to remove for 'make clean' | |
38 | CLEANFILES = *~ $(DEPS) $(ALL_MAN_FILES) | |
39 | ||
40 | ## Target information | |
41 | TARGET = uconv | |
42 | ||
43 | CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil | |
44 | LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M) | |
45 | ||
46 | ## generic settings for data - common. | |
47 | PKGMODE=common | |
48 | INSTALLTO=$(DESTDIR)$(ICUDATA_DIR) | |
49 | UCONVMSG_LIB=dummy | |
50 | ||
51 | ## Static mode | |
52 | ifeq ($(UCONVMSG_MODE),static) | |
53 | DEFS += -DUCONVMSG_LINK=$(MSGNAME) | |
54 | UCONVMSG_LIB = $(RESDIR)/lib$(MSGNAME).a | |
55 | LIBS += $(UCONVMSG_LIB) | |
56 | PKGMODE=static | |
57 | INSTALLTO=$(libdir) | |
58 | endif | |
59 | ||
60 | ## DLL mode | |
61 | ifeq ($(UCONVMSG_MODE),dll) | |
62 | DEFS += -DUCONVMSG_LINK=$(MSGNAME) | |
63 | LIBS += -L$(RESDIR) -l$(MSGNAME) | |
64 | PKGMODE=dll | |
65 | INSTALLTO=$(libdir) | |
66 | endif | |
67 | ||
68 | OBJECTS = uconv.o uwmsg.o | |
69 | ||
70 | DEPS = $(OBJECTS:.o=.d) | |
71 | ||
72 | ## List of phony targets | |
73 | .PHONY : all all-local install install-local clean clean-local \ | |
74 | distclean resclean distclean-local dist dist-local check check-local resfiles package-resfiles install-resfiles install-man | |
75 | ||
76 | ## Clear suffix list | |
77 | .SUFFIXES : | |
78 | ||
79 | ## List of standard targets | |
80 | all: all-local | |
81 | ||
82 | install: install-local | |
83 | clean: clean-local | |
84 | distclean : distclean-local | |
85 | dist: dist-local | |
86 | check: check-local | |
87 | ||
88 | all-local: $(TARGET) resfiles $(ALL_MAN_FILES) | |
89 | ||
90 | install-local: all-local install-target install-resfiles install-man | |
91 | ||
92 | install-target: all-local | |
93 | $(MKINSTALLDIRS) $(DESTDIR)$(bindir) | |
94 | $(INSTALL) $(TARGET) $(DESTDIR)$(bindir)/$(TARGET) | |
95 | ||
96 | dist-local: | |
97 | ||
98 | clean-local: resclean | |
99 | test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) $(RESFILES) | |
100 | $(RMV) $(OBJECTS) $(TARGET) | |
101 | ||
102 | resclean: | |
103 | -$(INVOKE) $(top_builddir)/tools/pkgdata/pkgdata --clean -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst | |
104 | $(RMV) pkgdata.inc $(RESDIR) | |
105 | ||
106 | distclean-local: clean-local | |
107 | $(RMV) Makefile $(DEPS) | |
108 | ||
109 | check-local: | |
110 | ||
111 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | |
112 | cd $(top_builddir) \ | |
113 | && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status | |
114 | ||
115 | pkgdata.inc: $(srcdir)/pkgdata.inc.in $(top_builddir)/config.status | |
116 | cd $(top_builddir) \ | |
117 | && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status | |
118 | ||
119 | $(TARGET) : $(OBJECTS) $(UCONVMSG_LIB) | |
120 | $(LINK.cc) -o $@ $(OBJECTS) $(LIBS) | |
121 | ||
122 | resfiles: $(RESFILES) package-resfiles | |
123 | ||
124 | ifeq ($(UCONVMSG_STATIC),YES) | |
125 | $(UCONVMSG_LIB): resfiles | |
126 | endif | |
127 | ||
128 | ||
129 | package-resfiles: $(RESDIR)/$(RESDIR).lst pkgdata.inc | |
130 | $(INVOKE) $(top_builddir)/tools/pkgdata/pkgdata -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst | |
131 | ||
132 | $(RESDIR)/$(RESDIR).lst: Makefile pkgdata.inc $(srcdir)/resfiles.mk | |
133 | @$(MKINSTALLDIRS) $(RESDIR) | |
134 | @-$(RMV) $@ | |
135 | @for file in $(RESFILES); do \ | |
136 | echo `pwd`/$$file >> $@; \ | |
137 | done; | |
138 | ||
139 | # no install for static mode | |
140 | ifneq ($(UCONVMSG_MODE),static) | |
141 | install-resfiles: $(RESFILES) | |
142 | $(MKINSTALLDIRS) $(DESTDIR)$(ICUDATA_DIR) | |
143 | $(INVOKE) $(top_builddir)/tools/pkgdata/pkgdata -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -I $(INSTALLTO) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst | |
144 | endif | |
145 | ||
146 | ## | |
147 | $(UCONVMSG_LIB): resfiles | |
148 | ||
149 | $(RESDIR)/$(RESOURCESDIR)/$(MSGNAME)_%.res: $(srcdir)/$(RESOURCESDIR)/%.txt | |
150 | $(MKINSTALLDIRS) $(@D) | |
151 | $(INVOKE) $(top_builddir)/tools/genrb/genrb -p $(MSGNAME) -e UTF-8 -s $(^D) -d $(@D) $(^F) | |
152 | ||
153 | install-man: $(ALL_MAN_FILES) | |
154 | $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION) | |
155 | $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION) | |
156 | ||
157 | %.$(SECTION): $(srcdir)/%.$(SECTION).in | |
158 | cd $(top_builddir) \ | |
159 | && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status | |
160 | ||
161 | # Don't do this. This is a problem when changing platforms. | |
162 | #ifneq ($(MAKECMDGOALS),distclean) | |
163 | #-include $(DEPS) | |
164 | #endif | |
165 |