Files
bootrr/Makefile
Mark Brown f65d7327ca bin: Add a tool to generate a template bootrr board description
bootrr requires a description of each board it runs on to provide
detection of the actual devices and system support that is
present.  Currently these descriptions must be written by hand
but we can ease the process of creating them by providing a tool
which examines the running system and outputs a set of bootrr
assertions which would pass on the system.

The script will require post processing by users, the generate
rule names won't be good, hotplugged devices will be included and
any spaces in device or driver names will cause confusion, but it
can provide a usefuls starting point.

Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-17 22:52:56 -06:00

51 lines
947 B
Makefile

.PHONY: all
all:
all-install :=
DESTDIR ?= dest
CPIONAME ?= bootrr
HELPERS := $(wildcard helpers/*)
BOARDS := $(wildcard boards/*)
BINS := bin/bootrr bin/bootrr-generate-template
LIBEXEC_DIR ?= $(prefix)/libexec
BOOTRR_DIR = $(LIBEXEC_DIR)/bootrr
define add-scripts
$(DESTDIR)$1/$2: $2
@echo "INSTALL $$<"
@install -D -m 755 $$< $$@
all-install += $(DESTDIR)$1/$2
endef
$(foreach v,${BOARDS},$(eval $(call add-scripts,$(BOOTRR_DIR),$v)))
$(foreach v,${HELPERS},$(eval $(call add-scripts,$(BOOTRR_DIR),$v)))
$(foreach v,${BINS},$(eval $(call add-scripts,$(prefix),$v)))
bin/bootrr: bin/bootrr.in Makefile
@sed -e 's!@BOOTRR@!$(BOOTRR_DIR)!g' $< > $@.tmp
@mv $@.tmp $@
install: $(all-install)
CPIO := $(PWD)/$(CPIONAME).cpio
$(CPIO): $(all-install)
@cd $(DESTDIR) && find ./$(prefix) | cpio -o -H newc > $(CPIO)
%.cpio.gz: %.cpio
@gzip < $< > $@
cpio: $(CPIO)
cpio.gz: $(CPIO).gz
clean:
@rm -f $(CPIO) $(CPIO).gz bin/bootrr