1 ## -*-makefile-*- 2 ## HPUX/gcc specific setup 3 ## Copyright (c) 1999-2011, International Business Machines Corporation and 4 ## others. All Rights Reserved. 5 6 ## Commands to generate dependency files 7 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) 8 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) 9 10 ## Flags for position independent code 11 SHAREDLIBCFLAGS = -fPIC 12 SHAREDLIBCXXFLAGS = -fPIC 13 SHAREDLIBCPPFLAGS = -DPIC 14 15 ## Common 'default' path to ensure the sanity of users. Search the current 16 ## directory, at least. 17 LD_DEFAULTPATH= -Wl,+b,.:'$$'ORIGIN/ 18 19 # Need to override this or we will get unworking assembly 20 GENCCODE_ASSEMBLY=-a gcc 21 22 # Get some handy functions defined properly 23 DEFS += -D_HPUX_SOURCE -D_POSIX_C_SOURCE=199506L 24 25 ## Commands to link 26 ## For aCC, use the C++ linker so that __shlinit gets defined 27 LINK.c= $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH) 28 LINK.cc= $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH) 29 30 ## Shared library options 31 LD_SOOPTIONS= -Wl,-Bsymbolic 32 33 ## Commands to make a shared library 34 SHLIB.c= $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH) $(LD_SOOPTIONS) 35 SHLIB.cc= $(CXX) $(DEFS) $(CXXFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH) $(LD_SOOPTIONS) 36 37 ## Compiler switch to embed a runtime search path 38 LD_RPATH= -Wl,+b, 39 LD_RPATH_PRE= 40 41 ## Compiler switch to embed a library name 42 LD_SONAME = -Wl,+h,$(notdir $(MIDDLE_SO_TARGET)) 43 44 ## Environment variable to set a runtime search path 45 LDLIBRARYPATH_ENVVAR = SHLIB_PATH 46 47 ## Shared object suffix 48 SO= sl 49 ## Non-shared intermediate object suffix 50 STATIC_O = o 51 52 ## Compilation rules 53 %.$(STATIC_O): $(srcdir)/%.c 54 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< 55 %.o: $(srcdir)/%.c 56 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< 57 58 %.$(STATIC_O): $(srcdir)/%.cpp 59 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< 60 %.o: $(srcdir)/%.cpp 61 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< 62 63 64 ## Dependency rules 65 %.d : $(srcdir)/%.c 66 @echo "Generating dependency information for $<" 67 @$(SHELL) -ec '$(GEN_DEPS.c) $< \ 68 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ 69 [ -s $@ ] || rm -f $@' 70 71 %.d : $(srcdir)/%.cpp 72 @echo "Generating dependency information for $<" 73 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ 74 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ 75 [ -s $@ ] || rm -f $@' 76 77 ## Versioned libraries rules 78 79 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) 80 $(RM) $@ && ln -s ${<F} $@ 81 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR) 82 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@ 83 84 ## Remove shared library 's' 85 STATIC_PREFIX_WHEN_USED = 86 STATIC_PREFIX = 87 88 ## End HPUX/gcc specific setup 89 90