-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (39 loc) · 1.28 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
# The main makefile for Dominos
#
# Builds the kernel, userspace, and builds a boot image
# You can build everything from here (or at least you will be able to)
# Only the JOEL4 kernel is supported at this time
# one day, we may support other kernels
export KERNEL_DIR=kernel/joel4
TOP=`pwd`
# default target - build it all
# 'make all' or just 'make' will build this target
all: tools kernel user init.cpio
./makeiso.sh grub2
.PHONY: kernel user
# set DEBUG to off by default
DEBUG?=n
# if the user called 'make debug' turn on debugging
debug: DEBUG:=y
# target for 'make debug' which just builds everything
debug: all
# check to make sure all the correct tools exist
# that are necessary to complete the build
tools:
# make the selected kernel (so far, only JOEL4 has been tried)
kernel:
make -C $(KERNEL_DIR) DEBUG=$(DEBUG)
# userspace is not part of the kernel - build it separately
user:
make -C user
# this is like linux's 'initrd' - needed for booting
init.cpio: initfiles.txt boot.txt user
cpio --format=newc -o < initfiles.txt > init.cpio
.PHONY: tags clean
tags:
ctags -R -f tags user/* kernel/joel4/src/l4.c kernel/joel4/include/*
clean:
make -C $(KERNEL_DIR) clean
make -C user clean
@if [ -e init.cpio ] ; then rm init.cpio; fi
@if [ -e dominos.iso ] ; then rm dominos.iso; fi