Skip to content

Commit

Permalink
build system: don't run xcompile or git for %clean/%config targets
Browse files Browse the repository at this point in the history
It takes a long time for no gain: We don't need to update the
submodules, we don't need to fetch the revision, we don't need to find
the compilers, when all we want to do is to manipulate the .config file
or clean the build directory.

Change-Id: Ie1bd446a0d49a81e3cccdb56fe2c43ffd83b6c98
Signed-off-by: Patrick Georgi <[email protected]>
Reviewed-on: https://review.coreboot.org/18182
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <[email protected]>
Reviewed-by: Martin Roth <[email protected]>
  • Loading branch information
pgeorgi committed Jan 24, 2017
1 parent 5e949fa commit 0ffef88
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 24 deletions.
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@
## SUCH DAMAGE.
##

# in addition to the dependency below, create the file if it doesn't exist
# to silence stupid warnings about a file that would be generated anyway.
$(if $(wildcard .xcompile),,$(eval $(shell util/xcompile/xcompile $(XGCCPATH) > .xcompile || rm -f .xcompile)))

.xcompile: util/xcompile/xcompile
rm -f $@
$< $(XGCCPATH) > $@.tmp
\mv -f $@.tmp $@ 2> /dev/null
rm -f $@.tmp

export top := $(CURDIR)
export src := src
export srck := $(top)/util/kconfig
Expand Down Expand Up @@ -139,6 +129,16 @@ else

include $(DOTCONFIG)

# in addition to the dependency below, create the file if it doesn't exist
# to silence stupid warnings about a file that would be generated anyway.
$(if $(wildcard .xcompile)$(NOCOMPILE),,$(eval $(shell util/xcompile/xcompile $(XGCCPATH) > .xcompile || rm -f .xcompile)))

.xcompile: util/xcompile/xcompile
rm -f $@
$< $(XGCCPATH) > $@.tmp
\mv -f $@.tmp $@ 2> /dev/null
rm -f $@.tmp

-include .xcompile

ifneq ($(XCOMPILE_COMPLETE),1)
Expand Down
4 changes: 4 additions & 0 deletions Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
## GNU General Public License for more details.
##

ifneq ($(NOCOMPILE),1)
GIT:=$(shell [ -e "$(top)/.git" ] && command -v git)
else
GIT:=
endif

#######################################################################
# normalize Kconfig variables in a central place
Expand Down
12 changes: 9 additions & 3 deletions payloads/coreinfo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ srck := $(src)/../../util/kconfig
coreinfo_obj := $(src)/build
objk := $(src)/build/util/kconfig

ifeq ($(filter %clean,$(MAKECMDGOALS)),)
export KERNELVERSION := 0.1.0
export KCONFIG_AUTOHEADER := $(coreinfo_obj)/config.h
export KCONFIG_AUTOCONFIG := $(coreinfo_obj)/auto.conf
Expand Down Expand Up @@ -128,13 +129,18 @@ $(coreinfo_obj)/config.h:

$(shell mkdir -p $(coreinfo_obj) $(objk)/lxdialog $(KCONFIG_SPLITCONFIG))

include $(srck)/Makefile

.PHONY: $(PHONY) prepare

else

clean:
rm -rf build/*.elf build/*.o .xcompile

distclean: clean
rm -rf build lpbuild
rm -f .config* lp.config*

include $(srck)/Makefile

.PHONY: $(PHONY) prepare clean distclean
.PHONY: clean distclean
endif
22 changes: 11 additions & 11 deletions payloads/libpayload/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,6 @@ DOXYGEN_OUTPUT_DIR := doxygen

all: real-all

# in addition to the dependency below, create the file if it doesn't exist
# to silence stupid warnings about a file that would be generated anyway.
$(if $(wildcard .xcompile),,$(eval $(shell $(top)/../../util/xcompile/xcompile $(XGCCPATH) > .xcompile)))

.xcompile: $(top)/../../util/xcompile/xcompile
$< $(XGCCPATH) > $@.tmp
\mv -f $@.tmp $@ 2> /dev/null

ifeq ($(INNER_SCANBUILD),y)
CC:=$(CC_real)
HOSTCC:=$(CC_real) --hostcc
Expand All @@ -101,8 +93,6 @@ include $(srck)/Makefile

include $(HAVE_DOTCONFIG)

include .xcompile

ARCHDIR-$(CONFIG_LP_ARCH_ARM) := arm
ARCHDIR-$(CONFIG_LP_ARCH_ARM64) := arm64
ARCHDIR-$(CONFIG_LP_ARCH_MIPS) := mips
Expand Down Expand Up @@ -138,7 +128,7 @@ ifeq ($(strip $(HAVE_DOTCONFIG)),)
NOCOMPILE:=1
endif
ifneq ($(MAKECMDGOALS),)
ifneq ($(filter %config distclean,$(MAKECMDGOALS)),)
ifneq ($(filter %config %clean,$(MAKECMDGOALS)),)
NOCOMPILE:=1
endif
endif
Expand All @@ -149,6 +139,16 @@ real-all: config

else

# in addition to the dependency below, create the file if it doesn't exist
# to silence stupid warnings about a file that would be generated anyway.
$(if $(wildcard .xcompile)$(NOCOMPILE),,$(eval $(shell $(top)/../../util/xcompile/xcompile $(XGCCPATH) > .xcompile)))

.xcompile: $(top)/../../util/xcompile/xcompile
$< $(XGCCPATH) > $@.tmp
\mv -f $@.tmp $@ 2> /dev/null

-include .xcompile

ifneq ($(INNER_SCANBUILD),y)
ifeq ($(CONFIG_LP_COMPILER_LLVM_CLANG),y)
CC:=clang -m32
Expand Down

0 comments on commit 0ffef88

Please sign in to comment.