source: soft/giet_vm/Makefile @ 203

Last change on this file since 203 was 203, checked in by alain, 12 years ago

Introducing support for XICU

File size: 3.7 KB
Line 
1export # export all variable to sub-Makefile
2CC=mipsel-unknown-elf-gcc
3AS=mipsel-unknown-elf-as
4LD=mipsel-unknown-elf-ld
5DU=mipsel-unknown-elf-objdump
6
7SYS_OBJS     = build/sys/vm_handler.o \
8                       build/sys/sys_handler.o \
9               build/sys/giet.o \
10               build/sys/switch.o \
11               build/sys/common.o \
12               build/sys/ctx_handler.o \
13               build/sys/drivers.o \
14               build/sys/exc_handler.o \
15               build/sys/irq_handler.o \
16               build/sys/kernel_init.o
17
18BOOT_OBJS    = build/boot/reset.o \
19               build/boot/boot_init.o
20
21DISPLAY_OBJS = build/display/main.o \
22               build/libs/stdio.o \
23               build/libs/utils.o
24
25ROUTER_OBJS  = build/router/main.o \
26               build/libs/mwmr_channel.o \
27               build/libs/stdio.o \
28               build/libs/utils.o
29
30HELLO_OBJS   = build/hello/main.o \
31               build/libs/stdio.o \
32               build/libs/utils.o
33
34PGCD_OBJS    = build/pgcd/main.o \
35               build/libs/stdio.o \
36               build/libs/utils.o
37
38CFLAGS=-Wall -ffreestanding -mno-gpopt -mips32 -g
39
40INCLUDE = -Iboot -Isys -Ixml -Ilibs -I.
41
42TRASH= /dev/null||true
43
44all: soft.elf
45       
46## merge all *.elf and map.bin to soft.elf
47soft.elf: build/boot/boot.elf \
48          build/sys/sys.elf \
49          build/display/display.elf \
50          build/router/router.elf \
51          build/pgcd/pgcd.elf \
52          build/hello/hello.elf \
53          map.bin
54        $(MAKE) -C memo
55        memo/memo.x  map.bin
56        $(DU) -D $@ > build$@.txt
57
58### mapping compilation
59map.bin: 1c_4p_four.xml
60        $(MAKE) -C xml
61        xml/xml2bin $< $@
62
63### system compilation
64build/sys/sys.elf: $(SYS_OBJS) sys/sys.ld
65        $(LD) -o $@ -T sys/sys.ld $(SYS_OBJS)
66        $(DU) -D $@ > $@.txt
67
68build/sys/%.o: sys/%.c giet_config.h
69        $(CC) $(INCLUDE) $(CFLAGS)  -c -o $@ $<
70
71build/sys/%.o: sys/%.s giet_config.h
72        $(CC) $(INCLUDE) $(CFLAGS)  -c -o $@ $<
73
74### boot compilation
75build/boot/boot.elf: $(BOOT_OBJS) boot/boot.ld
76        $(LD) -o $@ -T boot/boot.ld $(BOOT_OBJS)
77        $(DU) -D $@ > $@.txt
78
79build/boot/%.o: boot/%.c giet_config.h
80        $(CC) $(INCLUDE) $(CFLAGS)  -c -o $@ $<
81
82build/boot/%.o: boot/%.S giet_config.h
83        $(CC) $(INCLUDE) $(CFLAGS)  -c -o $@ $<
84
85### display compilation
86build/display/display.elf: $(DISPLAY_OBJS) display/display.ld
87        $(LD) -o $@ -T display/display.ld $(DISPLAY_OBJS)
88        $(DU) -D $@ > $@.txt
89
90build/display/main.o: display/main.c
91        $(CC) $(INCLUDE) $(CFLAGS)  -c -o $@ $<
92
93### router compilation
94build/router/router.elf: $(ROUTER_OBJS) router/router.ld
95        $(LD) -o $@ -T router/router.ld $(ROUTER_OBJS)
96        $(DU) -D $@ > $@.txt
97
98build/router/main.o: router/main.c
99        $(CC) $(INCLUDE) $(CFLAGS)  -c -o $@ $<
100
101### hello compilation
102build/hello/hello.elf: $(HELLO_OBJS) hello/hello.ld
103        $(LD) -o $@ -T hello/hello.ld $(HELLO_OBJS)
104        $(DU) -D $@ > $@.txt
105
106build/hello/main.o: hello/main.c
107        $(CC) $(INCLUDE) $(CFLAGS)  -c -o $@ $<
108
109### pgcd compilation
110build/pgcd/pgcd.elf: $(PGCD_OBJS) pgcd/pgcd.ld
111        $(LD) -o $@ -T pgcd/pgcd.ld $(PGCD_OBJS)
112        $(DU) -D $@ > $@.txt
113
114build/pgcd/main.o: pgcd/main.c
115        $(CC) $(INCLUDE) $(CFLAGS)  -c -o $@ $<
116
117### libs compilation
118build/libs/utils.o: libs/utils.c giet_config.h
119        $(CC) $(CFLAGS) $(INCLUDE)  -c -o $@ $<
120
121build/libs/stdio.o: libs/stdio.c giet_config.h 
122        $(CC) $(CFLAGS) $(INCLUDE)  -c -o $@ $<
123
124build/libs/mwmr_channel.o: libs/mwmr_channel.c
125        $(CC) $(CFLAGS) $(INCLUDE)  -c -o $@ $<
126
127
128### clean
129clean:
130        rm -f *.o *.elf *.bin *.txt core *~     2>$(TRASH)
131        $(MAKE) -s clean -C xml 2>$(TRASH)
132        $(MAKE) -s clean -C memo 2>$(TRASH)
133        rm -r build/boot/* 2>$(TRASH)
134        rm -r build/sys/* 2>$(TRASH)
135        rm -r build/libs/* 2>$(TRASH)
136        rm -r build/pgcd/* 2>$(TRASH)
137        rm -r build/hello/* 2>$(TRASH)
138        rm -r build/display/* 2>$(TRASH)
139        rm -r build/router/* 2>$(TRASH)
Note: See TracBrowser for help on using the repository browser.