Files
bootrr/Makefile
Dmitry Baryshkov 4a600192ca Makefile: remove list of files to be installed
Remove lists of boards and helpers, this is too error-prone. For example
the list of helpers missed bootrr-generic-tests.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2021-11-01 11:48:12 -05:00

41 lines
673 B
Makefile

.PHONY: all
all:
all-install :=
DESTDIR ?= dest
CPIONAME ?= bootrr
HELPERS := $(wildcard helpers/*)
BOARDS := $(wildcard boards/*)
define add-scripts
$(DESTDIR)$(prefix)/bin/$(notdir $1): $1
@echo "INSTALL $$<"
@install -D -m 755 $$< $$@
all-install += $(DESTDIR)$(prefix)/bin/$(notdir $1)
endef
$(foreach v,${BOARDS},$(eval $(call add-scripts,$v)))
$(foreach v,${HELPERS},$(eval $(call add-scripts,$v)))
install: $(all-install)
CPIO := $(PWD)/$(CPIONAME).cpio
$(CPIO): $(all-install)
@cd $(DESTDIR) && find ./$(prefix)/bin | cpio -o -H newc > $(CPIO)
%.cpio.gz: %.cpio
@gzip < $< > $@
cpio: $(CPIO)
cpio.gz: $(CPIO).gz
clean:
@rm -f $(CPIO) $(CPIO).gz