1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-27 16:43:09 +02:00

tools: clean up Makefiles / make ccache work

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29754 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
blogic 2012-01-15 11:43:13 +00:00
parent 6ca687282b
commit 9943867fae
15 changed files with 31 additions and 83 deletions

View File

@ -45,6 +45,7 @@ define Host/Prepare
endef endef
HOST_CONFIGURE_VARS = \ HOST_CONFIGURE_VARS = \
CC="$(HOSTCC)" \
CFLAGS="$(HOST_CFLAGS)" \ CFLAGS="$(HOST_CFLAGS)" \
CPPFLAGS="$(HOST_CFLAGS)" \ CPPFLAGS="$(HOST_CFLAGS)" \
LDFLAGS="$(HOST_LDFLAGS)" \ LDFLAGS="$(HOST_LDFLAGS)" \

View File

@ -170,6 +170,7 @@ PKG_CONFIG:=$(STAGING_DIR_HOST)/bin/pkg-config
export PKG_CONFIG export PKG_CONFIG
HOSTCC:=gcc HOSTCC:=gcc
HOSTCC_NOCACHE:=$(HOSTCC)
HOST_CFLAGS:=-O2 -I$(STAGING_DIR_HOST)/include HOST_CFLAGS:=-O2 -I$(STAGING_DIR_HOST)/include
HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib
@ -188,6 +189,7 @@ INSTALL_CONF:=install -m0600
ifneq ($(CONFIG_CCACHE),) ifneq ($(CONFIG_CCACHE),)
TARGET_CC:= ccache $(TARGET_CC) TARGET_CC:= ccache $(TARGET_CC)
TARGET_CXX:= ccache $(TARGET_CXX) TARGET_CXX:= ccache $(TARGET_CXX)
HOSTCC:= ccache $(HOSTCC)
endif endif
TARGET_CONFIGURE_OPTS = \ TARGET_CONFIGURE_OPTS = \

View File

@ -21,10 +21,9 @@ tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
tools-$(CONFIG_powerpc) += upx tools-$(CONFIG_powerpc) += upx
tools-$(CONFIG_TARGET_x86) += qemu tools-$(CONFIG_TARGET_x86) += qemu
ifneq ($(CONFIG_TARGET_ar71xx),) ifneq ($(CONFIG_TARGET_ar71xx),)
tools-y += lzma-old squashfs tools-y += lzma-old squashfs
endif endif
tools-y += lzma squashfs4 tools-y += lzma squashfs4
tools-$(CONFIG_CCACHE) += ccache
ifdef CONFIG_GCC_USE_GRAPHITE ifdef CONFIG_GCC_USE_GRAPHITE
ifeq ($(CONFIG_GCC_USE_SYSTEM_PPL_CLOOG),) ifeq ($(CONFIG_GCC_USE_SYSTEM_PPL_CLOOG),)
@ -59,6 +58,11 @@ $(curdir)/missing-macros/compile := $(curdir)/automake/install
$(curdir)/e2fsprogs/compile := $(curdir)/automake/install $(curdir)/e2fsprogs/compile := $(curdir)/automake/install
$(curdir)/libelf/compile := $(curdir)/automake/install $(curdir)/libelf/compile := $(curdir)/automake/install
ifneq ($(CONFIG_CCACHE),)
$(foreach tool, $(tools-y), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/install))
tools-y += ccache
endif
$(curdir)/builddirs := $(tools-y) $(tools-dep) $(tools-) $(curdir)/builddirs := $(tools-y) $(tools-dep) $(tools-)
$(curdir)/builddirs-default := $(tools-y) $(curdir)/builddirs-default := $(tools-y)

View File

@ -15,15 +15,7 @@ PKG_MD5SUM:=c2972c4d9b3e29c03d5f2af86249876f
include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/host-build.mk
define Host/Configure HOST_CONFIGURE_ARGS += --datarootdir=$(STAGING_DIR_HOST)/share
$(call Host/Configure/Default,\
--datarootdir=$(STAGING_DIR_HOST)/share \
)
endef
define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR)
endef
define Host/Install define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) install $(MAKE) -C $(HOST_BUILD_DIR) install

View File

@ -16,14 +16,6 @@ PKG_CAT:=bzcat
include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/host-build.mk
define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR)
endef
define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) install
endef
define Host/Clean define Host/Clean
-$(MAKE) -C $(HOST_BUILD_DIR) uninstall -$(MAKE) -C $(HOST_BUILD_DIR) uninstall
$(call Host/Clean/Default) $(call Host/Clean/Default)

View File

@ -19,11 +19,7 @@ include $(INCLUDE_DIR)/host-build.mk
ifneq ($(strip $(shell which ccache >/dev/null && echo found)),found) ifneq ($(strip $(shell which ccache >/dev/null && echo found)),found)
define Host/Compile define Host/Compile
$(MAKE) CC="$(HOSTCC)" -C $(HOST_BUILD_DIR) $(MAKE) CC="$(HOSTCC_NOCACHE)" -C $(HOST_BUILD_DIR)
endef
define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) install
endef endef
define Host/Clean define Host/Clean
@ -41,6 +37,8 @@ else
endef endef
define Host/Clean define Host/Clean
endef endef
define Download
endef
endif endif
$(eval $(call HostBuild)) $(eval $(call HostBuild))

