forked from acefei/ace-osinstaller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (32 loc) · 1.17 KB
/
Makefile
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
.PHONY: help
.DEFAULT_GOAL := help
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
BUILD_ARGS :=
DOCKER_BUILD = DOCKER_BUILDKIT=1 docker build $(BUILD_ARGS) -t $@ --target $@ $(<D)
build: Dockerfile
$(DOCKER_BUILD)
# Need to assign HTTP SERVER IP
iso: private BUILD_ARGS := --build-arg HTTP_SERVER=$(HTTP_SERVER)
iso: Dockerfile ## build ipxe.iso to output dir
@echo "Ensure http://$${HTTP_SERVER:? please run make with 'HTTP_SERVER=<ip>'}/boot.ipxe is available before installing ipxe.iso"
$(DOCKER_BUILD)
@docker run --rm -v $(PWD)/output:/$@ $@
@echo "artifact is available on $$(sha256sum output/ipxe.iso| awk '{print $$2,$$1}')"
boot_ipxe: www ## generate boot.ipxe to www dir
@python3 scripts/gen_embedded_script.py $<
ifdef HTTP_SERVER
http_server: iso boot_ipxe ## set up http server for boot.ipxe and the local distro iso in www/
else
http_server: boot_ipxe
endif
@bash www/mount_iso.sh