-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (25 loc) · 675 Bytes
/
Copy pathMakefile
File metadata and controls
37 lines (25 loc) · 675 Bytes
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
KERNEL := kernel
USER := user
BOOT_DIR = $(KERNEL)/boot
VMLINUX := vmlinux.img
LINKS := scripts/vmlinux.ld
ROOT_DIR := $(shell realpath .)
export $(ROOT_DIR)
OBJS := $(KERNEL)/*/*.o
debug: $(KERNEL)
$(LD) $(LDFLAGS) -T $(LINKS) -o $(VMLINUX) $(OBJS)
@echo "Press Ctrl-C and then input 'quit' to exit GDB and QEMU"
@echo "-------------------------------------------------------"
@${QEMU} ${QFLAGS} -kernel $(VMLINUX) -s -S &
@${GDB} $(VMLINUX) -q -x ./gdbinit
.PHONY: .FORCE
$(KERNEL): .FORCE
$(MAKE) build -C $@
%.o : %.c
${CC} ${CFLAGS} -c -o $@ $<
clean:
for dir in $(KERNEL); do \
$(MAKE) -C $$dir clean; \
done;\
rm -rf *.o *.img
include basic.mk