View File

@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/kernel.mk
define cc define cc
$(CC) $(HOST_CFLAGS) -include endian.h -o $(HOST_BUILD_DIR)/bin/$(firstword $(1)) $(foreach src,$(1),src/$(src).c) $(2) $(HOSTCC) $(HOST_CFLAGS) -include endian.h -o $(HOST_BUILD_DIR)/bin/$(firstword $(1)) $(foreach src,$(1),src/$(src).c) $(2)
endef endef
define Host/Compile define Host/Compile

View File

@ -16,14 +16,6 @@ PKG_CAT:=bzcat
include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/host-build.mk
define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR)
endef
define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) install
endef
define Host/Clean define Host/Clean
-$(MAKE) -C $(HOST_BUILD_DIR) uninstall -$(MAKE) -C $(HOST_BUILD_DIR) uninstall
$(call Host/Clean/Default) $(call Host/Clean/Default)

View File

@ -16,26 +16,22 @@ PKG_MD5SUM:=b7b6361bcce2cedff1ae437fadafe53b
include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/host-build.mk
define Host/Configure HOST_CONFIGURE_ARGS = \
( cd $(HOST_BUILD_DIR); \ --target=$(GNU_HOST_NAME) \
./configure \ --host=$(GNU_HOST_NAME) \
--target=$(GNU_HOST_NAME) \ --build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \ --program-prefix="" \
--build=$(GNU_HOST_NAME) \ --program-suffix="" \
--program-prefix="" \ --prefix=/usr \
--program-suffix="" \ --exec-prefix=/usr \
--prefix=/usr \ --bindir=/usr/bin \
--exec-prefix=/usr \ --sbindir=/usr/sbin \
--bindir=/usr/bin \ --libexecdir=/usr/lib \
--sbindir=/usr/sbin \ --sysconfdir=/etc \
--libexecdir=/usr/lib \ --datadir=/usr/share \
--sysconfdir=/etc \ --localstatedir=/var \
--datadir=/usr/share \ --mandir=/usr/man \
--localstatedir=/var \ --infodir=/usr/info \
--mandir=/usr/man \
--infodir=/usr/info \
)
endef
define Host/Compile define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR) \ $(MAKE) -C $(HOST_BUILD_DIR) \

View File

@ -23,13 +23,4 @@ HOST_CONFIGURE_ARGS += \
--enable-cxx \ --enable-cxx \
--enable-mpbsd --enable-mpbsd
define Host/Configure
(cd $(HOST_BUILD_DIR)/$(3); \
$(HOST_CONFIGURE_CMD) \
$(HOST_CONFIGURE_VARS) \
$(HOST_CONFIGURE_ARGS); \
)
endef
$(eval $(call HostBuild)) $(eval $(call HostBuild))

View File

@ -18,10 +18,6 @@ include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_VARS += \ HOST_CONFIGURE_VARS += \
lt_cv_sys_dlsearch_path="" lt_cv_sys_dlsearch_path=""
define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR)
endef
define Host/Install define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) install $(MAKE) -C $(HOST_BUILD_DIR) install
$(SED) 's,\(hardcode_into_libs\)=yes,\1=no,g' $(STAGING_DIR_HOST)/bin/libtool $(SED) 's,\(hardcode_into_libs\)=yes,\1=no,g' $(STAGING_DIR_HOST)/bin/libtool

View File

@ -16,14 +16,6 @@ PKG_CAT:=zcat
include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/host-build.mk
define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR)
endef
define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) install
endef
define Host/Clean define Host/Clean
-$(MAKE) -C $(HOST_BUILD_DIR) uninstall -$(MAKE) -C $(HOST_BUILD_DIR) uninstall
$(call Host/Clean/Default) $(call Host/Clean/Default)

View File

@ -21,10 +21,6 @@ endef
define Host/Configure define Host/Configure
endef endef
define Host/Compile
$(MAKE) CC="$(HOSTCC)" -C $(HOST_BUILD_DIR)
endef
define Host/Install define Host/Install
$(CP) $(HOST_BUILD_DIR)/padjffs2 $(STAGING_DIR_HOST)/bin/ $(CP) $(HOST_BUILD_DIR)/padjffs2 $(STAGING_DIR_HOST)/bin/
endef endef

View File

@ -15,10 +15,6 @@ PKG_MD5SUM:=a3270bab3f4b69b7dc6dbdacbcae9745
include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/host-build.mk
define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR)
endef
define Host/Install define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) \ $(MAKE) -C $(HOST_BUILD_DIR) \
install install

View File

@ -11,7 +11,7 @@ PKG_NAME:=sstrip
include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/host-build.mk
define Host/Compile define Host/Compile
$(CC) $(HOST_CFLAGS) -I./include -include endian.h -o $(HOST_BUILD_DIR)/sstrip src/sstrip.c $(HOSTCC) $(HOST_CFLAGS) -I./include -include endian.h -o $(HOST_BUILD_DIR)/sstrip src/sstrip.c
endef endef
define Host/Install define Host/Install