diff options
author | Joel Stanley <joel@jms.id.au> | 2015-11-26 13:52:18 +1030 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-11-26 15:16:37 +1100 |
commit | c70529a196e81cecd3a9f9b6e9e867d9c7df640a (patch) | |
tree | 7fa305166949efd56628a01ed53912a847a972ff /external/common/rules.mk | |
parent | 71c2d6b72be7213914e2708c884b45fa74f525e6 (diff) | |
download | skiboot-c70529a196e81cecd3a9f9b6e9e867d9c7df640a.zip skiboot-c70529a196e81cecd3a9f9b6e9e867d9c7df640a.tar.gz skiboot-c70529a196e81cecd3a9f9b6e9e867d9c7df640a.tar.bz2 |
external/pflash: Add quiet rules and fix race
Adding quiet rules to make our output a bit cleaner. Building now looks
like this:
$ make
LN libflash
LN common
LN ccan
CC pflash.o
CC version.o
LD common-arch_flash.o
CC pflash
You can see the full build ouput by doing a "make V=1".
By doing this, we build fractionally faster, exposing arace condition
between running the make_version.sh script and the link existing for it.
As we run it when creating the variable, there is no way to ensure it
exists first.
Solved this by not creating the symlink and simply running
make_version.sh from the root.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external/common/rules.mk')
-rw-r--r-- | external/common/rules.mk | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/external/common/rules.mk b/external/common/rules.mk index 7ebf485..4d94fe8 100644 --- a/external/common/rules.mk +++ b/external/common/rules.mk @@ -17,19 +17,29 @@ endif endif endif -.PHONY: arch_links -arch_links: - ln -sf ../../hw/ast-bmc/ast-sf-ctrl.c common/ast-sf-ctrl.c - ln -sf ../../include/ast.h common/ast.h - ln -sf arch_flash_$(arch)_io.h common/io.h + +# Arch links are like this so we can have dependencies work (so that we don't +# run the rule when the links exist), pretty build output (knowing the target +# name) and a list of the files so we can clean them up. +ARCH_LINKS = common/ast-sf-ctrl.c common/ast.h common/io.h + +arch_links: $(ARCH_LINKS) +common/ast.h : ../../include/ast.h | common + $(Q_LN)ln -sf ../../include/ast.h common/ast.h + +common/io.h : ../common/arch_flash_$(arch)_io.h | common + $(Q_LN)ln -sf arch_flash_$(arch)_io.h common/io.h + +common/ast-sf-ctrl.c : ../../hw/ast-bmc/ast-sf-ctrl.c | common + $(Q_LN)ln -sf ../../hw/ast-bmc/ast-sf-ctrl.c common/ast-sf-ctrl.c .PHONY: arch_clean arch_clean: - rm -rf $(ARCH_OBJS) + rm -rf $(ARCH_OBJS) $(ARCH_LINKS) $(ARCH_OBJS): common-%.o: common/%.c - $(CROSS_COMPILE)gcc $(CFLAGS) -c $< -o $@ + $(Q_CC)$(CROSS_COMPILE)gcc $(CFLAGS) -c $< -o $@ common-arch_flash.o: $(ARCH_OBJS) - $(CROSS_COMPILE)ld $(LDFLAGS) -r $(ARCH_OBJS) -o $@ + $(Q_LD)$(CROSS_COMPILE)ld $(LDFLAGS) -r $(ARCH_OBJS) -o $@ |