make-rules/configure.mk
changeset 166 db8a55996482
parent 156 c2445b73a8b2
child 168 5884bc1edfdf
equal deleted inserted replaced
165:111c46cade93 166:db8a55996482
    26 # GNU auto* tools to configure their build for the system they are on.  This
    26 # GNU auto* tools to configure their build for the system they are on.  This
    27 # uses GNU Make to build the components to take advantage of the viewpath
    27 # uses GNU Make to build the components to take advantage of the viewpath
    28 # support and build multiple version (32/64 bit) from a shared source.
    28 # support and build multiple version (32/64 bit) from a shared source.
    29 #
    29 #
    30 # To use these rules, include ../make-rules/configure.mk in your Makefile
    30 # To use these rules, include ../make-rules/configure.mk in your Makefile
    31 # and define "build", "install" targets appropriate to building your component.
    31 # and define "build", "install", and "test" targets appropriate to building
       
    32 # your component.
    32 # Ex:
    33 # Ex:
    33 #
    34 #
    34 # 	build:		$(SOURCE_DIR)/build/$(MACH32)/.built \
    35 # 	build:		$(SOURCE_DIR)/build/$(MACH32)/.built \
    35 #	 		$(SOURCE_DIR)/build/$(MACH64)/.built
    36 #	 		$(SOURCE_DIR)/build/$(MACH64)/.built
    36 # 
    37 #
    37 #	install:	$(SOURCE_DIR)/build/$(MACH32)/.installed \
    38 #	install:	$(SOURCE_DIR)/build/$(MACH32)/.installed \
    38 #	 		$(SOURCE_DIR)/build/$(MACH64)/.installed
    39 #	 		$(SOURCE_DIR)/build/$(MACH64)/.installed
       
    40 #
       
    41 #	test:		$(SOURCE_DIR)/build/$(MACH32)/.tested \
       
    42 #	 		$(SOURCE_DIR)/build/$(MACH64)/.tested
    39 #
    43 #
    40 # Any additional pre/post configure, build, or install actions can be specified
    44 # Any additional pre/post configure, build, or install actions can be specified
    41 # in your make file by setting them in on of the following macros:
    45 # in your make file by setting them in on of the following macros:
    42 #	COMPONENT_PRE_CONFIGURE_ACTION, COMPONENT_POST_CONFIGURE_ACTION
    46 #	COMPONENT_PRE_CONFIGURE_ACTION, COMPONENT_POST_CONFIGURE_ACTION
    43 #	COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION
    47 #	COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION
    44 #	COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
    48 #	COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
       
    49 #	COMPONENT_PRE_TEST_ACTION, COMPONENT_POST_TEST_ACTION
    45 #
    50 #
    46 # If component specific make targets need to be used for build or install, they
    51 # If component specific make targets need to be used for build or install, they
    47 # can be specified in
    52 # can be specified in
    48 
       
    49 #	COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
    53 #	COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
       
    54 #	COMPONENT_TEST_TARGETS
    50 #
    55 #
    51 
    56 
    52 CONFIGURE_PREFIX =	/usr
    57 CONFIGURE_PREFIX =	/usr
    53 
    58 
    54 CONFIGURE_BINDIR.32 =	$(CONFIGURE_PREFIX)/bin
    59 CONFIGURE_BINDIR.32 =	$(CONFIGURE_PREFIX)/bin
    80 $(BUILD_DIR)/$(MACH64)/.configured:	BITS=64
    85 $(BUILD_DIR)/$(MACH64)/.configured:	BITS=64
    81 $(BUILD_DIR)/$(MACH32)/.built:		BITS=32
    86 $(BUILD_DIR)/$(MACH32)/.built:		BITS=32
    82 $(BUILD_DIR)/$(MACH64)/.built:		BITS=64
    87 $(BUILD_DIR)/$(MACH64)/.built:		BITS=64
    83 $(BUILD_DIR)/$(MACH32)/.installed:	BITS=32
    88 $(BUILD_DIR)/$(MACH32)/.installed:	BITS=32
    84 $(BUILD_DIR)/$(MACH64)/.installed:	BITS=64
    89 $(BUILD_DIR)/$(MACH64)/.installed:	BITS=64
       
    90 $(BUILD_DIR)/$(MACH32)/.tested:		BITS=32
       
    91 $(BUILD_DIR)/$(MACH64)/.tested:		BITS=64
    85 
    92 
    86 CONFIGURE_ENV += $(CONFIGURE_ENV.$(BITS))
    93 CONFIGURE_ENV += $(CONFIGURE_ENV.$(BITS))
    87 CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
    94 CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
    88 
    95 
    89 # set the default target for installation of the component
    96 # set the default target for installation of the component
    90 COMPONENT_INSTALL_TARGETS =	install
    97 COMPONENT_INSTALL_TARGETS =	install
       
    98 
       
    99 # set the default target for test of the component
       
   100 COMPONENT_TEST_TARGETS =	check
    91 
   101 
    92 # configure the unpacked source for building 32 and 64 bit version
   102 # configure the unpacked source for building 32 and 64 bit version
    93 CONFIGURE_SCRIPT =	$(SOURCE_DIR)/configure
   103 CONFIGURE_SCRIPT =	$(SOURCE_DIR)/configure
    94 $(BUILD_DIR)/%/.configured:	$(SOURCE_DIR)/.prep
   104 $(BUILD_DIR)/%/.configured:	$(SOURCE_DIR)/.prep
    95 	($(RM) -rf $(@D) ; $(MKDIR) $(@D))
   105 	($(RM) -rf $(@D) ; $(MKDIR) $(@D))
   113 	(cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) $(GMAKE) \
   123 	(cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) $(GMAKE) \
   114 			$(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS))
   124 			$(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS))
   115 	$(COMPONENT_POST_INSTALL_ACTION)
   125 	$(COMPONENT_POST_INSTALL_ACTION)
   116 	$(TOUCH) $@
   126 	$(TOUCH) $@
   117 
   127 
       
   128 # test the built source
       
   129 $(BUILD_DIR)/%/.tested:	$(BUILD_DIR)/%/.built
       
   130 	$(COMPONENT_PRE_TEST_ACTION)
       
   131 	(cd $(@D) ; $(ENV) $(COMPONENT_TEST_ENV) $(GMAKE) \
       
   132 			$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
       
   133 	$(COMPONENT_POST_TEST_ACTION)
       
   134 	$(TOUCH) $@
       
   135 
   118 clean::
   136 clean::
   119 	$(RM) -r $(BUILD_DIR) $(PROTO_DIR)
   137 	$(RM) -r $(BUILD_DIR) $(PROTO_DIR)