Move u-root.cpio pre-deletion from a global make definition to a "clean" rule

This commit is contained in:
Jean-Marie Verdun 2018-03-12 21:31:58 +01:00
parent 87ae9072b2
commit 5bad1cc595

View File

@ -8,9 +8,6 @@
u-root_url := github.com/u-root/u-root
u-root_output := $(build)/$(BOARD)/u-root.cpio
UROOT_CMDS ?=
ifeq ($(shell test -e build/$(BOARD)/u-root.cpio && echo -n yes),yes)
$(shell rm $(build)/$(BOARD)/u-root.cpio)
endif
export GOPATH=$(build)/go
src_cmds := $(foreach cmd,$(UROOT_CMDS),github.com/u-root/u-root/cmds/$(cmd))
@ -20,7 +17,10 @@ $(GOPATH):
go get $(u-root_url) \
)
$(u-root_output): $(GOPATH)
clean:
rm -f $(build)/$(BOARD)/u-root.cpio
$(u-root_output): $(GOPATH) clean
ifeq ($(shell test -e boards/$(BOARD)/uinit.go && echo -n yes),yes)
ifeq ($(shell (test -d $(GOPATH)/src/github.com/u-root/u-root/cmds/uinit || echo -n yes)),yes)
mkdir $(GOPATH)/src/github.com/u-root/u-root/cmds/uinit