Rev 179 | Rev 268 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 179 | Rev 184 | ||
---|---|---|---|
1 | include Makefile.config |
1 | include Makefile.config |
2 | include ../arch/$(ARCH)/Makefile.inc |
2 | include ../arch/$(ARCH)/Makefile.inc |
3 | 3 | ||
4 | sources=cpu/cpu.c \ |
4 | sources=cpu/cpu.c \ |
5 | main/main.c \ |
5 | main/main.c \ |
6 | main/kinit.c \ |
6 | main/kinit.c \ |
7 | main/uinit.c \ |
7 | main/uinit.c \ |
8 | proc/scheduler.c \ |
8 | proc/scheduler.c \ |
9 | proc/thread.c \ |
9 | proc/thread.c \ |
10 | proc/task.c \ |
10 | proc/task.c \ |
11 | mm/heap.c \ |
11 | mm/heap.c \ |
12 | mm/frame.c \ |
12 | mm/frame.c \ |
13 | mm/page.c \ |
13 | mm/page.c \ |
14 | mm/tlb.c \ |
14 | mm/tlb.c \ |
15 | mm/vm.c \ |
15 | mm/vm.c \ |
16 | lib/func.c \ |
16 | lib/func.c \ |
17 | lib/list.c \ |
17 | lib/list.c \ |
18 | lib/memstr.c \ |
18 | lib/memstr.c \ |
- | 19 | lib/the.c \ |
|
19 | debug/print.c \ |
20 | debug/print.c \ |
20 | time/clock.c \ |
21 | time/clock.c \ |
21 | time/timeout.c \ |
22 | time/timeout.c \ |
22 | time/delay.c \ |
23 | time/delay.c \ |
23 | preempt/preemption.c \ |
24 | preempt/preemption.c \ |
24 | synch/spinlock.c \ |
25 | synch/spinlock.c \ |
25 | synch/condvar.c \ |
26 | synch/condvar.c \ |
26 | synch/rwlock.c \ |
27 | synch/rwlock.c \ |
27 | synch/mutex.c \ |
28 | synch/mutex.c \ |
28 | synch/semaphore.c \ |
29 | synch/semaphore.c \ |
29 | synch/waitq.c \ |
30 | synch/waitq.c \ |
30 | smp/ipi.c \ |
31 | smp/ipi.c \ |
31 | fb/font-8x16.c |
32 | fb/font-8x16.c |
32 | 33 | ||
33 | ifdef DEBUG_SPINLOCK |
34 | ifdef DEBUG_SPINLOCK |
34 | CFLAGS+=-D$(DEBUG_SPINLOCK) |
35 | CFLAGS+=-D$(DEBUG_SPINLOCK) |
35 | endif |
36 | endif |
36 | 37 | ||
37 | ifdef USERSPACE |
38 | ifdef USERSPACE |
38 | CFLAGS+=-D$(USERSPACE) |
39 | CFLAGS+=-D$(USERSPACE) |
39 | endif |
40 | endif |
40 | 41 | ||
41 | ifdef TEST |
42 | ifdef TEST |
42 | test_objects:=$(addsuffix .o,$(basename ../test/$(TEST_DIR)/$(TEST_FILE))) |
43 | test_objects:=$(addsuffix .o,$(basename ../test/$(TEST_DIR)/$(TEST_FILE))) |
43 | CFLAGS+=-D$(TEST) |
44 | CFLAGS+=-D$(TEST) |
44 | endif |
45 | endif |
45 | arch_objects:=$(addsuffix .o,$(basename $(arch_sources))) |
46 | arch_objects:=$(addsuffix .o,$(basename $(arch_sources))) |
46 | objects:=$(addsuffix .o,$(basename $(sources))) |
47 | objects:=$(addsuffix .o,$(basename $(sources))) |
47 | 48 | ||
48 | .PHONY : all config depend build clean dist-clean boot |
49 | .PHONY : all config depend build clean dist-clean boot |
49 | 50 | ||
50 | all: dist-clean config depend build |
51 | all: dist-clean config depend build |
51 | 52 | ||
52 | -include Makefile.depend |
53 | -include Makefile.depend |
53 | 54 | ||
54 | config: |
55 | config: |
55 | find . ../include -name arch -type l -exec rm \{\} \; |
56 | find . ../include -name arch -type l -exec rm \{\} \; |
56 | ln -s ../arch/$(ARCH)/src arch |
57 | ln -s ../arch/$(ARCH)/src arch |
57 | ln -s ../arch/$(ARCH)/include ../include/arch |
58 | ln -s ../arch/$(ARCH)/include ../include/arch |
58 | 59 | ||
59 | depend: |
60 | depend: |
60 | $(CC) $(CPPFLAGS) -M $(arch_sources) $(sources) >Makefile.depend |
61 | $(CC) $(CPPFLAGS) -M $(arch_sources) $(sources) >Makefile.depend |
61 | 62 | ||
62 | build: kernel.bin boot |
63 | build: kernel.bin boot |
63 | 64 | ||
64 | clean: |
65 | clean: |
65 | find . ../arch/$(ARCH)/src ../test -name '*.o' -exec rm \{\} \; |
66 | find . ../arch/$(ARCH)/src ../test -name '*.o' -exec rm \{\} \; |
66 | -rm *.bin kernel.map |
67 | -rm *.bin kernel.map |
67 | $(MAKE) -C ../arch/$(ARCH)/boot clean |
68 | $(MAKE) -C ../arch/$(ARCH)/boot clean |
68 | 69 | ||
69 | dist-clean: |
70 | dist-clean: |
70 | find . ../include -name arch -type l -exec rm \{\} \; |
71 | find . ../include -name arch -type l -exec rm \{\} \; |
71 | -rm Makefile.depend |
72 | -rm Makefile.depend |
72 | -$(MAKE) clean |
73 | -$(MAKE) clean |
73 | 74 | ||
74 | kernel.bin: $(arch_objects) $(objects) $(test_objects) |
75 | kernel.bin: $(arch_objects) $(objects) $(test_objects) |
75 | $(LD) $(LFLAGS) $(arch_objects) $(objects) $(test_objects) -o $@ -Map kernel.map |
76 | $(LD) $(LFLAGS) $(arch_objects) $(objects) $(test_objects) -o $@ -Map kernel.map |
76 | 77 | ||
77 | %.s: %.S |
78 | %.s: %.S |
78 | $(CC) $(CPPFLAGS) -E $< >$@ |
79 | $(CC) $(CPPFLAGS) -E $< >$@ |
79 | 80 | ||
80 | %.o: %.s |
81 | %.o: %.s |
81 | $(AS) $(ASFLAGS) $< -o $@ |
82 | $(AS) $(ASFLAGS) $< -o $@ |
82 | 83 | ||
83 | %.o: %.c |
84 | %.o: %.c |
84 | $(CC) $(CFLAGS) -c $< -o $@ |
85 | $(CC) $(CFLAGS) -c $< -o $@ |
85 | 86 | ||
86 | KS=`cat kernel.bin | wc -c` |
87 | KS=`cat kernel.bin | wc -c` |
87 | 88 | ||
88 | boot: |
89 | boot: |
89 | $(MAKE) -C ../arch/$(ARCH)/boot build KERNEL_SIZE=$(KS) |
90 | $(MAKE) -C ../arch/$(ARCH)/boot build KERNEL_SIZE=$(KS) |
90 | 91 |