forked from gotoz/runq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (41 loc) · 1.24 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
47
48
49
50
51
52
53
54
include make.rules
SUBDIRS := cmd/proxy cmd/init cmd/runq cmd/runq-exec cmd/nsenter cmd/vsockd
TARDIR := runq-$(GIT_COMMIT)
TARFILE := $(TARDIR).tar.gz
.PHONY: all $(SUBDIRS) install image test tarfile release release-install clean distclean version
all: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@
install: $(SUBDIRS) $(QEMU_ROOT) version
$(MAKE) -C cmd/proxy install
$(MAKE) -C cmd/runq install
$(MAKE) -C cmd/runq-exec install
$(MAKE) -C initrd install
install -m 0444 -D version $(RUNQ_ROOT)/version
version:
echo "Git Commit: $(GIT_COMMIT)" > $@
chown `stat --printf "%u:%g" .git` $@
image:
$(MAKE) -C qemu image
test:
$(MAKE) -C test
tarfile:
tar -C $(RUNQ_ROOT) --transform 's,^./,$(TARDIR)/,' --numeric-owner --owner=0 --group=0 -czf $(TARFILE) .
chown `stat --printf "%u:%g" .git` $(TARFILE)
release: image
docker run \
--rm \
--init \
-v $(CURDIR):/runq \
$(BUILD_IMAGE) make clean install tarfile clean2
release-install: $(TARFILE)
mkdir -p $(RUNQ_ROOT)
tar -C $(RUNQ_ROOT) --strip-components 1 -xzf $(TARFILE)
clean clean2:
$(foreach d,$(SUBDIRS) qemu initrd,$(MAKE) -C $(d) clean;)
git -C $(RUNC_ROOT) clean -xfd
git -C $(RUNC_ROOT) reset --hard
rm -f version
distclean: clean
$(MAKE) -C qemu distclean
rm -f runq-*.tar.gz