source: mainline/src/Makefile@ 6e787c4

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 6e787c4 was 6e787c4, checked in by Jakub Jermar <jakub@…>, 20 years ago

Make rwlock test #3 compile again.

Make rwlock test #4 preemption-safe.

Prepare for preemption controlling functions.

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