forked from mirage/mirage-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (53 loc) · 1.39 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
63
64
65
66
67
-include Makefile.config
TESTS = console entropy network stackv4 ethifv4 io_page lwt ping static_website dns \
conduit_server conduit_server_manual
CONFIGS = $(patsubst %, %-configure, $(TESTS))
DEPENDS = $(patsubst %, %-depend, $(TESTS))
BUILDS = $(patsubst %, %-build, $(TESTS))
RUNS = $(patsubst %, %-run, $(TESTS))
CLEANS = $(patsubst %, %-clean, $(TESTS))
all:
@echo Run:
@echo make configure
@echo make depend
@echo make build
configure: $(CONFIGS)
depend: $(DEPENDS)
build: $(BUILDS) lwt-build
run: $(RUNS)
clean: $(CLEANS) lwt-clean
## lwt special cased
lwt: lwt-clean lwt-build
lwt-configure:
@ :
lwt-depend:
@ :
lwt-build:
$(MAKE) -C lwt build
lwt-clean:
$(MAKE) -C lwt clean
## default tests
%-configure:
$(MIRAGE) configure $*/config.ml --$(MODE) $(FLAGS)
cd $* && $(MAKE) depend
%-depend:
cd $* && $(MAKE) depend
%-build:
cd $* && $(MAKE)
%-run:
@grep "PKGS.*=.*mirage-xen" $*/Makefile ;\
if [ $$? -eq 0 ]; then \
echo "use your preferred toolchain to boot your unikernel" ;\
else \
echo execute the output as a POSIX process by ;\
echo $$ sudo $(MIRAGE) run $*/config.ml ;\
fi
%-clean:
$(MIRAGE) clean $*/config.ml
$(RM) log
## create raw device for block_test
UNAME_S := $(shell uname -s)
block_test/disk.raw:
[ "$(PLATFORM)" = "Darwin" ] && \
hdiutil create -sectors 12 -layout NONE disk.raw && \
mv disk.raw.dmg block_test/disk.raw