Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
michael@0 | 1 | ## -*-makefile-*- |
michael@0 | 2 | ## HP/UX-specific setup using aCC |
michael@0 | 3 | ## Copyright (c) 1999-2012, International Business Machines Corporation and |
michael@0 | 4 | ## others. All Rights Reserved. |
michael@0 | 5 | |
michael@0 | 6 | ## Commands to generate dependency files |
michael@0 | 7 | GEN_DEPS.c= : |
michael@0 | 8 | GEN_DEPS.cc= : |
michael@0 | 9 | |
michael@0 | 10 | ## Flags for position independent code |
michael@0 | 11 | SHAREDLIBCFLAGS = +Z |
michael@0 | 12 | SHAREDLIBCXXFLAGS = +Z |
michael@0 | 13 | |
michael@0 | 14 | ## Additional flags when building libraries with threads |
michael@0 | 15 | ## We use this instead of -mt, which isn't available in all versions of aCC |
michael@0 | 16 | ## Our tools won't compile with -D_POSIX_C_SOURCE=199506L |
michael@0 | 17 | THREADSCPPFLAGS = -D_REENTRANT -D_THREAD_SAFE |
michael@0 | 18 | |
michael@0 | 19 | # Use Extended ANSI mode, which is useful for 64-bit numbers |
michael@0 | 20 | # +W ignores some warnings |
michael@0 | 21 | # 740 Unsafe cast between pointers/references to incomplete classes... |
michael@0 | 22 | # 749 This operation is non-portable and potentially unsafe. |
michael@0 | 23 | # (Ironically the solution to fix this warning is non-portable) |
michael@0 | 24 | # 823 Redundant preprocessing concatenation operation results in two valid |
michael@0 | 25 | # preprocessing tokens. This comes from INT64_C in <inttypes.h> |
michael@0 | 26 | # 4232 conversion to a more strictly aligned type may cause misaligned access. |
michael@0 | 27 | CFLAGS += -Ae +Olit=all |
michael@0 | 28 | CXXFLAGS += -AA -Wc,-ansi_for_scope,on +W740 +W749 +W823 +W4232 |
michael@0 | 29 | |
michael@0 | 30 | ifeq ($(UCLN_NO_AUTO_CLEANUP),0) |
michael@0 | 31 | # set up init point. |
michael@0 | 32 | UCLN_FINI = ucln_fini$(TARGET_STUBNAME)_$(SO_TARGET_VERSION_MAJOR)$(ICULIBSUFFIXCNAME) |
michael@0 | 33 | CPPFLAGS_FINI = -DUCLN_FINI=$(UCLN_FINI) |
michael@0 | 34 | LDFLAGS_FINI = -Wl,+fini,$(UCLN_FINI) |
michael@0 | 35 | |
michael@0 | 36 | CPPFLAGSICUUC += $(CPPFLAGS_FINI) |
michael@0 | 37 | LDFLAGSICUUC += $(LDFLAGS_FINI) |
michael@0 | 38 | CPPFLAGSICUIO += $(CPPFLAGS_FINI) |
michael@0 | 39 | LDFLAGSICUIO += $(LDFLAGS_FINI) |
michael@0 | 40 | CPPFLAGSICUI18N += $(CPPFLAGS_FINI) |
michael@0 | 41 | LDFLAGSICUI18N += $(LDFLAGS_FINI) |
michael@0 | 42 | CPPFLAGSCTESTFW += $(CPPFLAGS_FINI) |
michael@0 | 43 | LDFLAGSCTESTFW += $(LDFLAGS_FINI) |
michael@0 | 44 | |
michael@0 | 45 | # ICUUC, ICUIO, ICUI18N, CTESTFW |
michael@0 | 46 | endif |
michael@0 | 47 | |
michael@0 | 48 | # -Bhidden_def Hides all symbols defined in the module. |
michael@0 | 49 | #LIBCFLAGS = -Bhidden_def |
michael@0 | 50 | #LIBCXXFLAGS = -Bhidden_def |
michael@0 | 51 | |
michael@0 | 52 | ## Commands to compile |
michael@0 | 53 | COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c |
michael@0 | 54 | COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c |
michael@0 | 55 | |
michael@0 | 56 | ## Common 'default' path to ensure the sanity of users. Search the current |
michael@0 | 57 | ## directory, at least. |
michael@0 | 58 | LD_DEFAULTPATH= -Wl,+b,'$$'ORIGIN/ |
michael@0 | 59 | |
michael@0 | 60 | # Use SHLIB_PATH and LD_LIBRARY_PATH to locate shared libraries |
michael@0 | 61 | LDFLAGS += -Wl,+s $(LD_DEFAULTPATH) |
michael@0 | 62 | |
michael@0 | 63 | ## Commands to link |
michael@0 | 64 | ## For aCC, use the C++ linker so that __shlinit gets defined |
michael@0 | 65 | LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) |
michael@0 | 66 | LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) |
michael@0 | 67 | |
michael@0 | 68 | ## Shared library options |
michael@0 | 69 | ## HPUX PA-risc does not recognize -Bprotected_def aC++ option. |
michael@0 | 70 | ## Use linker option -Wl,-B,symbolic instead. |
michael@0 | 71 | ifeq ($(shell uname -m),ia64) |
michael@0 | 72 | LD_SOOPTIONS= -Bprotected_def |
michael@0 | 73 | else |
michael@0 | 74 | LD_SOOPTIONS= -Wl,-B,symbolic |
michael@0 | 75 | endif |
michael@0 | 76 | |
michael@0 | 77 | ## Commands to make a shared library |
michael@0 | 78 | #SHLIB.c= $(LD) $(LDFLAGS) -b |
michael@0 | 79 | SHLIB.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) -b $(LD_SOOPTIONS) |
michael@0 | 80 | SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -b $(LD_SOOPTIONS) |
michael@0 | 81 | |
michael@0 | 82 | ## Compiler switch to embed a runtime search path |
michael@0 | 83 | LD_RPATH= -Wl,+b, |
michael@0 | 84 | LD_RPATH_PRE= |
michael@0 | 85 | |
michael@0 | 86 | ## Environment variable to set a runtime search path |
michael@0 | 87 | LDLIBRARYPATH_ENVVAR = SHLIB_PATH |
michael@0 | 88 | |
michael@0 | 89 | ## Compiler switch to embed a library name |
michael@0 | 90 | LD_SONAME = -Wl,+h,$(notdir $(MIDDLE_SO_TARGET)) |
michael@0 | 91 | |
michael@0 | 92 | ## The type of assembly needed when pkgdata is used for generating shared libraries. |
michael@0 | 93 | # Commented out for now because the hp1 test machine runs out of memory. |
michael@0 | 94 | #GENCCODE_ASSEMBLY=-a aCC-parisc |
michael@0 | 95 | |
michael@0 | 96 | ## Shared object suffix |
michael@0 | 97 | SO= sl |
michael@0 | 98 | ## Non-shared intermediate object suffix |
michael@0 | 99 | STATIC_O = o |
michael@0 | 100 | |
michael@0 | 101 | ## Compilation rules |
michael@0 | 102 | %.$(STATIC_O): $(srcdir)/%.c |
michael@0 | 103 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< |
michael@0 | 104 | %.o: $(srcdir)/%.c |
michael@0 | 105 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< |
michael@0 | 106 | |
michael@0 | 107 | %.$(STATIC_O): $(srcdir)/%.cpp |
michael@0 | 108 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< |
michael@0 | 109 | %.o: $(srcdir)/%.cpp |
michael@0 | 110 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< |
michael@0 | 111 | |
michael@0 | 112 | |
michael@0 | 113 | ## Dependency rules |
michael@0 | 114 | %.d : $(srcdir)/%.c |
michael@0 | 115 | @echo "generating dependency information for $<" |
michael@0 | 116 | @$(GEN_DEPS.c) $< > $@ |
michael@0 | 117 | |
michael@0 | 118 | %.d : $(srcdir)/%.cpp |
michael@0 | 119 | @echo "generating dependency information for $<" |
michael@0 | 120 | @$(GEN_DEPS.cc) $< > $@ |
michael@0 | 121 | |
michael@0 | 122 | ## Versioned libraries rules |
michael@0 | 123 | |
michael@0 | 124 | %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) |
michael@0 | 125 | $(RM) $@ && ln -s ${<F} $@ |
michael@0 | 126 | %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR) |
michael@0 | 127 | $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@ |
michael@0 | 128 | |
michael@0 | 129 | ## Install libraries as executable |
michael@0 | 130 | INSTALL-L=$(INSTALL_PROGRAM) |
michael@0 | 131 | |
michael@0 | 132 | ## Remove shared library 's' |
michael@0 | 133 | STATIC_PREFIX_WHEN_USED = |
michael@0 | 134 | STATIC_PREFIX = |
michael@0 | 135 | |
michael@0 | 136 | ## End HP/UX-specific setup |