kern

view Makefile @ 46:b793b8fcba7d

apparently free_phys_page was never tested. the check for double-freeing a page was inverted.
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 28 Jul 2011 05:33:59 +0300
parents e6f75f91e606
children e49fdda97607
line source
1 # collect all of our C and assembly source files
2 csrc = $(wildcard src/boot/*.c) $(wildcard src/*.c) $(wildcard src/klibc/*.c)
3 asmsrc = $(wildcard src/boot/*.S) $(wildcard src/*.S) $(wildcard src/klibc/*.S)
4 dep = $(asmsrc:.S=.d) $(csrc:.c=.d)
6 # each source file will generate one object file
7 obj = $(asmsrc:.S=.o) $(csrc:.c=.o)
9 CC = gcc
11 inc = -Isrc -Isrc/klibc -Isrc/boot
13 # -nostdinc instructs the compiler to ignore standard include directories
14 # -m32 instructs the compiler to produce 32bit code (in case we have a 64bit compiler)
15 CFLAGS = -m32 -Wall -g -nostdinc -fno-builtin $(inc)
16 ASFLAGS = -m32 -g -nostdinc -fno-builtin $(inc)
18 bin = kernel.elf
20 # default target: make an ELF binary by linking the object files
21 # we need to specify where to assume the text section (code) is going
22 # in memory, as well as the kernel entry point (kentry).
23 $(bin): $(obj)
24 ld -melf_i386 -o $@ -Ttext 0x100000 -e kentry $(obj) -Map link.map
26 %.s: %.c
27 $(CC) $(CFLAGS) -S -o $@ $<
29 -include $(dep)
31 %.d: %.c
32 @$(CPP) $(CFLAGS) -MM -MT $(@:.d=.o) $< >$@
34 %.d: %.S
35 @$(CPP) $(ASFLAGS) -MM -MT $(@:.d=.o) $< >$@
37 .PHONY: clean
38 clean:
39 rm -f $(obj) $(bin)
41 .PHONY: cleandep
42 cleandep:
43 rm -f $(dep)