make-rules/attpackagemake.mk
changeset 844 55358dcf0cb2
parent 789 5f074ca23733
child 1352 1358a1e1ff4c
equal deleted inserted replaced
843:190d2b5889a8 844:55358dcf0cb2
    45 #
    45 #
    46 
    46 
    47 # Environment variables and arguments passed into the build and install
    47 # Environment variables and arguments passed into the build and install
    48 # environment(s).  These are the initial settings.
    48 # environment(s).  These are the initial settings.
    49 COMPONENT_BUILD_ENV += \
    49 COMPONENT_BUILD_ENV += \
    50 	CC="$(CC)" \
    50     CC_EXPLICIT="$(CC)" \
    51 	CCFLAGS="$(CFLAGS)" \
    51 	PATH=$(shell dirname $(CC)):$(PATH) \
    52 	CCFLAGS.FORCE="$(CXXFLAGS)" \
    52 	CC=$(shell basename $(CC)) 
    53 	CC.RUNPATH="$(CC.RUNPATH)" \
    53 	NPROC="$(NPROC)" 
    54 	CC.LD.RUNPATH="$(CC.LD.RUNPATH)" \
       
    55 	CC.LD.ORIGIN="$(CC.LD.ORIGIN)" \
       
    56 	CC.DLL.ORIGIN="$(CC.DLL.ORIGIN)" \
       
    57 	CCLDFLAGS="$(CXXFLAGS)" \
       
    58 	LDOPTIONS="$(CXXFLAGS)" \
       
    59 	NPROCS="$(NPROCS)" \
       
    60 	LDFLAGS="$(CXXFLAGS)"
       
    61 
    54 
    62 # This is a workaround for the AT&T nmake failing to always use
    55 # This explicitly exports the build type for 32/64 bit distinction 
    63 # the environmental CCFLAGS in sub-compiles
    56 COMPONENT_BUILD_ARGS = \
    64 COMPONENT_BUILD_ARGS= $(COMPONENT_BUILD_ENV)
    57 						HOSTTYPE="$(HOSTTYPE$(BITS))" \
       
    58 						CCFLAGS="$(CFLAGS)" \
       
    59 						LDFLAGS="$(CXXFLAGS)" 
       
    60 
       
    61 # The install and test process needs the same environment as the build
       
    62 COMPONENT_INSTALL_ENV = $(COMPONENT_BUILD_ENV)
       
    63 COMPONENT_TEST_ENV = $(COMPONENT_BUILD_ENV)
       
    64 COMPONENT_INSTALL_ARGS = HOSTTYPE="$(HOSTTYPE$(BITS))"
       
    65 COMPONENT_TEST_ARGS = HOSTTYPE="$(HOSTTYPE$(BITS))"
    65 
    66 
    66 # build the configured source
    67 # build the configured source
    67 $(BUILD_DIR)/%/.built:	$(SOURCE_DIR)/.prep
    68 $(BUILD_DIR)/%/.built:	$(SOURCE_DIR)/.prep
    68 	$(RM) -r $(@D) ; $(MKDIR) $(@D)
    69 	$(RM) -r $(@D) ; $(MKDIR) $(@D)
    69 	$(CLONEY) $(SOURCE_DIR) $(@D)
    70 	$(CLONEY) $(SOURCE_DIR) $(@D)
    75 
    76 
    76 # install the built source into a prototype area
    77 # install the built source into a prototype area
    77 $(BUILD_DIR)/%/.installed:	$(BUILD_DIR)/%/.built
    78 $(BUILD_DIR)/%/.installed:	$(BUILD_DIR)/%/.built
    78 	$(COMPONENT_PRE_INSTALL_ACTION)
    79 	$(COMPONENT_PRE_INSTALL_ACTION)
    79 	$(RM) -r $(PROTO_DIR)/$(MACH$(BITS)); $(MKDIR) $(PROTO_DIR)/$(MACH$(BITS));
    80 	$(RM) -r $(PROTO_DIR)/$(MACH$(BITS)); $(MKDIR) $(PROTO_DIR)/$(MACH$(BITS));
    80 	cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) \
    81 	cd $(@D); $(ENV) $(COMPONENT_INSTALL_ENV) \
    81 		bin/package flat $(COMPONENT_INSTALL_TARGETS) \
    82 		bin/package flat $(COMPONENT_INSTALL_TARGETS) \
       
    83 		$(COMPONENT_INSTALL_ARGS) \
    82 		$(PROTO_DIR)/$(MACH$(BITS)) $(COMPONENT_INSTALL_PACKAGES) 
    84 		$(PROTO_DIR)/$(MACH$(BITS)) $(COMPONENT_INSTALL_PACKAGES) 
    83 	$(COMPONENT_POST_INSTALL_ACTION)
    85 	$(COMPONENT_POST_INSTALL_ACTION)
    84 	$(TOUCH) [email protected]
    86 	$(TOUCH) [email protected]
    85 
    87 
    86 # test the built source
    88 # test the built source
    87 $(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
    89 $(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
    88 	$(COMPONENT_PRE_TEST_ACTION)
    90 	$(COMPONENT_PRE_TEST_ACTION)
    89 	cd $(@D) ; $(ENV) $(COMPONENT_TEST_ENV) bin/package \
    91 	cd $(@D); $(ENV) $(COMPONENT_TEST_ENV) \
    90 		test $(COMPONENT_TEST_TARGETS) 
    92 		bin/package test $(COMPONENT_TEST_TARGETS) \
       
    93 		$(COMPONENT_TEST_ARGS)
    91 	$(COMPONENT_POST_TEST_ACTION)
    94 	$(COMPONENT_POST_TEST_ACTION)
    92 	$(TOUCH) [email protected]
    95 	$(TOUCH) [email protected]
    93 
    96 
    94 clean::
    97 clean::
    95 	$(RM) -r $(BUILD_DIR) $(PROTO_DIR)
    98 	$(RM) -r $(BUILD_DIR) $(PROTO_DIR)