From e7b38c71ce55720f7709f0049f5bfc71ca0615ec Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Thu, 19 Mar 2009 11:06:47 +0000 Subject: package: add STAMP_DIR and use for host builds Move stamp (dependency) files outside the (version specific) source directories, so other packages can hardcode dependencies on them instead of having to use _VERSION variables. This is important as the variables in the make rules are evaluated when the rules is seen, which might be before the dependent makefile is parsed (and hence _VERSION variable is known, screwing up stuff. The downside of this is that the package isn't automatically rebuilt when the version changes (E.G. by a svn update) and you now also have to remove the stamp files next to $(BUILD_DIR)/-* to force a rebuild. --- Makefile | 10 +++++----- package/Makefile.in | 4 ++-- package/atk/atk.mk | 30 +++++++++++++++--------------- package/cairo/cairo.mk | 30 +++++++++++++++--------------- package/dbus-glib/dbus-glib.mk | 33 +++++++++++++++++---------------- package/dbus/dbus.mk | 38 ++++++++++++++++++-------------------- package/expat/expat.mk | 34 +++++++++++++++++----------------- package/fontconfig/fontconfig.mk | 30 +++++++++++++++--------------- package/freetype/freetype.mk | 30 +++++++++++++++--------------- package/libglib2/libglib2.mk | 33 +++++++++++++++++---------------- package/libgtk2/libgtk2.mk | 30 +++++++++++++++--------------- package/pango/pango.mk | 31 ++++++++++++++++--------------- package/pixman/pixman.mk | 30 +++++++++++++++--------------- package/pkgconfig/pkgconfig.mk | 32 ++++++++++++++++++-------------- project/Makefile.in | 3 +++ 15 files changed, 203 insertions(+), 195 deletions(-) diff --git a/Makefile b/Makefile index fa44dc4e9..b8676bf8a 100644 --- a/Makefile +++ b/Makefile @@ -283,7 +283,7 @@ $(BR2_DEPENDS_DIR): .config dirs: $(DL_DIR) $(TOOL_BUILD_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ $(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(PROJECT_BUILD_DIR) \ - $(PROJECT_BUILD_DIR)/autotools-stamps + $(PROJECT_BUILD_DIR)/autotools-stamps $(STAMP_DIR) $(BASE_TARGETS): dirs @@ -295,7 +295,7 @@ world: dependencies dirs target-host-info $(BASE_TARGETS) $(TARGETS_ALL) $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \ $(DL_DIR) $(TOOL_BUILD_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ $(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(PROJECT_BUILD_DIR) \ - $(PROJECT_BUILD_DIR)/autotools-stamps + $(PROJECT_BUILD_DIR)/autotools-stamps $(STAMP_DIR) ############################################################# # @@ -304,7 +304,7 @@ world: dependencies dirs target-host-info $(BASE_TARGETS) $(TARGETS_ALL) # ############################################################# $(DL_DIR) $(TOOL_BUILD_DIR) $(BUILD_DIR) $(HOST_DIR) $(PROJECT_BUILD_DIR) \ - $(PROJECT_BUILD_DIR)/autotools-stamps $(BINARIES_DIR): + $(PROJECT_BUILD_DIR)/autotools-stamps $(BINARIES_DIR) $(STAMP_DIR): @mkdir -p $@ $(STAGING_DIR): @@ -365,10 +365,10 @@ external-deps: # ############################################################# clean: $(TARGETS_CLEAN) - rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE) $(PROJECT_BUILD_DIR)/.root $(PROJECT_BUILD_DIR)/autotools-stamps + rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE) $(PROJECT_BUILD_DIR)/.root $(PROJECT_BUILD_DIR)/autotools-stamps $(STAMP_DIR) dirclean: $(TARGETS_DIRCLEAN) - rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE) $(PROJECT_BUILD_DIR)/.root $(PROJECT_BUILD_DIR)/autotools-stamps + rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE) $(PROJECT_BUILD_DIR)/.root $(PROJECT_BUILD_DIR)/autotools-stamps $(STAMP_DIR) distclean: ifeq ($(DL_DIR),$(BASE_DIR)/dl) diff --git a/package/Makefile.in b/package/Makefile.in index 38f028742..5a44e3856 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -252,7 +252,7 @@ TARGET_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \ DEFAULT_LINKER="$(TARGET_LD)" \ PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \ PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \ - PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig:$(PKG_CONFIG_PATH)" \ + PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig$(PKG_CONFIG_PATH)" \ STAGING_DIR="$(STAGING_DIR)" TARGET_CONFIGURE_ENV=\ @@ -297,7 +297,7 @@ HOST_CONFIGURE_OPTS=PATH=$(HOST_PATH) \ ORIGINAL_NM_FOR_TARGET="$(TARGET_NM)" \ ORIGINAL_OBJDUMP_FOR_TARGET="$(TARGET_OBJDUMP)" \ PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \ - PKG_CONFIG_PATH="$(HOST_DIR)/usr/lib/pkgconfig:$(PKG_CONFIG_PATH)" + PKG_CONFIG_PATH="$(HOST_DIR)/usr/lib/pkgconfig$(PKG_CONFIG_PATH)" HOST_MAKE_ENV=PATH=$(HOST_PATH) diff --git a/package/atk/atk.mk b/package/atk/atk.mk index c9e373e28..0f30ae171 100644 --- a/package/atk/atk.mk +++ b/package/atk/atk.mk @@ -59,41 +59,41 @@ $(eval $(call AUTOTARGETS,package,atk)) # atk for the host ATK_HOST_DIR:=$(BUILD_DIR)/atk-$(ATK_VERSION)-host -ATK_HOST_BINARY:=$(HOST_DIR)/usr/lib/libatk-1.0.a -$(ATK_HOST_DIR)/.unpacked: $(DL_DIR)/$(ATK_SOURCE) - mkdir -p $(@D) +$(STAMP_DIR)/host_atk_unpacked: $(DL_DIR)/$(ATK_SOURCE) + mkdir -p $(ATK_HOST_DIR) $(INFLATE$(suffix $(ATK_SOURCE))) $< | \ - $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) - + $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(ATK_HOST_DIR) $(TAR_OPTIONS) - touch $@ -$(ATK_HOST_DIR)/.configured: $(ATK_HOST_DIR)/.unpacked $(LIBGLIB2_HOST_BINARY) $(PKG_CONFIG_HOST_BINARY) - (cd $(@D); rm -rf config.cache; \ +$(STAMP_DIR)/host_atk_configured: $(STAMP_DIR)/host_atk_unpacked $(STAMP_DIR)/host_libglib2_installed $(STAMP_DIR)/host_pkgconfig_installed + (cd $(ATK_HOST_DIR); rm -rf config.cache; \ $(HOST_CONFIGURE_OPTS) \ CFLAGS="$(HOST_CFLAGS)" \ LDFLAGS="$(HOST_LDFLAGS)" \ - $(@D)/configure \ - --prefix=$(HOST_DIR)/usr \ - --sysconfdir=$(HOST_DIR)/etc \ + ./configure \ + --prefix="$(HOST_DIR)/usr" \ + --sysconfdir="$(HOST_DIR)/etc" \ --enable-shared \ --disable-static \ --disable-glibtest \ ) touch $@ -$(ATK_HOST_DIR)/.compiled: $(ATK_HOST_DIR)/.configured - $(HOST_MAKE_ENV) $(MAKE) -C $(@D) +$(STAMP_DIR)/host_atk_compiled: $(STAMP_DIR)/host_atk_configured + $(HOST_MAKE_ENV) $(MAKE) -C $(ATK_HOST_DIR) touch $@ -$(ATK_HOST_BINARY): $(ATK_HOST_DIR)/.compiled - $(HOST_MAKE_ENV) $(MAKE) -C $( $@ +$(STAMP_DIR)/host_dbus_installed: $(STAMP_DIR)/host_dbus_compiled + $(MAKE) -C $(DBUS_HOST_DIR) install + $(HOST_DIR)/usr/bin/dbus-daemon --introspect > $(DBUS_HOST_INTROSPECT) + touch $@ -host-dbus: $(DBUS_HOST_INTROSPECT) +host-dbus: $(STAMP_DIR)/host_dbus_installed host-dbus-source: dbus-source host-dbus-clean: - rm -f $(addprefix $(DBUS_HOST_DIR)/,.unpacked .configured .compiled) + rm -f $(addprefix $(STAMP_DIR)/host_dbus_,unpacked configured compiled installed) rm -f $(DBUS_HOST_INTROSPECT) - $(MAKE) -C $(DBUS_HOST_DIR) uninstall - $(MAKE) -C $(DBUS_HOST_DIR) clean + -$(MAKE) -C $(DBUS_HOST_DIR) uninstall + -$(MAKE) -C $(DBUS_HOST_DIR) clean host-dbus-dirclean: rm -rf $(DBUS_HOST_DIR) diff --git a/package/expat/expat.mk b/package/expat/expat.mk index 4028a8f08..95383e610 100644 --- a/package/expat/expat.mk +++ b/package/expat/expat.mk @@ -26,40 +26,40 @@ $(EXPAT_HOOK_POST_INSTALL): $(EXPAT_TARGET_INSTALL_TARGET) # expat for the host EXPAT_HOST_DIR:=$(BUILD_DIR)/expat-$(EXPAT_VERSION)-host -EXPAT_HOST_BINARY:=$(HOST_DIR)/usr/lib/libexpat.a -$(EXPAT_HOST_DIR)/.unpacked: $(DL_DIR)/$(EXPAT_SOURCE) - mkdir -p $(@D) +$(STAMP_DIR)/host_expat_unpacked: $(DL_DIR)/$(EXPAT_SOURCE) + mkdir -p $(EXPAT_HOST_DIR) $(INFLATE$(suffix $(EXPAT_SOURCE))) $< | \ - $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) - + $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(EXPAT_HOST_DIR) $(TAR_OPTIONS) - touch $@ -$(EXPAT_HOST_DIR)/.configured: $(EXPAT_HOST_DIR)/.unpacked - (cd $(@D); rm -rf config.cache; \ +$(STAMP_DIR)/host_expat_configured: $(STAMP_DIR)/host_expat_unpacked + (cd $(EXPAT_HOST_DIR); rm -rf config.cache; \ $(HOST_CONFIGURE_OPTS) \ CFLAGS="$(HOST_CFLAGS)" \ LDFLAGS="$(HOST_LDFLAGS)" \ - $(@D)/configure \ - --prefix=$(HOST_DIR)/usr \ - --sysconfdir=$(HOST_DIR)/etc \ + ./configure \ + --prefix="$(HOST_DIR)/usr" \ + --sysconfdir="$(HOST_DIR)/etc" \ ) touch $@ -$(EXPAT_HOST_DIR)/.compiled: $(EXPAT_HOST_DIR)/.configured - $(HOST_MAKE_ENV) $(MAKE) -C $(@D) +$(STAMP_DIR)/host_expat_compiled: $(STAMP_DIR)/host_expat_configured + $(HOST_MAKE_ENV) $(MAKE) -C $(EXPAT_HOST_DIR) touch $@ -$(EXPAT_HOST_BINARY): $(EXPAT_HOST_DIR)/.compiled - $(MAKE) -C $(