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