source: soft/giet_vm/Makefile @ 296

Last change on this file since 296 was 295, checked in by alain, 10 years ago

Introducing a major release, to suppoort the tsar_generic_leti platform
and the various (external or internal) peripherals configurations.
The map.xml format has been modified, in order to support the new
vci_iopic componentand a new policy for peripherals initialisation.
The IRQs are nom described in the XICU and IOPIC components
(and not anymore in the processors).
To enforce this major change, the map.xml file signature changed:
The signature value must be: 0xDACE2014

This new release has been tested on the tsar_generic_leti platform
for the following mappings:

  • 4c_4p_sort_leti
  • 4c_4p_sort_leti_ext
  • 4c_4p_transpose_leti
  • 4c_4p_transpose_leti_ext
  • 4c_1p_four_leti_ext
File size: 15.9 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
7### FAT parameters definition for Disk image
8### sector_size          = 512
9### partition_begin_lba  = 300
10### sector_per_cluster   = 8
11### partition sectors    = 524832
12
13MAP_XML      = mappings/4c_4p_sort_leti_ext.xml
14
15### Objects to be linked for kernel.elf
16KERNEL_OBJS  = build/common/utils.o       \
17               build/common/vmem.o        \
18               build/fat32/fat32.o        \
19               build/drivers/dma_driver.o \
20               build/drivers/cma_driver.o \
21               build/drivers/fbf_driver.o \
22               build/drivers/xcu_driver.o \
23               build/drivers/icu_driver.o \
24               build/drivers/ioc_driver.o \
25               build/drivers/bdv_driver.o \
26               build/drivers/hba_driver.o \
27               build/drivers/sdc_driver.o \
28               build/drivers/spi_driver.o \
29               build/drivers/rdk_driver.o \
30               build/drivers/iob_driver.o \
31               build/drivers/mmc_driver.o \
32               build/drivers/mwr_driver.o \
33               build/drivers/nic_driver.o \
34               build/drivers/tim_driver.o \
35               build/drivers/tty_driver.o \
36               build/drivers/pic_driver.o \
37               build/kernel/giet.o        \
38               build/kernel/switch.o      \
39               build/kernel/ctx_handler.o \
40               build/kernel/exc_handler.o \
41               build/kernel/sys_handler.o \
42               build/kernel/irq_handler.o \
43               build/kernel/kernel_init.o
44
45### Objects to be linked for boot.elf
46BOOT_OBJS    = build/common/utils.o       \
47               build/common/vmem.o        \
48               build/fat32/fat32.o        \
49               build/drivers/dma_driver.o \
50               build/drivers/tty_driver.o \
51               build/drivers/pic_driver.o \
52               build/drivers/xcu_driver.o \
53               build/drivers/ioc_driver.o \
54               build/drivers/bdv_driver.o \
55               build/drivers/sdc_driver.o \
56               build/drivers/spi_driver.o \
57               build/drivers/rdk_driver.o \
58               build/drivers/mmc_driver.o \
59               build/drivers/mwr_driver.o \
60               build/kernel/ctx_handler.o \
61               build/kernel/switch.o      \
62               build/boot/boot.o
63
64### Objects to be linked for display.elf
65DISPLAY_OBJS = build/display/main.o \
66               build/libs/stdio.o
67
68### Objects to be linked for router.elf
69ROUTER_OBJS  = build/router/main.o        \
70               build/libs/mwmr_channel.o  \
71               build/libs/stdio.o
72
73### Objects to be linked for hello.elf
74HELLO_OBJS   = build/hello/main.o   \
75               build/libs/stdio.o         
76
77### Objects to be linked for pgcd.elf
78PGCD_OBJS    = build/pgcd/main.o          \
79               build/libs/stdio.o
80
81### Objects to be linked for game.elf
82GAMEOFLIFE_OBJS = build/gameoflife/main.o \
83                  build/libs/stdio.o      \
84                  build/libs/barrier.o
85
86### Objects to be linked for dhrystone.elf
87DHRYSTONE_OBJS = build/dhrystone/dhry_1.o \
88                 build/dhrystone/dhry_2.o \
89                 build/libs/stdlib.o      \
90                 build/libs/stdio.o       \
91                 build/libs/string.o      \
92                 build/libs/spin_lock.o   \
93                 build/libs/malloc.o
94
95### Objects to be linked for sort.elf
96SORT_OBJS   = build/sort/main.o        \
97              build/libs/stdio.o       \
98              build/libs/spin_lock.o   \
99              build/libs/barrier.o
100
101### Objects to be linked for transpose.elf
102TRANSPOSE_OBJS = build/transpose/main.o  \
103                 build/libs/stdio.o      \
104                 build/libs/malloc.o     \
105                 build/libs/spin_lock.o  \
106                 build/libs/barrier.o
107
108CFLAGS = -Wall -ffreestanding -mno-gpopt -mips32
109
110
111GIET_INCLUDE = -Igiet_boot    \
112               -Igiet_kernel  \
113               -Igiet_xml     \
114               -Igiet_fat32   \
115               -Igiet_drivers \
116               -Igiet_common  \
117               -Igiet_libs    \
118               -I.
119
120USER_INCLUDE = -Igiet_libs    \
121               -Igiet_xml     \
122               -I.
123
124all: map.bin                         \
125     build/boot/boot.elf             \
126     build/kernel/kernel.elf         \
127     build/display/display.elf       \
128     build/router/router.elf         \
129     build/hello/hello.elf           \
130     build/pgcd/pgcd.elf             \
131     build/dhrystone/dhrystone.elf   \
132     build/gameoflife/gameoflife.elf \
133     build/sort/sort.elf             \
134     build/transpose/transpose.elf   \
135     hdd/virt_hdd.dmg
136
137### Disk image generation
138### This requires the generic LINUX/MacOS script "create_dmg" script
139### written by C.Fuguet. (should be installed in GIET-VM root directory).
140hdd/virt_hdd.dmg: map.bin                \
141         build/boot/boot.elf             \
142         build/kernel/kernel.elf         \
143         build/display/display.elf       \
144         build/hello/hello.elf           \
145         build/pgcd/pgcd.elf             \
146         build/router/router.elf         \
147         build/dhrystone/dhrystone.elf   \
148         build/gameoflife/gameoflife.elf \
149         build/sort/sort.elf             \
150         build/transpose/transpose.elf
151
152### remove all content of virtual disk virt_hdd
153        rm -rf hdd/virt_hdd/*
154### copy content to virtual disk from build, misc and map.bin
155### the boot.elf file is not copied on the virtual disk
156        cp -r build hdd/virt_hdd
157        rm -rf hdd/virt_hdd/build/boot
158        cp -r hdd/misc hdd/virt_hdd
159        cp map.bin  hdd/virt_hdd
160### create temporary partition image (partition_image.dmg)
161        ./create_dmg create hdd/virt_hdd partition_image
162### copy standard MBR into virtual disk image (mbr.dmg)
163        cp hdd/mbr.dmg $@ 
164### copy boot.elf into virtual disk image (sector 2)
165        dd if=build/boot/boot.elf of=$@ seek=2
166### copy partition image into virtual disk image (sector 300)
167        dd if=partition_image.dmg of=$@ seek=300 
168### remove partition image
169        rm partition_image.dmg
170
171### mapping compilation
172map.bin: $(MAP_XML)
173        $(MAKE) -C giet_xml
174        giet_xml/xml2bin $< .
175
176### drivers compilation
177build/drivers/cma_driver.o: giet_drivers/cma_driver.c  \
178                            giet_drivers/cma_driver.h  \
179                            giet_config.h              \
180                            $(MAP_XML)
181        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
182
183build/drivers/dma_driver.o: giet_drivers/dma_driver.c  \
184                            giet_drivers/dma_driver.h  \
185                            giet_config.h              \
186                            $(MAP_XML)
187        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
188
189build/drivers/fbf_driver.o: giet_drivers/fbf_driver.c  \
190                            giet_drivers/fbf_driver.h  \
191                            giet_config.h              \
192                            $(MAP_XML)
193        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
194
195build/drivers/xcu_driver.o: giet_drivers/xcu_driver.c  \
196                            giet_drivers/xcu_driver.h  \
197                            giet_config.h              \
198                            $(MAP_XML)
199        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
200
201build/drivers/icu_driver.o: giet_drivers/icu_driver.c  \
202                            giet_drivers/icu_driver.h  \
203                            giet_config.h              \
204                            $(MAP_XML)
205        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
206
207build/drivers/ioc_driver.o: giet_drivers/ioc_driver.c  \
208                            giet_drivers/ioc_driver.h  \
209                            giet_config.h              \
210                            $(MAP_XML)
211        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
212
213build/drivers/bdv_driver.o: giet_drivers/bdv_driver.c  \
214                            giet_drivers/bdv_driver.h  \
215                            giet_config.h              \
216                            $(MAP_XML)
217        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
218
219build/drivers/hba_driver.o: giet_drivers/hba_driver.c  \
220                            giet_drivers/hba_driver.h  \
221                            giet_config.h              \
222                            $(MAP_XML)
223        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
224
225build/drivers/sdc_driver.o: giet_drivers/sdc_driver.c  \
226                            giet_drivers/sdc_driver.h  \
227                            giet_config.h              \
228                            $(MAP_XML)
229        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
230
231build/drivers/spi_driver.o: giet_drivers/spi_driver.c  \
232                            giet_drivers/spi_driver.h  \
233                            giet_config.h              \
234                            $(MAP_XML)
235        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
236
237build/drivers/rdk_driver.o: giet_drivers/rdk_driver.c  \
238                            giet_drivers/rdk_driver.h  \
239                            giet_config.h              \
240                            $(MAP_XML)
241        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
242
243build/drivers/iob_driver.o: giet_drivers/iob_driver.c  \
244                            giet_drivers/iob_driver.h  \
245                            giet_config.h              \
246                            $(MAP_XML)
247        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
248
249build/drivers/mmc_driver.o: giet_drivers/mmc_driver.c  \
250                            giet_drivers/mmc_driver.h  \
251                            giet_config.h              \
252                            $(MAP_XML)
253        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
254
255build/drivers/mwr_driver.o: giet_drivers/mwr_driver.c  \
256                            giet_drivers/mwr_driver.h  \
257                            giet_config.h              \
258                            $(MAP_XML)
259        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
260
261build/drivers/nic_driver.o: giet_drivers/nic_driver.c  \
262                            giet_drivers/nic_driver.h  \
263                            giet_config.h              \
264                            $(MAP_XML)
265        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
266
267build/drivers/tim_driver.o: giet_drivers/tim_driver.c  \
268                            giet_drivers/tim_driver.h  \
269                            giet_config.h              \
270                            $(MAP_XML)
271        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
272
273build/drivers/tty_driver.o: giet_drivers/tty_driver.c  \
274                            giet_drivers/tty_driver.h  \
275                            giet_config.h              \
276                            $(MAP_XML)
277        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
278
279build/drivers/pic_driver.o: giet_drivers/pic_driver.c  \
280                            giet_drivers/pic_driver.h  \
281                            giet_config.h              \
282                            $(MAP_XML)
283        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
284
285### fat32 compilation
286build/fat32/fat32.o: giet_fat32/fat32.c \
287                     giet_fat32/fat32.h \
288                     giet_config.h      \
289                     $(MAP_XML)
290        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
291
292### utils compilation
293build/common/utils.o: giet_common/utils.c \
294                      giet_common/utils.h \
295                      giet_config.h       \
296                      $(MAP_XML)
297        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
298
299### vmem compilation
300build/common/vmem.o: giet_common/vmem.c \
301                     giet_common/vmem.h \
302                     giet_config.h    \
303                     $(MAP_XML)
304        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
305
306### boot compilation
307build/boot/boot.elf: $(BOOT_OBJS) 
308        $(LD) -o $@ -T giet_boot/boot.ld $(BOOT_OBJS) 
309        $(DU) -D $@ > $@.txt
310
311build/boot/boot.o: giet_boot/boot.c          \
312                   giet_common/utils.h       \
313                   giet_fat32/fat32.h        \
314                   giet_common/vmem.h        \
315                   giet_drivers/tty_driver.h \
316                   giet_drivers/ioc_driver.h \
317                   giet_config.h             \
318                   $(MAP_XML)
319        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
320
321### kernel compilation
322build/kernel/kernel.elf: $(KERNEL_OBJS) giet_kernel/kernel.ld
323        $(LD) -o $@ -T giet_kernel/kernel.ld $(KERNEL_OBJS)
324        $(DU) -D $@ > $@.txt
325
326build/kernel/%.o: giet_kernel/%.c giet_config.h $(MAP_XML)
327        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
328
329build/kernel/%.o: giet_kernel/%.s giet_config.h $(MAP_XML)
330        $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $<
331
332
333
334
335### libs compilation
336build/libs/stdio.o: giet_libs/stdio.c \
337                    giet_libs/stdio.h \
338                    giet_config.h 
339        $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $<
340
341build/libs/mwmr_channel.o: giet_libs/mwmr_channel.c \
342                           giet_libs/mwmr_channel.h \
343                           giet_config.h
344        $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $<
345
346build/libs/malloc.o: giet_libs/malloc.c         \
347                     giet_libs/malloc.h         \
348                     giet_libs/malloc_private.h \
349                     giet_config.h
350        $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $<
351
352build/libs/barrier.o: giet_libs/barrier.c \
353                      giet_libs/barrier.h \
354                      giet_config.h
355        $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $<
356
357build/libs/stdlib.o: giet_libs/stdlib.c \
358                     giet_libs/stdlib.h \
359                     giet_config.h
360        $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $<
361
362build/libs/string.o: giet_libs/string.c \
363                     giet_libs/string.h \
364                     giet_config.h
365        $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $<
366
367build/libs/spin_lock.o: giet_libs/spin_lock.c \
368                        giet_libs/spin_lock.h \
369                        giet_config.h
370        $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $<
371
372
373
374
375### display compilation
376build/display/display.elf: $(DISPLAY_OBJS) display/display.ld
377        $(LD) -o $@ -T display/display.ld $(DISPLAY_OBJS)
378        $(DU) -D $@ > $@.txt
379
380build/display/main.o: display/main_cma.c
381        $(CC) $(USER_INCLUDE) $(CFLAGS)  -c -o $@ $<
382
383### router compilation
384build/router/router.elf: $(ROUTER_OBJS) router/router.ld
385        $(LD) -o $@ -T router/router.ld $(ROUTER_OBJS)
386        $(DU) -D $@ > $@.txt
387
388build/router/main.o: router/main.c
389        $(CC) $(USER_INCLUDE) $(CFLAGS)  -c -o $@ $<
390
391### hello compilation
392build/hello/hello.elf: $(HELLO_OBJS) hello/hello.ld
393        $(LD) -o $@ -T hello/hello.ld $(HELLO_OBJS)
394        $(DU) -D $@ > $@.txt
395
396build/hello/main.o: hello/main.c
397        $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $<
398
399### pgcd compilation
400build/pgcd/pgcd.elf: $(PGCD_OBJS) pgcd/pgcd.ld
401        $(LD) -o $@ -T pgcd/pgcd.ld $(PGCD_OBJS)
402        $(DU) -D $@ > $@.txt
403
404build/pgcd/main.o: pgcd/main.c
405        $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $<
406
407### gameoflife compilation
408build/gameoflife/gameoflife.elf: $(GAMEOFLIFE_OBJS) gameoflife/gameoflife.ld
409        $(LD) -o $@ -T gameoflife/gameoflife.ld $(GAMEOFLIFE_OBJS)
410        $(DU) -D $@ > $@.txt
411
412build/gameoflife/main.o: gameoflife/main.c
413        $(CC) $(USER_INCLUDE) $(CFLAGS) -O3 -c -o $@ $<
414
415### dhrystone compilation
416build/dhrystone/dhrystone.elf: $(DHRYSTONE_OBJS) dhrystone/dhrystone.ld
417        $(LD) -o $@ -T dhrystone/dhrystone.ld $(DHRYSTONE_OBJS)
418        $(DU) -D $@ > $@.txt
419
420build/dhrystone/dhry_1.o: dhrystone/dhry_1.c
421        $(CC) $(USER_INCLUDE) $(CFLAGS)  -c -o $@ $<
422
423build/dhrystone/dhry_2.o: dhrystone/dhry_2.c
424        $(CC) $(USER_INCLUDE) $(CFLAGS)  -c -o $@ $<
425
426### sort compilation
427build/sort/sort.elf: $(SORT_OBJS) sort/sort.ld
428        $(LD) -o $@ -T sort/sort.ld $(SORT_OBJS)
429        $(DU) -D $@ > $@.txt
430
431build/sort/main.o: sort/main.c
432        $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $<
433
434### transpose compilation
435build/transpose/transpose.elf: $(TRANSPOSE_OBJS) transpose/transpose.ld
436        $(LD) -o $@ -T transpose/transpose.ld $(TRANSPOSE_OBJS)
437        $(DU) -D $@ > $@.txt
438
439build/transpose/main.o: transpose/main.c
440        $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $<
441
442### clean
443clean:
444        rm -f *.o *.elf *.bin *.txt core  giet_vsegs.ld hard_config.h map.bin*~
445        $(MAKE) -s clean -C giet_xml
446        rm -rf build/boot/*
447        rm -rf build/fat32/*
448        rm -rf build/common/*
449        rm -rf build/drivers/*
450        rm -rf build/kernel/*
451        rm -rf build/reset/*
452        rm -rf build/libs/*
453        rm -rf build/pgcd/*
454        rm -rf build/hello/*
455        rm -rf build/display/*
456        rm -rf build/router/*
457        rm -rf build/gameoflife/*
458        rm -rf build/dhrystone/*
459        rm -rf build/sort/*
460        rm -rf build/transpose/*
461        rm -rf build/map.bin
462        rm -rf hdd/virt_hdd/*
463        rm -rf hdd/virt_hdd.dmg
Note: See TracBrowser for help on using the repository browser.