Home | History | Annotate | Download | only in config
      1 ## -*-makefile-*-
      2 ## HPUX/gcc specific setup
      3 ## Copyright (c) 1999-2012, 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 GENCCODE_ASSEMBLY=
     22 
     23 # Get some handy functions defined properly
     24 DEFS += -D_HPUX_SOURCE -D_POSIX_C_SOURCE=199506L
     25 
     26 ## Commands to link
     27 ## For aCC, use the C++ linker so that __shlinit gets defined
     28 LINK.c=     $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH)
     29 LINK.cc=    $(CXX) $(DEFS) $(LDFLAGS) -Wl,+s $(LD_DEFAULTPATH)
     30 
     31 ## Shared library options
     32 LD_SOOPTIONS= -Wl,-Bsymbolic
     33 
     34 ## Commands to make a shared library
     35 SHLIB.c=  $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH) $(LD_SOOPTIONS)
     36 SHLIB.cc= $(CXX) $(DEFS) $(CXXFLAGS) $(LDFLAGS) $(SHAREDLIBCXXFLAGS) -shared -Wl,+s $(LD_DEFAULTPATH) $(LD_SOOPTIONS)
     37 
     38 ## Compiler switch to embed a runtime search path
     39 LD_RPATH=   -Wl,+b,
     40 LD_RPATH_PRE=
     41 
     42 ## Compiler switch to embed a library name
     43 LD_SONAME = -Wl,+h,$(notdir $(MIDDLE_SO_TARGET))
     44 
     45 ## Environment variable to set a runtime search path
     46 LDLIBRARYPATH_ENVVAR = SHLIB_PATH
     47 
     48 ## Shared object suffix
     49 SO=		sl
     50 ## Non-shared intermediate object suffix
     51 STATIC_O = o
     52 
     53 ## Compilation rules
     54 %.$(STATIC_O): $(srcdir)/%.c
     55 	$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
     56 %.o: $(srcdir)/%.c
     57 	$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
     58 
     59 %.$(STATIC_O): $(srcdir)/%.cpp
     60 	$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
     61 %.o: $(srcdir)/%.cpp
     62 	$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
     63 
     64 
     65 ## Dependency rules
     66 %.d : $(srcdir)/%.c
     67 	@echo "Generating dependency information for $<"
     68 	@$(SHELL) -ec '$(GEN_DEPS.c) $< \
     69 		| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
     70 		[ -s $@ ] || rm -f $@'
     71 
     72 %.d : $(srcdir)/%.cpp
     73 	@echo "Generating dependency information for $<"
     74 	@$(SHELL) -ec '$(GEN_DEPS.cc) $< \
     75 		| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
     76 		[ -s $@ ] || rm -f $@'
     77 
     78 ## Versioned libraries rules
     79 
     80 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
     81 	$(RM) $@ && ln -s ${<F} $@
     82 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
     83 	$(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
     84 
     85 ## Remove shared library 's'
     86 STATIC_PREFIX_WHEN_USED = 
     87 STATIC_PREFIX = 
     88 
     89 ## End HPUX/gcc specific setup
     90 
     91