-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile.am
More file actions
152 lines (121 loc) · 4.2 KB
/
Makefile.am
File metadata and controls
152 lines (121 loc) · 4.2 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# Upcalls
# Copyright (C) 2025 Boston University,
# Eric B. Munson
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
EXTRA_DIST = \
.gitignore \
LICENSE \
README.md
CLEANFILES = \
*~ *.o *.a \
stamp-h1 \
upcall-initrd.cpio.gz \
linux/.config \
vmlinuz
clean-local:
-cd linux && $(MAKE) clean
-cd $(PROGRAM) && $(MAKE) clean
-rm upcall-initrd.cpio.gz
-cd initrd && $(MAKE) clean
-find -name config.cache -delete
init-clean:
-rm upcall-initrd.cpio.gz
-cd initrd && $(MAKE) clean
app-clean: init-clean
-cd libupcall && $(MAKE) clean
-cd $(PROGRAM) && $(MAKE) clean
kern-clean: init-clean
-rm vmlinuz
-cd linux && $(MAKE) clean && rm .config
min-clean: app-clean kern-clean init-clean
DIST_SUBDIRS = event-tester libupcall
#----------------------------------------------------------------------
# Build Linux kernel
noinst_DATA = vmlinuz
stamp-linux-dir:
rm -f $@
if ! test -d linux; then \
git clone -b upcalls https://github.com/unikernelLinux/linux.git; \
fi
touch $@
initrd/perf: linux/tools/perf/perf stamp-linux-dir
cp $< $@
linux/tools/perf/perf: stamp-linux-dir linux/arch/x86/boot/bzImage
$(MAKE) -C $(srcdir)/linux/tools perf
vmlinuz: linux/arch/x86/boot/bzImage stamp-linux-dir
cp $< $@
linux/arch/x86/boot/bzImage: stamp-linux-dir linux/.config
$(MAKE) -C $(srcdir)/linux olddefconfig O=$(abs_builddir)/linux
$(MAKE) -C $(srcdir)/linux O=$(abs_builddir)/linux
$(MAKE) -C $(srcdir)/linux scripts_gdb
linux/.config: stamp-linux-dir savedconfig
rm -f $@
cp $(srcdir)/savedconfig $@
#----------------------------------------------------------------------
# Compile the program.
if ENABLE_LIBUPCALL
UPCALL_LIB = $(abs_top_builddir)/libupcall/libupcall.a
else
UPCALL_LIB =
endif
$(abs_top_builddir)/libupcall/libupcall.a:
cd $(abs_top_builddir)/libupcall && $(MAKE)
$(PROGRAM)/stamp-initrd: $(UPCALL_LIB)
$(MAKE) -C $(PROGRAM) stamp-initrd
#----------------------------------------------------------------------
# Per-program configuration and data files (if required).
$(PROGRAM)/data.tar.gz: $(UPCALL_LIB)
rm -f $@
cd $(PROGRAM) && $(MAKE) all
if ! test -f $@; then tar zcf $@ --no-recursion . ; fi
#----------------------------------------------------------------------
# Build the initramfs
noinst_DATA += upcall-initrd.cpio.gz
upcall-initrd.cpio.gz: $(PROGRAM)/stamp-initrd $(PROGRAM)/data.tar.gz vmlinuz initrd/perf
cp $(PROGRAM)/data.tar.gz initrd/
$(MAKE) -C $(srcdir)/initrd $@
cp initrd/$@ $@
#----------------------------------------------------------------------
# Boot the under qemu.
# Non-privileged:
boot: vmlinuz upcall-initrd.cpio.gz
./run_qemu.sh $^
# Privileged (probably required if the kernel is expecting incoming
# network connections).
boot-priv: vmlinuz upcall-initrd.cpio.gz
sudo ./run_net_qemu.sh $^ 2
#----------------------------------------------------------------------
# Maintainers only!
# Check no files are missing from EXTRA_DIST rules, and that all
# generated files have been included in the tarball. (Note you must
# have done 'make dist')
maintainer-check-extra-dist:
@zcat $(PACKAGE_NAME)-$(VERSION).tar.gz | tar tf - | sort | \
sed 's,^$(PACKAGE_NAME)-$(VERSION)/,,' > tarfiles
@git ls-files | \
sort > gitfiles
@comm -13 tarfiles gitfiles > comm-out
@echo Checking for differences between EXTRA_DIST and git ...
@cat comm-out
@[ ! -s comm-out ]
@rm tarfiles gitfiles comm-out
@echo PASS: EXTRA_DIST tests
# Commit everything in the current directory and set the commit
# message to the current version number.
maintainer-commit:
git commit -a -m "Version $(VERSION)."
# Tag HEAD with the current version.
maintainer-tag:
git tag -a v$(VERSION) -m "Version $(VERSION)." -f