-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (30 loc) · 1.17 KB
/
Makefile
File metadata and controls
42 lines (30 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
TOPDIR := $(PWD)
PARTITIONS := $(wildcard platforms/*/*/partitions.conf)
PARTITIONS_XML := $(patsubst %.conf,%.xml, $(PARTITIONS))
PLATFORMS := $(patsubst %/partitions.conf,%/gpt, $(PARTITIONS))
CONTENTS_XML_IN := $(wildcard platforms/*/*/contents.xml.in)
CONTENTS_XML := $(patsubst %.xml.in,%.xml, $(CONTENTS_XML_IN))
BINS := gen_contents.py gen_partition.py msp.py ptool.py
PREFIX ?= /usr/local
# optional build_id for Axiom contents.xml files
BUILD_ID ?=
.PHONY: all check clean lint integration
all: $(PLATFORMS) $(PARTITIONS_XML) $(CONTENTS_XML)
%/gpt: %/partitions.xml
cd $(shell dirname $^) && $(TOPDIR)/ptool.py -x partitions.xml
%/partitions.xml: %/partitions.conf
$(TOPDIR)/gen_partition.py -i $^ -o $@
%/contents.xml: %/partitions.xml %/contents.xml.in
$(TOPDIR)/gen_contents.py -p $< -t $@.in -o $@ $${BUILD_ID:+ -b $(BUILD_ID)}
lint:
ruff check *.py
mypy *.py
integration: all
# make sure generated output has created expected files
tests/integration/check-missing-files platforms/*/*/*.xml
check: lint integration
install: $(BINS)
install -d $(DESTDIR)$(PREFIX)/bin
install -m 755 $^ $(DESTDIR)$(PREFIX)/bin
clean:
@rm -f platforms/*/*/*.xml platforms/*/*/*.bin