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" targets appropriate to building your component. |
32 # Ex: |
32 # Ex: |
33 # |
33 # |
34 # build: $(COMPONENT_SRC)/build-$(MACH32)/.built \ |
34 # build: $(SOURCE_DIR)/build/$(MACH32)/.built \ |
35 # $(COMPONENT_SRC)/build-$(MACH64)/.built |
35 # $(SOURCE_DIR)/build/$(MACH64)/.built |
36 # |
36 # |
37 # install: $(COMPONENT_SRC)/build-$(MACH32)/.installed \ |
37 # install: $(SOURCE_DIR)/build/$(MACH32)/.installed \ |
38 # $(COMPONENT_SRC)/build-$(MACH64)/.installed |
38 # $(SOURCE_DIR)/build/$(MACH64)/.installed |
39 # |
39 # |
40 # Any additional pre/post configure, build, or install actions can be specified |
40 # 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: |
41 # in your make file by setting them in on of the following macros: |
42 # COMPONENT_PRE_CONFIGURE_ACTION, COMPONENT_POST_CONFIGURE_ACTION |
42 # COMPONENT_PRE_CONFIGURE_ACTION, COMPONENT_POST_CONFIGURE_ACTION |
43 # COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION |
43 # COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION |
71 CONFIGURE_OPTIONS += --bindir=$(CONFIGURE_BINDIR.$(BITS)) |
71 CONFIGURE_OPTIONS += --bindir=$(CONFIGURE_BINDIR.$(BITS)) |
72 CONFIGURE_OPTIONS += --libdir=$(CONFIGURE_LIBDIR.$(BITS)) |
72 CONFIGURE_OPTIONS += --libdir=$(CONFIGURE_LIBDIR.$(BITS)) |
73 |
73 |
74 COMPONENT_INSTALL_ARGS += DESTDIR=$(PROTO_DIR) |
74 COMPONENT_INSTALL_ARGS += DESTDIR=$(PROTO_DIR) |
75 |
75 |
76 $(COMPONENT_SRC)/build-$(MACH32)/.configured: BITS=32 |
76 $(BUILD_DIR)/$(MACH32)/.configured: BITS=32 |
77 $(COMPONENT_SRC)/build-$(MACH64)/.configured: BITS=64 |
77 $(BUILD_DIR)/$(MACH64)/.configured: BITS=64 |
78 |
78 |
79 CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS)) |
79 CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS)) |
80 |
80 |
81 # set the default target for installation of the component |
81 # set the default target for installation of the component |
82 COMPONENT_INSTALL_TARGETS = install |
82 COMPONENT_INSTALL_TARGETS = install |
83 |
83 |
84 # configure the unpacked source for building 32 and 64 bit version |
84 # configure the unpacked source for building 32 and 64 bit version |
85 $(COMPONENT_SRC)/build-%/.configured: $(COMPONENT_SRC)/.prep |
85 $(BUILD_DIR)/%/.configured: $(SOURCE_DIR)/.prep |
86 ($(RM) -rf $(@D) ; $(MKDIR) $(@D)) |
86 ($(RM) -rf $(@D) ; $(MKDIR) $(@D)) |
87 $(COMPONENT_PRE_CONFIGURE_ACTION) |
87 $(COMPONENT_PRE_CONFIGURE_ACTION) |
88 (cd $(@D) ; $(ENV) $(CONFIGURE_ENV) $(CONFIG_SHELL) \ |
88 (cd $(@D) ; $(ENV) $(CONFIGURE_ENV) $(CONFIG_SHELL) \ |
89 ../configure $(CONFIGURE_OPTIONS)) |
89 $(SOURCE_DIR)/configure $(CONFIGURE_OPTIONS)) |
90 $(COMPONENT_POST_CONFIGURE_ACTION) |
90 $(COMPONENT_POST_CONFIGURE_ACTION) |
91 $(TOUCH) $@ |
91 $(TOUCH) $@ |
92 |
92 |
93 # build the configured source |
93 # build the configured source |
94 $(COMPONENT_SRC)/build-%/.built: $(COMPONENT_SRC)/build-%/.configured |
94 $(BUILD_DIR)/%/.built: $(BUILD_DIR)/%/.configured |
95 $(COMPONENT_PRE_BUILD_ACTION) |
95 $(COMPONENT_PRE_BUILD_ACTION) |
96 (cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \ |
96 (cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \ |
97 $(GMAKE) $(COMPONENT_BUILD_TARGETS)) |
97 $(GMAKE) $(COMPONENT_BUILD_TARGETS)) |
98 $(COMPONENT_POST_BUILD_ACTION) |
98 $(COMPONENT_POST_BUILD_ACTION) |
99 $(TOUCH) $@ |
99 $(TOUCH) $@ |
100 |
100 |
101 # install the built source into a prototype area |
101 # install the built source into a prototype area |
102 $(COMPONENT_SRC)/build-%/.installed: $(COMPONENT_SRC)/build-%/.built |
102 $(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built |
103 $(COMPONENT_PRE_INSTALL_ACTION) |
103 $(COMPONENT_PRE_INSTALL_ACTION) |
104 (cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) $(GMAKE) \ |
104 (cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) $(GMAKE) \ |
105 $(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS)) |
105 $(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS)) |
106 $(COMPONENT_POST_INSTALL_ACTION) |
106 $(COMPONENT_POST_INSTALL_ACTION) |
107 $(TOUCH) $@ |
107 $(TOUCH) $@ |
|
108 |
|
109 clean:: |
|
110 $(RM) -r $(BUILD_DIR) $(PROTO_DIR) |