source: mainline/src/Makefile@ ae9624e

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since ae9624e was ae9624e, checked in by Ondrej Palkovsky <ondrap@…>, 20 years ago

Symbol table now contains static functions too.
NOTE: gcc heavily inlines, be aware of optimizations.

Removed excesive item from boot page tables.

  • Property mode set to 100644
File size: 2.5 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 lib/the.c \
20 debug/print.c \
21 debug/symtab.c \
22 time/clock.c \
23 time/timeout.c \
24 time/delay.c \
25 preempt/preemption.c \
26 synch/spinlock.c \
27 synch/condvar.c \
28 synch/rwlock.c \
29 synch/mutex.c \
30 synch/semaphore.c \
31 synch/waitq.c \
32 smp/ipi.c \
33 fb/font-8x16.c
34
35ifdef DEBUG_SPINLOCK
36CFLAGS+=-D$(DEBUG_SPINLOCK)
37endif
38
39ifdef USERSPACE
40CFLAGS+=-D$(USERSPACE)
41endif
42
43ifdef TEST
44test_objects:=$(addsuffix .o,$(basename ../test/$(TEST_DIR)/$(TEST_FILE)))
45CFLAGS+=-D$(TEST)
46endif
47arch_objects:=$(addsuffix .o,$(basename $(arch_sources)))
48objects:=$(addsuffix .o,$(basename $(sources)))
49
50.PHONY : all config depend build clean dist-clean boot
51
52all: dist-clean config depend build
53
54-include Makefile.depend
55
56config:
57 find . ../include -name arch -type l -exec rm \{\} \;
58 ln -s ../arch/$(ARCH)/src arch
59 ln -s ../arch/$(ARCH)/include ../include/arch
60
61depend:
62 $(CC) $(CPPFLAGS) -M $(arch_sources) $(sources) >Makefile.depend
63
64build: kernel.bin boot
65
66clean:
67 find . ../arch/$(ARCH)/src ../test -name '*.o' -exec rm \{\} \;
68 -rm *.bin kernel.map kernel.map.pre kernel.objdump debug/real_map.bin
69 $(MAKE) -C ../arch/$(ARCH)/boot clean
70
71dist-clean:
72 find . ../include -name arch -type l -exec rm \{\} \;
73 -rm Makefile.depend
74 -$(MAKE) clean
75
76debug/real_map.bin: $(arch_objects) $(objects) $(test_objects) ../arch/$(ARCH)/_link.ld
77 $(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab Makefile debug/empty_map.o
78 $(LD) -T ../arch/$(ARCH)/_link.ld $(LFLAGS) $(arch_objects) $(objects) $(test_objects) debug/empty_map.o -o $@ -Map kernel.map.pre
79 $(OBJDUMP) -t $(arch_objects) $(objects) $(test_objects) > kernel.objdump
80 ../tools/genmap.py kernel.map.pre kernel.objdump debug/real_map.bin
81
82debug/real_map.o: debug/real_map.bin
83 $(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab $< $@
84
85
86kernel.bin: $(arch_objects) $(objects) $(test_objects) ../arch/$(ARCH)/_link.ld debug/real_map.o
87 $(LD) -T ../arch/$(ARCH)/_link.ld $(LFLAGS) $(arch_objects) $(objects) $(test_objects) debug/real_map.o -o $@ -Map kernel.map
88
89%.s: %.S
90 $(CC) $(CPPFLAGS) -E $< >$@
91
92%.o: %.s
93 $(AS) $(ASFLAGS) $< -o $@
94
95%.o: %.c
96 $(CC) $(CFLAGS) -c $< -o $@
97
98KS=`cat kernel.bin | wc -c`
99
100boot:
101 $(MAKE) -C ../arch/$(ARCH)/boot build KERNEL_SIZE=$(KS)
Note: See TracBrowser for help on using the repository browser.