• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## ******************************************************************************
2## *
3## *   Copyright (C) 1999-2011, 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..
11UCONVMSG_MODE=static
12##############################################################
13
14srcdir=@srcdir@
15top_srcdir=@top_srcdir@
16
17top_builddir = ../..
18subdir = extra/uconv
19
20include $(top_builddir)/icudefs.mk
21
22MSGNAME=uconvmsg
23
24# RESSRC comes from resfiles.mk
25FILESEPCHAR=/
26include $(srcdir)/resfiles.mk
27
28RESDIR=$(MSGNAME)
29RESFILES=$(RESSRC:$(RESOURCESDIR)$(FILESEPCHAR)%.txt=$(RESDIR)/%.res)
30
31##
32
33TARGET_STUB_NAME = uconv
34
35SECTION = 1
36
37ALL_MAN_FILES = $(TARGET_STUB_NAME).$(SECTION)
38
39## Extra files to remove for 'make clean'
40CLEANFILES = *~ $(DEPS) $(ALL_MAN_FILES)
41
42## Target information
43TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
44
45CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil
46LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
47
48ifeq ($(PKGDATA_OPTS),)
49PKGDATA_OPTS = -O pkgdata.inc
50endif
51
52## generic settings for data - common.
53PKGMODE=common
54INSTALLTO=$(DESTDIR)$(ICUDATA_DIR)
55UCONVMSG_LIB=dummy
56
57## Static mode
58ifeq ($(UCONVMSG_MODE),static)
59DEFS += -DUCONVMSG_LINK=$(MSGNAME)
60UCONVMSG_LIB = $(RESDIR)/$(LIBPREFIX)$(MSGNAME).$(A)
61LIBS += $(UCONVMSG_LIB)
62PKGMODE=static
63INSTALLTO=$(libdir)
64endif
65
66## DLL mode
67ifeq ($(UCONVMSG_MODE),dll)
68DEFS += -DUCONVMSG_LINK=$(MSGNAME)
69LIBS += -L$(RESDIR) -l$(MSGNAME)
70PKGMODE=dll
71INSTALLTO=$(libdir)
72endif
73
74OBJECTS = uconv.o uwmsg.o
75
76DEPS = $(OBJECTS:.o=.d)
77
78## List of phony targets
79.PHONY : all all-local install install-local clean clean-local \
80distclean 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
86all: all-local
87
88install: install-local
89clean: clean-local
90distclean : distclean-local
91dist: dist-local
92check: check-local
93
94all-local: $(TARGET) resfiles $(ALL_MAN_FILES)
95
96install-local: all-local install-target install-resfiles install-man
97
98install-target: all-local
99	$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
100	$(INSTALL) $(TARGET) $(DESTDIR)$(bindir)
101
102dist-local:
103
104clean-local: resclean
105	test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) $(RESFILES)
106	$(RMV) $(OBJECTS) $(TARGET)
107
108resclean:
109	@#-$(INVOKE) $(TOOLBINDIR)/pkgdata --clean -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
110	$(RMV) pkgdata.inc $(RESDIR)
111
112distclean-local: clean-local
113	$(RMV) Makefile $(DEPS)
114
115check-local: $(TARGET)
116ifneq (,$(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\""
120else
121	$(INVOKE) ./$(TARGET) -f ibm-37 $(srcdir)/samples/ibm-37-test.txt
122endif
123
124Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
125	cd $(top_builddir) \
126	 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
127
128pkgdata.inc: pkgdataMakefile
129	$(MAKE) -f pkgdataMakefile
130
131pkgdataMakefile:
132	cd $(top_builddir) \
133	&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
134
135$(TARGET_STUB_NAME).$(SECTION): $(srcdir)/$(TARGET_STUB_NAME).$(SECTION).in pkgdata.inc
136	cd $(top_builddir) \
137	 && CONFIG_FILES=$(subdir)/$(TARGET_STUB_NAME).$(SECTION) CONFIG_HEADERS= $(SHELL) ./config.status
138
139$(TARGET) : $(OBJECTS)  $(UCONVMSG_LIB)
140	$(LINK.cc) $(OUTOPT)$@ $(OBJECTS) $(LIBS)
141	$(POST_BUILD_STEP)
142
143resfiles: $(RESFILES) package-resfiles
144
145ifeq ($(UCONVMSG_STATIC),YES)
146$(UCONVMSG_LIB): resfiles
147endif
148
149
150package-resfiles: $(RESFILES) $(RESDIR)/$(RESDIR).lst pkgdata.inc
151	$(INVOKE) $(PKGDATA_INVOKE_OPTS) $(TOOLBINDIR)/pkgdata -p $(MSGNAME) $(PKGDATA_OPTS) -m $(PKGMODE) -s $(RESDIR) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
152
153$(RESDIR)/$(RESDIR).lst: Makefile $(srcdir)/resfiles.mk
154	@$(MKINSTALLDIRS) $(RESDIR)
155	@-$(RMV) $@
156	@for file in $(RESFILES:$(RESDIR)/%.res=%.res); do \
157	  echo $$file >> $@; \
158	done;
159
160# no install for static mode
161ifneq ($(UCONVMSG_MODE),static)
162install-resfiles: $(RESFILES) $(RESDIR)/$(RESDIR).lst pkgdata.inc
163	$(MKINSTALLDIRS) $(DESTDIR)$(ICUDATA_DIR)
164	$(INVOKE) $(TOOLBINDIR)/pkgdata -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -I $(INSTALLTO) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst
165else
166install-resfiles:
167endif
168
169##
170$(UCONVMSG_LIB): resfiles
171
172$(MSGNAME)/%.res: $(srcdir)/$(RESOURCESDIR)/%.txt
173	$(MKINSTALLDIRS) $(@D)
174	$(INVOKE) $(TOOLBINDIR)/genrb -e UTF-8 -s $(^D) -d $(@D) $(^F)
175
176install-man: $(ALL_MAN_FILES)
177	$(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
178	$(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
179
180
181
182