michael@0: ## -*-makefile-*- michael@0: ## HP/UX-specific setup using aCC michael@0: ## Copyright (c) 1999-2012, International Business Machines Corporation and michael@0: ## others. All Rights Reserved. michael@0: michael@0: ## Commands to generate dependency files michael@0: GEN_DEPS.c= : michael@0: GEN_DEPS.cc= : michael@0: michael@0: ## Flags for position independent code michael@0: SHAREDLIBCFLAGS = +Z michael@0: SHAREDLIBCXXFLAGS = +Z michael@0: michael@0: ## Additional flags when building libraries with threads michael@0: ## We use this instead of -mt, which isn't available in all versions of aCC michael@0: ## Our tools won't compile with -D_POSIX_C_SOURCE=199506L michael@0: THREADSCPPFLAGS = -D_REENTRANT -D_THREAD_SAFE michael@0: michael@0: # Use Extended ANSI mode, which is useful for 64-bit numbers michael@0: # +W ignores some warnings michael@0: # 740 Unsafe cast between pointers/references to incomplete classes... michael@0: # 749 This operation is non-portable and potentially unsafe. michael@0: # (Ironically the solution to fix this warning is non-portable) michael@0: # 823 Redundant preprocessing concatenation operation results in two valid michael@0: # preprocessing tokens. This comes from INT64_C in michael@0: # 4232 conversion to a more strictly aligned type may cause misaligned access. michael@0: CFLAGS += -Ae +Olit=all michael@0: CXXFLAGS += -AA -Wc,-ansi_for_scope,on +W740 +W749 +W823 +W4232 michael@0: michael@0: ifeq ($(UCLN_NO_AUTO_CLEANUP),0) michael@0: # set up init point. michael@0: UCLN_FINI = ucln_fini$(TARGET_STUBNAME)_$(SO_TARGET_VERSION_MAJOR)$(ICULIBSUFFIXCNAME) michael@0: CPPFLAGS_FINI = -DUCLN_FINI=$(UCLN_FINI) michael@0: LDFLAGS_FINI = -Wl,+fini,$(UCLN_FINI) michael@0: michael@0: CPPFLAGSICUUC += $(CPPFLAGS_FINI) michael@0: LDFLAGSICUUC += $(LDFLAGS_FINI) michael@0: CPPFLAGSICUIO += $(CPPFLAGS_FINI) michael@0: LDFLAGSICUIO += $(LDFLAGS_FINI) michael@0: CPPFLAGSICUI18N += $(CPPFLAGS_FINI) michael@0: LDFLAGSICUI18N += $(LDFLAGS_FINI) michael@0: CPPFLAGSCTESTFW += $(CPPFLAGS_FINI) michael@0: LDFLAGSCTESTFW += $(LDFLAGS_FINI) michael@0: michael@0: # ICUUC, ICUIO, ICUI18N, CTESTFW michael@0: endif michael@0: michael@0: # -Bhidden_def Hides all symbols defined in the module. michael@0: #LIBCFLAGS = -Bhidden_def michael@0: #LIBCXXFLAGS = -Bhidden_def michael@0: michael@0: ## Commands to compile michael@0: COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c michael@0: COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c michael@0: michael@0: ## Common 'default' path to ensure the sanity of users. Search the current michael@0: ## directory, at least. michael@0: LD_DEFAULTPATH= -Wl,+b,'$$'ORIGIN/ michael@0: michael@0: # Use SHLIB_PATH and LD_LIBRARY_PATH to locate shared libraries michael@0: LDFLAGS += -Wl,+s $(LD_DEFAULTPATH) michael@0: michael@0: ## Commands to link michael@0: ## For aCC, use the C++ linker so that __shlinit gets defined michael@0: LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) michael@0: LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) michael@0: michael@0: ## Shared library options michael@0: ## HPUX PA-risc does not recognize -Bprotected_def aC++ option. michael@0: ## Use linker option -Wl,-B,symbolic instead. michael@0: ifeq ($(shell uname -m),ia64) michael@0: LD_SOOPTIONS= -Bprotected_def michael@0: else michael@0: LD_SOOPTIONS= -Wl,-B,symbolic michael@0: endif michael@0: michael@0: ## Commands to make a shared library michael@0: #SHLIB.c= $(LD) $(LDFLAGS) -b michael@0: SHLIB.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) -b $(LD_SOOPTIONS) michael@0: SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -b $(LD_SOOPTIONS) michael@0: michael@0: ## Compiler switch to embed a runtime search path michael@0: LD_RPATH= -Wl,+b, michael@0: LD_RPATH_PRE= michael@0: michael@0: ## Environment variable to set a runtime search path michael@0: LDLIBRARYPATH_ENVVAR = SHLIB_PATH michael@0: michael@0: ## Compiler switch to embed a library name michael@0: LD_SONAME = -Wl,+h,$(notdir $(MIDDLE_SO_TARGET)) michael@0: michael@0: ## The type of assembly needed when pkgdata is used for generating shared libraries. michael@0: # Commented out for now because the hp1 test machine runs out of memory. michael@0: #GENCCODE_ASSEMBLY=-a aCC-parisc michael@0: michael@0: ## Shared object suffix michael@0: SO= sl michael@0: ## Non-shared intermediate object suffix michael@0: STATIC_O = o michael@0: michael@0: ## Compilation rules michael@0: %.$(STATIC_O): $(srcdir)/%.c michael@0: $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< michael@0: %.o: $(srcdir)/%.c michael@0: $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< michael@0: michael@0: %.$(STATIC_O): $(srcdir)/%.cpp michael@0: $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< michael@0: %.o: $(srcdir)/%.cpp michael@0: $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< michael@0: michael@0: michael@0: ## Dependency rules michael@0: %.d : $(srcdir)/%.c michael@0: @echo "generating dependency information for $<" michael@0: @$(GEN_DEPS.c) $< > $@ michael@0: michael@0: %.d : $(srcdir)/%.cpp michael@0: @echo "generating dependency information for $<" michael@0: @$(GEN_DEPS.cc) $< > $@ michael@0: michael@0: ## Versioned libraries rules michael@0: michael@0: %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) michael@0: $(RM) $@ && ln -s ${