-
Notifications
You must be signed in to change notification settings - Fork 48
/
Makefile
62 lines (44 loc) · 1.52 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
55
56
57
58
59
60
61
62
# vim: tabstop=8 shiftwidth=8 noexpandtab:
TOPDIR = $(CURDIR)
# Directories which require calling make recursively
SUBDIR = sys lib bin usr.bin etc include contrib
all: install
build: setup
install: build
distclean: clean
format:
./verify-format.sh --fix
bin-before: lib-install
usr.bin-before: lib-install
contrib-before: lib-install
# Detecting whether initrd.cpio requires rebuilding is tricky, because even if
# this target was to depend on $(shell find sysroot -type f), then make compares
# sysroot files timestamps BEFORE recursively entering bin and installing user
# programs into sysroot. This sounds silly, but apparently make assumes no files
# appear "without their explicit target". Thus, the only thing we can do is
# forcing make to always rebuild the archive.
initrd.cpio: bin-install usr.bin-install contrib-install
@echo "[INITRD] Building $@..."
cd sysroot && \
find -depth \( ! -name "*.dbg" -and -print \) | sort | \
$(CPIO) -o -R +0:+0 -F ../$@ 2> /dev/null
INSTALL-FILES += initrd.cpio
CLEAN-FILES += initrd.cpio
distclean-here:
$(RM) -r sysroot
setup:
$(MAKE) -C include setup
test: sys-build initrd.cpio
./run_tests.py --board $(BOARD)
PHONY-TARGETS += setup test
IMGVER = 1.12.0
IMGNAME = cahirwpz/mimiker-ci
docker-build:
docker build . -t $(IMGNAME):latest
docker-tag:
docker image tag $(IMGNAME):latest $(IMGNAME):$(IMGVER)
docker-push:
docker push $(IMGNAME):latest
docker push $(IMGNAME):$(IMGVER)
PHONY-TARGETS += docker-build docker-tag docker-push
include $(TOPDIR)/build/common.mk