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 position independent code 9 SHAREDLIBCFLAGS = -KPIC 10 SHAREDLIBCXXFLAGS = -KPIC 11 SHAREDLIBCPPFLAGS = -DPIC 12 13 ## Commands to generate dependency files 14 GEN_DEPS.c= $(CC) -xM $(DEFS) $(CPPFLAGS) 15 GEN_DEPS.cc= $(CXX) -xM $(DEFS) $(CPPFLAGS) 16 17 ifeq ($(UCLN_NO_AUTO_CLEANUP),0) 18 # set up init point. 19 UCLN_FINI = ucln_fini$(TARGET_STUBNAME)_$(SO_TARGET_VERSION_MAJOR)$(ICULIBSUFFIXCNAME) 20 CPPFLAGS_FINI = -DUCLN_FINI=$(UCLN_FINI) 21 LDFLAGS_FINI = -zfiniarray=$(UCLN_FINI) 22 23 CPPFLAGSICUUC += $(CPPFLAGS_FINI) 24 LDFLAGSICUUC += $(LDFLAGS_FINI) 25 CPPFLAGSICUIO += $(CPPFLAGS_FINI) 26 LDFLAGSICUIO += $(LDFLAGS_FINI) 27 CPPFLAGSICUI18N += $(CPPFLAGS_FINI) 28 LDFLAGSICUI18N += $(LDFLAGS_FINI) 29 CPPFLAGSCTESTFW += $(CPPFLAGS_FINI) 30 LDFLAGSCTESTFW += $(LDFLAGS_FINI) 31 32 # ICUUC, ICUIO, ICUI18N, CTESTFW 33 endif 34 35 # -mt means 'compiles and links a multithreaded program' 36 THREADSCFLAGS += -mt 37 THREADSCXXFLAGS += -mt 38 39 ## Commands to link 40 ## For Sun Workshop, use CC to link to bring in C++ runtime 41 LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) 42 LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) 43 44 ## Commands to make a shared library 45 SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -G 46 SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -G 47 48 ## Compiler switch to embed a runtime search path 49 LD_RPATH= -R'$$'ORIGIN 50 LD_RPATH_PRE= -R 51 52 #LIBRARY_PATH_PREFIX=/usr/lib/lwp: 53 54 ## Compiler switch to embed a library name 55 LD_SONAME = -h $(notdir $(MIDDLE_SO_TARGET)) 56 57 ## Shared object suffix 58 SO= so 59 ## Non-shared intermediate object suffix 60 STATIC_O = o 61 62 ## Compilation rules 63 %.$(STATIC_O): $(srcdir)/%.c 64 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< 65 %.o: $(srcdir)/%.c 66 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< 67 68 %.$(STATIC_O): $(srcdir)/%.cpp 69 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< 70 %.o: $(srcdir)/%.cpp 71 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< 72 73 74 ## Dependency rules 75 %.d : $(srcdir)/%.c 76 @echo "generating dependency information for $<" 77 @$(GEN_DEPS.c) $< > $@ 78 79 %.d : $(srcdir)/%.cpp 80 @echo "generating dependency information for $<" 81 @$(GEN_DEPS.cc) $< > $@ 82 83 ## Versioned libraries rules 84 85 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) 86 $(RM) $@ && ln -s ${<F} $@ 87 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR) 88 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@ 89 90 # 91 ifeq (strip $(GENCCODE_ASSEMBLY),) 92 BIR_LDFLAGS= -Wl,-M,$(NAME).map -Wl,-B,symbolic -Wl,-B,eliminate 93 BIR_DEPS= $(NAME).map 94 endif 95 96 ## Remove shared library 's' 97 STATIC_PREFIX_WHEN_USED = 98 STATIC_PREFIX = 99 100 ## End Solaris-specific setup 101