diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/Makefile b/Makefile deleted file mode 100644 index e6f879c..0000000 --- a/Makefile +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | # vim: ts=8 noet: | ||
2 | |||
3 | NVME_SCRIPTS := $(subst scripts/,build/,$(wildcard scripts/nvme/*)) | ||
4 | CORE_PROFILES := $(wildcard profiles/*/*) | ||
5 | TARGET_PROFILES := $(wildcard profiles/*.conf) | ||
6 | |||
7 | PROFILE := | ||
8 | BUILD := | ||
9 | BUILDS := $(BUILD) | ||
10 | LEVEL := | ||
11 | |||
12 | # by default, use the 'packer' in the path | ||
13 | PACKER := packer | ||
14 | export PACKER | ||
15 | |||
16 | |||
17 | check_defined = \ | ||
18 | $(strip $(foreach 1,$1, \ | ||
19 | $(call __check_defined,$1,$(strip $(value 2))))) | ||
20 | __check_defined = \ | ||
21 | $(if $(value $1),, \ | ||
22 | $(error Undefined $1$(if $2, ($2))$(if $(value @), \ | ||
23 | required by target `$@'))) | ||
24 | |||
25 | |||
26 | .PHONY: amis prune release-readme clean | ||
27 | |||
28 | amis: build/packer.json build/profile/$(PROFILE) build | ||
29 | @:$(call check_defined, PROFILE, target profile name) | ||
30 | build/builder make-amis $(PROFILE) $(BUILDS) | ||
31 | |||
32 | prune: build | ||
33 | @:$(call check_defined, LEVEL, pruning level) | ||
34 | @:$(call check_defined, PROFILE, target profile name) | ||
35 | build/builder prune-amis $(LEVEL) $(PROFILE) $(BUILD) | ||
36 | |||
37 | release-readme: releases/README.md | ||
38 | releases/README.md: build | ||
39 | @:$(call check_defined, PROFILE, target profile name) | ||
40 | @:$(call require_var, PROFILE) | ||
41 | build/builder gen-release-readme $(PROFILE) | ||
42 | |||
43 | build: | ||
44 | python3 -m venv build | ||
45 | [ -d build/profile ] || mkdir -p build/profile | ||
46 | build/bin/pip install -U pip pyhocon pyyaml boto3 | ||
47 | |||
48 | echo -e "#!/bin/sh\n$$(pwd)/build/bin/python scripts/builder.py \$$@" > $@ | ||
49 | chmod +x $@ | ||
50 | |||
51 | build/packer.json: packer.conf build | ||
52 | build/builder convert-packer-config | ||
53 | |||
54 | .PHONY: build/profile/$(PROFILE) | ||
55 | build/profile/$(PROFILE): build $(CORE_PROFILES) $(TARGET_PROFILES) | ||
56 | @:$(call check_defined, PROFILE, target profile name) | ||
57 | build/builder resolve-profiles $(PROFILE) | ||
58 | |||
59 | clean: | ||
60 | rm -rf build | ||