-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
46 lines (35 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
41
42
43
44
45
46
NAME := bootkit
COMMANDS = pkg/bkcust pkg/oci-boot
include subs.mk
include common.mk
.PHONY: layers
layers:
$(STACKER_RBUILD)
custom: pkg/bkcust
$(STACKER_BUILD) --stacker-file=layers/custom/custom.yaml
bin: $(COMMANDS)
$(COMMANDS): $(ALL_GO_FILES)
@$(call go_build,./cmd/$(notdir $@))
.PHONY: go-stacker-build
go-stacker-build:
cd go && $(STACKER_BUILD)
go-build: $(ALL_GO_FILES) $(COMMANDS)
@$(call go_build,./...)
LAYERS := $(shell cd $(TOP_D)/layers && \
for d in *; do [ -f "$$d/stacker.yaml" ] && echo "$$d"; done )
# probably too clever, but the foreach expands to layer-kernel layer-shim ...
# and then $@ replaces 'layer-' with 'layers/' resulting in
# --stacker-file=layers/<layer>/stacker.yaml
# The result is you can 'make layer-shim' and also tab-complete that.
$(foreach d,$(LAYERS),layer-$(d)):
$(STACKER_BUILD) "--stacker-file=$(subst layer-,layers/,$@)/stacker.yaml"
.PHONY: publish
publish:
@$(call required_var,PUBLISH_USER)
@$(call required_var,PUBLISH_PASSWORD)
@$(call required_var,PUBLISH_URL)
@echo publishing with $(PUBLISH_USER):SECRET to $(PUBLISH_URL)
@$(STACKER_PUBLISH)
.PHONY: stacker-clean
stacker-clean:
stacker $(STACKER_OPTS) clean