1## -*-makefile-*- 2## Copyright (C) 2016 and later: Unicode, Inc. and others. 3## License & terms of use: http://www.unicode.org/copyright.html 4## Solaris-specific setup using Sun's compilers 5## Copyright (c) 1999-2010, International Business Machines Corporation and 6## others. All Rights Reserved. 7 8## Flags for ICU 59+ 9CXXFLAGS += -std=c++11 10CFLAGS += -std=c11 11 12## Flags for position independent code 13SHAREDLIBCFLAGS = -KPIC 14SHAREDLIBCXXFLAGS = -KPIC 15SHAREDLIBCPPFLAGS = -DPIC 16 17## Commands to generate dependency files 18GEN_DEPS.c= $(CC) -xM $(DEFS) $(CPPFLAGS) 19GEN_DEPS.cc= $(CXX) -xM $(DEFS) $(CPPFLAGS) 20 21ifeq ($(UCLN_NO_AUTO_CLEANUP),0) 22# set up init point. 23UCLN_FINI = ucln_fini$(TARGET_STUBNAME)_$(SO_TARGET_VERSION_MAJOR)$(ICULIBSUFFIXCNAME) 24CPPFLAGS_FINI = -DUCLN_FINI=$(UCLN_FINI) 25LDFLAGS_FINI = -zfiniarray=$(UCLN_FINI) 26 27CPPFLAGSICUUC += $(CPPFLAGS_FINI) 28LDFLAGSICUUC += $(LDFLAGS_FINI) 29CPPFLAGSICUIO += $(CPPFLAGS_FINI) 30LDFLAGSICUIO += $(LDFLAGS_FINI) 31CPPFLAGSICUI18N += $(CPPFLAGS_FINI) 32LDFLAGSICUI18N += $(LDFLAGS_FINI) 33CPPFLAGSCTESTFW += $(CPPFLAGS_FINI) 34LDFLAGSCTESTFW += $(LDFLAGS_FINI) 35 36# ICUUC, ICUIO, ICUI18N, CTESTFW 37endif 38 39# -mt means 'compiles and links a multithreaded program' 40THREADSCFLAGS += -mt 41THREADSCXXFLAGS += -mt 42 43## Commands to link 44## For Sun Workshop, use CC to link to bring in C++ runtime 45LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) 46LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) 47 48## Commands to make a shared library 49SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -G 50SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -G 51 52## Compiler switch to embed a runtime search path 53LD_RPATH= -R'$$'ORIGIN 54LD_RPATH_PRE= -R 55 56#LIBRARY_PATH_PREFIX=/usr/lib/lwp: 57 58## Compiler switch to embed a library name 59LD_SONAME = -h $(notdir $(MIDDLE_SO_TARGET)) $(PKGDATA_TRAILING_SPACE) 60 61## Shared object suffix 62SO= so 63## Non-shared intermediate object suffix 64STATIC_O = o 65 66# This causes escapesrc to be built before other ICU targets. 67NEED_ESCAPING=YES 68 69## Compilation rules 70%.$(STATIC_O): $(srcdir)/%.c 71 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< 72%.o: $(srcdir)/%.c 73 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< 74 75ifneq ($(SKIP_ESCAPING),) 76%.o: $(srcdir)/%.cpp 77 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< 78%.$(STATIC_O): $(srcdir)/%.cpp 79 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< 80else 81# convert *.cpp files to _*.cpp with \u / \U escaping 82CLEANFILES += _*.cpp 83 84# the actual escaping 85_%.cpp: $(srcdir)/%.cpp 86 @$(BINDIR)/escapesrc$(EXEEXT) $< $@ 87 88# no escaping - bootstrap 89%.$(STATIC_O): _%.cpp 90 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< 91%.o: _%.cpp 92 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< 93endif 94 95## Dependency rules 96%.d : $(srcdir)/%.c 97 @echo "generating dependency information for $<" 98 @$(GEN_DEPS.c) $< > $@ 99 100%.d : $(srcdir)/%.cpp 101 @echo "generating dependency information for $<" 102 @$(GEN_DEPS.cc) $< > $@ 103 104## Versioned libraries rules 105 106%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) 107 $(RM) $@ && ln -s ${<F} $@ 108%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR) 109 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@ 110 111# 112ifeq (strip $(GENCCODE_ASSEMBLY),) 113BIR_LDFLAGS= -Wl,-M,$(NAME).map -Wl,-B,symbolic -Wl,-B,eliminate 114BIR_DEPS= $(NAME).map 115endif 116 117## Remove shared library 's' 118STATIC_PREFIX_WHEN_USED = 119STATIC_PREFIX = 120 121## End Solaris-specific setup 122