-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
58 lines (45 loc) · 1.77 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
ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
include $(ROOT)/build/base.mak
SUBDIRS = bootloader kernel
STARTTIME := $(shell date +%s)
# Main targets
all: toolchain
$(call cmd_msg,NOTICE,Build completed in $$(($$(date +%s)-$(STARTTIME))) seconds)
distclean: clean doxyclean
include $(addsuffix /GeexOS.mak,$(SUBDIRS))
.PHONY: all clean distclean bochs qemu qemudebug doxygen doxyclean
toolchain: $(CC) $(LD) $(NASM) $(QEMU) $(GDB)
$(CC) $(LD) $(NASM) $(QEMU) $(GDB):
$(call cmd_msg,SUBDIR,toolchain)
$(call call_submake,toolchain,all)
# TODO: build script for automatic disk-image dependency rule creation
testhdd.img: all $(BINARY-mbr) $(BINARY-stage1_fat16) $(BINARY-stage2)
#create the target file by touching it. This has the nice effect that it belongs to the current user
#so, even if we need root rights to actually create the diskimage afterwards, it still belongs to the user and not root
touch $@
ifeq ($(shell uname),Linux)
$(SUDO) utils/buildhddimage.py utils/partlayout.json $@
else
utils/buildhddimage.py utils/partlayout.json $@
endif
bochs: testhdd.img
$(call cmd_msg,BOCHS,testhdd.img)
$(Q)$(BOCHS) -f resources/bochsrc.txt -q $(QOUTPUT)
qemu: testhdd.img
$(call cmd_msg,QEMU,testhdd.img)
$(Q)$(QEMU) -net none -hda testhdd.img -serial file:serialOut $(QOUTPUT)
qemudebug: testhdd.img
$(call cmd_msg,QEMU,testhdd.img)
$(call cmd_msg,NOTE,Waiting for gdb attachment on port 1234...)
$(Q)$(QEMU) -net none -hda testhdd.img -serial file:serialOut -s -S $(QOUTPUT)
doxygen: doxygen.conf
$(call cmd_msg,DOXYGEN,$<)
$(Q)cat $< | doxygen - $(QOUTPUT)
doxyclean:
$(Q)$(RM) -rf doc/html
clean:
$(Q)$(RM) -f testhdd.img
$(call call_submake,toolchain,clean)
distclean:
$(call call_submake,toolchain,distclean)
$(call call_submake,toolchain,toolchain-clean)