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/pflash | |
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/pflash')
-rw-r--r-- | external/pflash/Makefile | 23 | ||||
-rw-r--r-- | external/pflash/rules.mk | 13 |
2 files changed, 22 insertions, 14 deletions
diff --git a/external/pflash/Makefile b/external/pflash/Makefile index f0c3773..e2aa33d 100644 --- a/external/pflash/Makefile +++ b/external/pflash/Makefile @@ -1,3 +1,11 @@ +# Use make V=1 for a verbose build. +ifndef V + Q_CC= @echo ' CC ' $@; + Q_LD= @echo ' LD ' $@; + Q_LN= @echo ' LN ' $@; + Q_MKDIR=@echo ' MKDIR ' $@; +endif + include rules.mk GET_ARCH = ../../external/common/get_arch.sh include ../../external/common/rules.mk @@ -5,19 +13,16 @@ include ../../external/common/rules.mk all: $(EXE) .PHONY: links -links: libflash ccan common make_version.sh +links: libflash ccan common libflash: - ln -sf ../../libflash . + $(Q_LN)ln -sf ../../libflash . ccan: - ln -sf ../../ccan . + $(Q_LN)ln -sf ../../ccan . common: - ln -sf ../common . - -make_version.sh: - ln -sf ../../make_version.sh + $(Q_LN)ln -sf ../common . $(OBJS): | links arch_links @@ -38,9 +43,11 @@ dist: links .version ../pflash/.version ../pflash/make_version.sh \ ../pflash/common/* +.PHONY: clean clean: arch_clean rm -f $(OBJS) $(EXE) *.o *.d libflash/test/test_flash libflash/test/*.o +.PHONY: distclean distclean: clean rm -f *.c~ *.h~ *.sh~ Makefile~ config.mk~ libflash/*.c~ libflash/*.h~ rm -f libflash ccan .version .version.tmp - rm -f common io.h make_version.sh + rm -f common io.h diff --git a/external/pflash/rules.mk b/external/pflash/rules.mk index 96f6a4f..f49e438 100644 --- a/external/pflash/rules.mk +++ b/external/pflash/rules.mk @@ -2,16 +2,17 @@ override CFLAGS += -O2 -Wall -I. OBJS = pflash.o progress.o version.o -LIBFLASH_OBJS += libflash-libflash.o libflash-libffs.o libflash-ecc.o libflash-blocklevel.o libflash-file.o +LIBFLASH_OBJS += libflash-libflash.o libflash-libffs.o libflash-ecc.o \ + libflash-blocklevel.o libflash-file.o OBJS += $(LIBFLASH_OBJS) OBJS += common-arch_flash.o EXE = pflash CC = $(CROSS_COMPILE)gcc -PFLASH_VERSION ?= $(shell ./make_version.sh $(EXE)) +PFLASH_VERSION ?= $(shell ../../make_version.sh $(EXE)) -version.c: make_version.sh .version +version.c: .version @(if [ "a$(PFLASH_VERSION)" = "a" ]; then \ echo "#error You need to set PFLASH_VERSION environment variable" > $@ ;\ else \ @@ -19,11 +20,11 @@ version.c: make_version.sh .version fi) > $@ %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ + $(Q_CC)$(CC) $(CFLAGS) -c $< -o $@ $(LIBFLASH_OBJS): libflash-%.o : libflash/%.c - $(CC) $(CFLAGS) -c $< -o $@ + $(Q_CC)$(CC) $(CFLAGS) -c $< -o $@ $(EXE): $(OBJS) - $(CC) $(CFLAGS) $^ -lrt -o $@ + $(Q_CC)$(CC) $(CFLAGS) $^ -lrt -o $@ |