forked from coreos/afterburn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (29 loc) · 908 Bytes
/
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
DESTDIR ?=
PREFIX ?= /usr
RELEASE ?= 1
DEFAULT_INSTANCE ?= core
ifeq ($(RELEASE),1)
PROFILE ?= release
CARGO_ARGS = --release
else
PROFILE ?= debug
CARGO_ARGS =
endif
units = $(addprefix systemd/, \
afterburn-checkin.service \
afterburn-firstboot-checkin.service \
afterburn.service \
afterburn-sshkeys.target)
.PHONY: all
all: $(units)
cargo build ${CARGO_ARGS}
%.service: %.service.in
sed -e 's,@DEFAULT_INSTANCE@,'$(DEFAULT_INSTANCE)',' < $< > [email protected] && mv [email protected] $@
.PHONY: install-units
install-units: $(units)
for unit in $(units); do install -D -m 644 --target-directory=$(DESTDIR)$(PREFIX)/lib/systemd/system/ $$unit; done
.PHONY: install
install: install-units
install -D -m 644 -t ${DESTDIR}$(PREFIX)/lib/dracut/modules.d/30afterburn dracut/30afterburn/*
install -D -t ${DESTDIR}$(PREFIX)/bin target/${PROFILE}/afterburn