make-rules/shared-macros.mk
changeset 206 a4474882bf60
parent 200 936900594dba
child 207 6bd9160c5c3a
equal deleted inserted replaced
205:777251fa3676 206:a4474882bf60
   186 SPRO_VROOT =	$(SPRO_ROOT)/sunstudio12.1
   186 SPRO_VROOT =	$(SPRO_ROOT)/sunstudio12.1
   187 
   187 
   188 GCC_ROOT =	/usr/sfw
   188 GCC_ROOT =	/usr/sfw
   189 
   189 
   190 CC.studio.32 =	$(SPRO_VROOT)/bin/cc
   190 CC.studio.32 =	$(SPRO_VROOT)/bin/cc
   191 CCC.studio.32 =	$(SPRO_VROOT)/bin/CC
   191 CXX.studio.32 =	$(SPRO_VROOT)/bin/CC
   192 
   192 
   193 CC.studio.64 =	$(SPRO_VROOT)/bin/cc
   193 CC.studio.64 =	$(SPRO_VROOT)/bin/cc
   194 CCC.studio.64 =	$(SPRO_VROOT)/bin/CC
   194 CXX.studio.64 =	$(SPRO_VROOT)/bin/CC
   195 
   195 
   196 CC.gcc.32 =	$(GCC_ROOT)/bin/gcc
   196 CC.gcc.32 =	$(GCC_ROOT)/bin/gcc
   197 CCC.gcc.32 =	$(GCC_ROOT)/bin/g++
   197 CXX.gcc.32 =	$(GCC_ROOT)/bin/g++
   198 
   198 
   199 CC.gcc.64 =	$(GCC_ROOT)/bin/gcc
   199 CC.gcc.64 =	$(GCC_ROOT)/bin/gcc
   200 CCC.gcc.64 =	$(GCC_ROOT)/bin/g++
   200 CXX.gcc.64 =	$(GCC_ROOT)/bin/g++
   201 
   201 
   202 CC =		$(CC.$(COMPILER).$(BITS))
   202 CC =		$(CC.$(COMPILER).$(BITS))
   203 CCC =		$(CCC.$(COMPILER).$(BITS))
   203 CXX =		$(CXX.$(COMPILER).$(BITS))
   204 
   204 
   205 lint.32 =	$(SPRO_VROOT)/bin/lint -m32
   205 lint.32 =	$(SPRO_VROOT)/bin/lint -m32
   206 lint.64 =	$(SPRO_VROOT)/bin/lint -m64
   206 lint.64 =	$(SPRO_VROOT)/bin/lint -m64
   207 
   207 
   208 LINT =		$(lint.$(BITS))
   208 LINT =		$(lint.$(BITS))
   256 CHMOD =		/usr/bin/chmod
   256 CHMOD =		/usr/bin/chmod
   257 
   257 
   258 INS.dir=        $(INSTALL) -d $@
   258 INS.dir=        $(INSTALL) -d $@
   259 INS.file=       $(INSTALL) -m 444 $< $(@D)
   259 INS.file=       $(INSTALL) -m 444 $< $(@D)
   260 
   260 
       
   261 PKG_CONFIG_PATH.32 = /usr/lib/pkgconfig
       
   262 PKG_CONFIG_PATH.64 = /usr/lib/$(MACH64)/pkgconfig
       
   263 PKG_CONFIG_PATH = PKG_CONFIG_PATH.$(BITS)
       
   264 
       
   265 
   261 #
   266 #
   262 # C preprocessor flag sets to ease feature selection.  Add the required
   267 # C preprocessor flag sets to ease feature selection.  Add the required
   263 # feature to your Makefile with CPPFLAGS += $(FEATURE_MACRO) and add to
   268 # feature to your Makefile with CPPFLAGS += $(FEATURE_MACRO) and add to
   264 # the component build with CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)" or
   269 # the component build with CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)" or
   265 # similiar.
   270 # similiar.
   334 studio_cplusplus_C99MODE = 
   339 studio_cplusplus_C99MODE = 
   335 
   340 
   336 # Allow zero-sized struct/union declarations and void functions with return
   341 # Allow zero-sized struct/union declarations and void functions with return
   337 # statements.
   342 # statements.
   338 studio_FEATURES_EXTENSIONS =	-features=extensions
   343 studio_FEATURES_EXTENSIONS =	-features=extensions
   339 
       
   340 # CC requires -norunpath to avoid linking in its RUNPATH to C++ applications.
       
   341 studio_NORUNPATH =	 -norunpath
       
   342 
       
   343 # To link in standard mode (the default mode) without any C++ libraries
       
   344 # (except libCrun), use studio_LIBRARY_NONE in your compnent Makefile.
       
   345 studio_LIBRARY_NONE =	 -library=%none
       
   346 
   344 
   347 # Control the Studio optimization level.
   345 # Control the Studio optimization level.
   348 studio_OPT.sparc.32 =	-xO4
   346 studio_OPT.sparc.32 =	-xO4
   349 studio_OPT.sparc.64 =	-xO4
   347 studio_OPT.sparc.64 =	-xO4
   350 studio_OPT.i386.32 =	-xO4
   348 studio_OPT.i386.32 =	-xO4
   427 
   425 
   428 # Add compiler specific 'default' features
   426 # Add compiler specific 'default' features
   429 CFLAGS +=	$(CFLAGS.$(COMPILER))
   427 CFLAGS +=	$(CFLAGS.$(COMPILER))
   430 
   428 
   431 
   429 
       
   430 # C++ compiler usually wants all of the C compiler options too
       
   431 CXXFLAGS +=	$(CFLAGS)
       
   432 
       
   433 # Studio C++ requires -norunpath to avoid adding its location into the RUNPATH
       
   434 # to C++ applications.
       
   435 studio_NORUNPATH =	 -norunpath
       
   436 
       
   437 # To link in standard mode (the default mode) without any C++ libraries
       
   438 # (except libCrun), use studio_LIBRARY_NONE in your component Makefile.
       
   439 studio_LIBRARY_NONE =	 -library=%none
       
   440 
       
   441 # Don't link C++ with any C++ Runtime or Standard C++ library
       
   442 studio_CXXLIB_NONE =	-xnolib
       
   443 
       
   444 # Link C++ with the Studio C++ Runtime and Standard C++ library.  This is the
       
   445 # default for "standard" mode.
       
   446 studio_CXXLIB_CSTD =	-library=Cstd,Crun
       
   447 
       
   448 # link C++ with the Studio  C++ Runtime and Apache Standard C++ library
       
   449 studio_CXXLIB_APACHE =	-library=stdcxx4,Crun
       
   450 
       
   451 # Add the C++ ABI compatibility flags for older ABI compatibility.  The default
       
   452 # is "standard mode" (-compat=5)
       
   453 studio_COMPAT_VERSION_4 =	-compat=4
       
   454 
       
   455 # Tell the compiler that we don't want the studio runpath added to the
       
   456 # linker flags.  We never want the Studio location added to the RUNPATH.
       
   457 CXXFLAGS +=	$($(COMPILER)_NORUNPATH)
       
   458 
   432 #
   459 #
   433 # Solaris linker flag sets to ease feature selection.  Add the required
   460 # Solaris linker flag sets to ease feature selection.  Add the required
   434 # feature to your Makefile with LDFLAGS += $(FEATURE_MACRO) and add to the
   461 # feature to your Makefile with LDFLAGS += $(FEATURE_MACRO) and add to the
   435 # component build with CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)" or similiar.
   462 # component build with CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)" or similiar.
   436 #
   463 #
       
   464 
       
   465 # set the bittedness that we want to link
       
   466 LD_BITS =	-$(BITS)
   437 
   467 
   438 # Reduce the symbol table size, effectively conflicting with -g.  We should
   468 # Reduce the symbol table size, effectively conflicting with -g.  We should
   439 # get linker guidance here.
   469 # get linker guidance here.
   440 LD_Z_REDLOCSYM =	-z redlocsym
   470 LD_Z_REDLOCSYM =	-z redlocsym
   441 
   471 
   485 # Default linker options that everyone should get.  Do not add additional
   515 # Default linker options that everyone should get.  Do not add additional
   486 # libraries to this macro, as it will apply to everything linked during the
   516 # libraries to this macro, as it will apply to everything linked during the
   487 # component build.
   517 # component build.
   488 LD_OPTIONS +=	$(LD_MAP_NOEXSTK.$(MACH)) $(LD_MAP_NOEXDATA.$(MACH)) \
   518 LD_OPTIONS +=	$(LD_MAP_NOEXSTK.$(MACH)) $(LD_MAP_NOEXDATA.$(MACH)) \
   489 		$(LD_MAP_PAGEALIGN) $(LD_B_DIRECT) $(LD_Z_IGNORE)
   519 		$(LD_MAP_PAGEALIGN) $(LD_B_DIRECT) $(LD_Z_IGNORE)
       
   520 
       
   521 # We want to add bittedness to the default linker flags
       
   522 LDFLAGS += $(LD_BITS)
   490 
   523 
   491 # Environment variables and arguments passed into the build and install
   524 # Environment variables and arguments passed into the build and install
   492 # environment(s).  These are the initial settings.
   525 # environment(s).  These are the initial settings.
   493 COMPONENT_BUILD_ENV= \
   526 COMPONENT_BUILD_ENV= \
   494     LD_OPTIONS="$(LD_OPTIONS)"
   527     LD_OPTIONS="$(LD_OPTIONS)"
   499 COMPONENT_BUILD_ENV += $(COMPONENT_BUILD_ENV.$(BITS))
   532 COMPONENT_BUILD_ENV += $(COMPONENT_BUILD_ENV.$(BITS))
   500 COMPONENT_BUILD_ARGS += $(COMPONENT_BUILD_ARGS.$(BITS))
   533 COMPONENT_BUILD_ARGS += $(COMPONENT_BUILD_ARGS.$(BITS))
   501 COMPONENT_INSTALL_ENV += $(COMPONENT_INSTALL_ENV.$(BITS))
   534 COMPONENT_INSTALL_ENV += $(COMPONENT_INSTALL_ENV.$(BITS))
   502 COMPONENT_INSTALL_ARGS += $(COMPONENT_INSTALL_ARGS.$(BITS))
   535 COMPONENT_INSTALL_ARGS += $(COMPONENT_INSTALL_ARGS.$(BITS))
   503 
   536 
       
   537 # declare these phony so that we avoid filesystem conflicts.
       
   538 .PHONY:	download prep build install publish test clean clobber
       
   539 
   504 # If there are no tests to execute
   540 # If there are no tests to execute
   505 NO_TESTS =	test-nothing
   541 NO_TESTS =	test-nothing
   506 test-nothing:
   542 test-nothing:
   507 	@echo "There are no tests available at this time."
   543 	@echo "There are no tests available at this time."