1#******************************************************************************
2#
3#   Copyright (C) 1999-2011, International Business Machines
4#   Corporation and others.  All Rights Reserved.
5#
6#******************************************************************************
7## Makefile.in for ICU - tools/toolutil
8## Steven R. Loomis
9
10## Source directory information
11srcdir = @srcdir@
12top_srcdir = @top_srcdir@
13
14top_builddir = ../..
15
16## All the flags and other definitions are included here.
17include $(top_builddir)/icudefs.mk
18
19## Build directory information
20subdir = tools/toolutil
21
22## Extra files to remove for 'make clean'
23CLEANFILES = *~ $(DEPS) $(IMPORT_LIB) $(MIDDLE_IMPORT_LIB) $(FINAL_IMPORT_LIB)
24
25## Target information
26
27TARGET_STUBNAME=$(TOOLUTIL_STUBNAME)
28
29ifneq ($(ENABLE_STATIC),)
30TARGET = $(LIBDIR)/$(LIBSICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(A)
31endif
32
33ifneq ($(ENABLE_SHARED),)
34SO_TARGET = $(LIBDIR)/$(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(SO)
35ALL_SO_TARGETS = $(SO_TARGET) $(MIDDLE_SO_TARGET) $(FINAL_SO_TARGET) $(SHARED_OBJECT)
36endif
37
38ALL_TARGETS = $(TARGET) $(ALL_SO_TARGETS)
39
40DYNAMICCPPFLAGS = $(SHAREDLIBCPPFLAGS)
41DYNAMICCFLAGS = $(SHAREDLIBCFLAGS)
42DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
43CFLAGS += $(LIBCFLAGS)
44CXXFLAGS += $(LIBCXXFLAGS)
45
46CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n $(LIBCPPFLAGS)
47
48# from icuinfo
49CPPFLAGS+=  "-DU_BUILD=\"@build@\"" "-DU_HOST=\"@host@\"" "-DU_CC=\"@CC@\"" "-DU_CXX=\"@CXX@\""
50
51
52DEFS += -DU_TOOLUTIL_IMPLEMENTATION
53LDFLAGS += $(LDFLAGSICUTOOLUTIL)
54LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS)
55
56OBJECTS = filestrm.o package.o pkgitems.o swapimpl.o toolutil.o unewdata.o \
57denseranges.o \
58ucm.o ucmstate.o uoptions.o uparse.o \
59ucbuf.o xmlparser.o writesrc.o \
60pkg_icu.o pkg_genc.o pkg_gencmn.o ppucd.o flagparser.o filetools.o \
61udbgutil.o dbgutil.o ucln_tu.o
62
63STATIC_OBJECTS = $(OBJECTS:.o=.$(STATIC_O))
64
65DEPS = $(OBJECTS:.o=.d)
66
67-include Makefile.local
68
69## List of phony targets
70.PHONY : all all-local install install-local clean clean-local	\
71distclean distclean-local install-library dist	\
72dist-local check check-local
73
74## Clear suffix list
75.SUFFIXES :
76
77## List of standard targets
78all: all-local
79install: install-local
80clean: clean-local
81distclean : distclean-local
82dist: dist-local
83check: all check-local
84
85all-local: $(ALL_TARGETS)
86
87install-local: install-library
88
89install-library: all-local
90	$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
91ifneq ($(ENABLE_STATIC),)
92	$(INSTALL-L) $(TARGET) $(DESTDIR)$(libdir)
93endif
94ifneq ($(ENABLE_SHARED),)
95	$(INSTALL-L) $(FINAL_SO_TARGET) $(DESTDIR)$(libdir)
96ifneq ($(FINAL_SO_TARGET),$(SO_TARGET))
97	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(SO_TARGET))
98ifneq ($(FINAL_SO_TARGET),$(MIDDLE_SO_TARGET))
99	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(MIDDLE_SO_TARGET))
100endif
101endif
102ifneq ($(IMPORT_LIB_EXT),)
103	$(INSTALL-L) $(FINAL_IMPORT_LIB) $(DESTDIR)$(libdir)
104ifneq ($(IMPORT_LIB),$(FINAL_IMPORT_LIB))
105	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(IMPORT_LIB))
106endif
107ifneq ($(MIDDLE_IMPORT_LIB),$(FINAL_IMPORT_LIB))
108	cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(MIDDLE_IMPORT_LIB))
109endif
110endif
111endif
112
113dist-local:
114
115clean-local:
116	test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
117	$(RMV) $(OBJECTS) $(STATIC_OBJECTS) $(ALL_TARGETS)
118
119distclean-local: clean-local
120	$(RMV) Makefile
121
122check-local: all-local
123
124Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
125	cd $(top_builddir) \
126	 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
127
128ifneq ($(ENABLE_STATIC),)
129$(TARGET): $(STATIC_OBJECTS)
130	$(AR) $(ARFLAGS) $(AR_OUTOPT)$@ $^
131	$(RANLIB) $@
132endif
133
134ifneq ($(ENABLE_SHARED),)
135$(SHARED_OBJECT): $(OBJECTS)
136	$(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(LIBS)
137ifeq ($(ENABLE_RPATH),YES)
138ifneq ($(wildcard $(libdir)/$(MIDDLE_SO_TARGET)),)
139	$(warning RPATH warning: --enable-rpath means test programs may use existing $(libdir)/$(MIDDLE_SO_TARGET))
140endif
141endif
142endif
143
144ifeq (,$(MAKECMDGOALS))
145-include $(DEPS)
146else
147ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),)
148-include $(DEPS)
149endif
150endif
151
152