• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# -*- makefile -*-
2#
3# Copyright (C) 2017 and later: Unicode, Inc. and others.
4# License & terms of use: http://www.unicode.org/copyright.html
5#
6# Copyright (c) 2008-2013 IBM Corp. and Others. All Rights Reserved
7
8include $(MULTICU_ROOT)/common/Makefile-multi.inc
9
10C_GOOD:=$(shell [ -d $(C_INS) ] && (cd $(C_INS) ; ls -d */$(S_INS) 2>/dev/null | cut -d/ -f1))
11C_REL:=$(shell [ -d $(C_INS) ] && (cd $(C_INS) ; ls -d r*/$(S_INS) 2>/dev/null | cut -d/ -f1))
12
13C_CLEAN_TARGET=$(C_GOOD:%=$(C_INS)/%/bin/$(TARGET))
14
15SOURCES=$(C_SOURCES) $(CXX_SOURCES)
16C_OBJECTS=$(C_SOURCES:%.c=%.o)
17CXX_OBJECTS=$(CXX_SOURCES:%.cpp=%.o)
18OBJECTS=$(C_OBJECTS) $(CXX_OBJECTS)
19#DEBUGOPT=-g
20
21# list of ICUs to be built
22ICU_TARBALLS=$(shell cd $(ICUS) ; ls icu4c-*-src.tgz)
23# list of versions ( form "3_8  4_0" etc. )
24ICU_TARBALLS_VERS=$(ICU_TARBALLS:icu4c-%-src.tgz=%)
25
26
27$(C_INS)/%/bin/$(TARGET):	$(SOURCES) $(HEADERS)
28	-rm -rf $(C_INS)/$*/tmp
29	mkdir $(C_INS)/$*/tmp
30ifneq (,$(CXX_OBJECTS))
31	@for file in $(CXX_OBJECTS); \
32	do \
33		what=`basename $$file .o` ; \
34		echo tools=$(C_BLD)/$*/icu/source/tools/toolutil ; \
35		echo compiling '(C++)' $*/$$what ; \
36		echo `$(C_INS)/$*/bin/icu-config --cxx` `$(C_INS)/$*/bin/icu-config --cxxflags` $(DEBUGOPT)  -c -o $(C_INS)/$*/tmp/$$what.o $$what.cpp -I $(C_INS)/$*/include -I $(C_BLD)/$*/icu/source/tools/toolutil ; \
37		`$(C_INS)/$*/bin/icu-config --cxx` `$(C_INS)/$*/bin/icu-config --cxxflags` $(DEBUGOPT)  -c -o $(C_INS)/$*/tmp/$$what.o $$what.cpp -I $(C_INS)/$*/include -I $(C_BLD)/$*/icu/source/tools/toolutil  || \
38		$(CXX) $(DEBUGOPT) -c -o $(C_INS)/$*/tmp/$$what.o $${what}.cpp -I $(C_INS)/$*/include -I $(C_BLD)/$*/icu/source/tools/toolutil ; \
39	done
40endif
41ifneq (,$(C_OBJECTS))
42	@for file in $(C_OBJECTS); \
43	do \
44		what=`basename $$file .o` ; \
45		echo compiling '(C  )' $*/$$what ; \
46		$(CC) $(DEBUGOPT) -c -o $(C_INS)/$*/tmp/$$what.o $${what}.c -I $(C_INS)/$*/include -I $(C_BLD)/$*/icu/source/tools/toolutil ; \
47	done
48endif
49	@echo linking $*/$$what
50	@echo `$(C_INS)/$*/bin/icu-config --cxx` `$(C_INS)/$*/bin/icu-config --ldflags `  $(DEBUGOPT) -o $@ $(OBJECTS:%.o=$(C_INS)/$*/tmp/%.o)  -licudata -licuuc -licutu -licui18n -licuio -L$(C_INS)/$*/lib
51	@`$(C_INS)/$*/bin/icu-config --cxx` -Wl,--verbose `$(C_INS)/$*/bin/icu-config --ldflags `  $(DEBUGOPT) -o $@ $(OBJECTS:%.o=$(C_INS)/$*/tmp/%.o)  -licudata -licuuc -licutu -licui18n -licuio -L$(C_INS)/$*/lib || \
52	 $(CXX) $(DEBUGOPT) -o $@ $(OBJECTS:%.o=$(C_INS)/$*/tmp/%.o)  -licudata -licuuc -licutu -licui18n -licuio -L$(C_INS)/$*/lib
53
54
55