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