1 | -include build.mk |
---|
2 | |
---|
3 | export # export all variable to sub-Makefile |
---|
4 | CC = mipsel-unknown-elf-gcc |
---|
5 | AS = mipsel-unknown-elf-as |
---|
6 | LD = mipsel-unknown-elf-ld |
---|
7 | DU = mipsel-unknown-elf-objdump |
---|
8 | AR = mipsel-unknown-elf-ar |
---|
9 | |
---|
10 | # Parameters definition |
---|
11 | ARCH ?= ../tsar-trunk-svn-2013/platforms/tsar_generic_iob |
---|
12 | X_SIZE ?= 1 |
---|
13 | Y_SIZE ?= 1 |
---|
14 | NB_PROCS ?= 4 |
---|
15 | NB_TTYS ?= 1 |
---|
16 | FBF_WIDTH ?= 128 |
---|
17 | APP ?= classif |
---|
18 | |
---|
19 | .PHONY: map.bin |
---|
20 | |
---|
21 | ### FAT parameters definition for Disk image |
---|
22 | ### sector_size = 512 |
---|
23 | ### partition_begin_lba = 300 |
---|
24 | ### sector_per_cluster = 8 |
---|
25 | ### partition sectors = 524832 |
---|
26 | |
---|
27 | ### Objects to be linked for the drivers library |
---|
28 | DRIVERS_OBJS = build/drivers/dma_driver.o \ |
---|
29 | build/drivers/cma_driver.o \ |
---|
30 | build/drivers/xcu_driver.o \ |
---|
31 | build/drivers/ioc_driver.o \ |
---|
32 | build/drivers/bdv_driver.o \ |
---|
33 | build/drivers/hba_driver.o \ |
---|
34 | build/drivers/sdc_driver.o \ |
---|
35 | build/drivers/spi_driver.o \ |
---|
36 | build/drivers/rdk_driver.o \ |
---|
37 | build/drivers/iob_driver.o \ |
---|
38 | build/drivers/mmc_driver.o \ |
---|
39 | build/drivers/mwr_driver.o \ |
---|
40 | build/drivers/nic_driver.o \ |
---|
41 | build/drivers/tim_driver.o \ |
---|
42 | build/drivers/tty_driver.o \ |
---|
43 | build/drivers/pic_driver.o |
---|
44 | |
---|
45 | ### Objects to be linked for kernel.elf |
---|
46 | KERNEL_OBJS = build/common/utils.o \ |
---|
47 | build/common/locks.o \ |
---|
48 | build/common/tty0.o \ |
---|
49 | build/common/vmem.o \ |
---|
50 | build/fat32/fat32.o \ |
---|
51 | build/kernel/giet.o \ |
---|
52 | build/kernel/switch.o \ |
---|
53 | build/kernel/ctx_handler.o \ |
---|
54 | build/kernel/exc_handler.o \ |
---|
55 | build/kernel/sys_handler.o \ |
---|
56 | build/kernel/irq_handler.o \ |
---|
57 | build/kernel/kernel_init.o |
---|
58 | |
---|
59 | ### Objects to be linked for boot.elf |
---|
60 | BOOT_OBJS = build/common/utils.o \ |
---|
61 | build/common/locks.o \ |
---|
62 | build/common/tty0.o \ |
---|
63 | build/common/pmem.o \ |
---|
64 | build/common/vmem.o \ |
---|
65 | build/fat32/fat32.o \ |
---|
66 | build/kernel/ctx_handler.o \ |
---|
67 | build/kernel/switch.o \ |
---|
68 | build/boot/boot.o \ |
---|
69 | build/boot/boot_entry.o |
---|
70 | |
---|
71 | ### Objects to be linked for display.elf |
---|
72 | DISPLAY_OBJS = build/display/main.o \ |
---|
73 | build/libs/stdio.o |
---|
74 | |
---|
75 | ### Objects to be linked for router.elf |
---|
76 | ROUTER_OBJS = build/router/main.o \ |
---|
77 | build/libs/mwmr_channel.o \ |
---|
78 | build/libs/user_lock.o \ |
---|
79 | build/libs/stdio.o |
---|
80 | |
---|
81 | ### Objects to be linked for hello.elf |
---|
82 | HELLO_OBJS = build/hello/main.o \ |
---|
83 | build/libs/stdio.o |
---|
84 | |
---|
85 | ### Objects to be linked for pgcd.elf |
---|
86 | PGCD_OBJS = build/pgcd/main.o \ |
---|
87 | build/libs/stdio.o |
---|
88 | |
---|
89 | ### Objects to be linked for game.elf |
---|
90 | GAMEOFLIFE_OBJS = build/gameoflife/main.o \ |
---|
91 | build/libs/stdio.o \ |
---|
92 | build/libs/barrier.o \ |
---|
93 | build/libs/malloc.o \ |
---|
94 | build/libs/user_lock.o |
---|
95 | |
---|
96 | |
---|
97 | ### Objects to be linked for dhrystone.elf |
---|
98 | DHRYSTONE_OBJS = build/dhrystone/dhry_1.o \ |
---|
99 | build/dhrystone/dhry_2.o \ |
---|
100 | build/libs/stdlib.o \ |
---|
101 | build/libs/stdio.o \ |
---|
102 | build/libs/string.o \ |
---|
103 | build/libs/user_lock.o \ |
---|
104 | build/libs/malloc.o |
---|
105 | |
---|
106 | ### Objects to be linked for sort.elf |
---|
107 | SORT_OBJS = build/sort/main.o \ |
---|
108 | build/libs/stdio.o \ |
---|
109 | build/libs/barrier.o \ |
---|
110 | build/libs/malloc.o \ |
---|
111 | build/libs/user_lock.o |
---|
112 | |
---|
113 | ### Objects to be linked for transpose.elf |
---|
114 | TRANSPOSE_OBJS = build/transpose/main.o \ |
---|
115 | build/libs/stdio.o \ |
---|
116 | build/libs/barrier.o \ |
---|
117 | build/libs/malloc.o \ |
---|
118 | build/libs/user_lock.o |
---|
119 | |
---|
120 | ### Objects to be linked for convol.elf |
---|
121 | CONVOL_OBJS = build/convol/main.o \ |
---|
122 | build/libs/stdio.o \ |
---|
123 | build/libs/stdlib.o \ |
---|
124 | build/libs/barrier.o \ |
---|
125 | build/libs/malloc.o \ |
---|
126 | build/libs/user_lock.o |
---|
127 | |
---|
128 | ### Objects to be linked for classif.elf |
---|
129 | CLASSIF_OBJS = build/classif/main.o \ |
---|
130 | build/libs/stdio.o \ |
---|
131 | build/libs/mwmr_channel.o \ |
---|
132 | build/libs/barrier.o \ |
---|
133 | build/libs/malloc.o \ |
---|
134 | build/libs/user_lock.o |
---|
135 | |
---|
136 | CFLAGS = -Wall -ffreestanding -mno-gpopt -mips32 -g -O2 \ |
---|
137 | -fno-delete-null-pointer-checks |
---|
138 | |
---|
139 | GIET_INCLUDE = -Igiet_boot \ |
---|
140 | -Igiet_kernel \ |
---|
141 | -Igiet_xml \ |
---|
142 | -Igiet_fat32 \ |
---|
143 | -Igiet_drivers \ |
---|
144 | -Igiet_common \ |
---|
145 | -Igiet_libs \ |
---|
146 | -I. |
---|
147 | |
---|
148 | USER_INCLUDE = -Igiet_libs \ |
---|
149 | -Igiet_xml \ |
---|
150 | -I. |
---|
151 | |
---|
152 | DISK_IMAGE := hdd/virt_hdd.dmg |
---|
153 | |
---|
154 | all: map.bin \ |
---|
155 | hard_config.h \ |
---|
156 | giet_vsegs.ld \ |
---|
157 | build/boot/boot.elf \ |
---|
158 | build/kernel/kernel.elf \ |
---|
159 | build/display/display.elf \ |
---|
160 | build/hello/hello.elf \ |
---|
161 | build/pgcd/pgcd.elf \ |
---|
162 | build/router/router.elf \ |
---|
163 | build/dhrystone/dhrystone.elf \ |
---|
164 | build/gameoflife/gameoflife.elf \ |
---|
165 | build/sort/sort.elf \ |
---|
166 | build/transpose/transpose.elf \ |
---|
167 | build/convol/convol.elf \ |
---|
168 | build/router/router.elf \ |
---|
169 | build/classif/classif.elf \ |
---|
170 | $(DISK_IMAGE) |
---|
171 | |
---|
172 | ### Copy always all files into disk image |
---|
173 | mcopy -o -i $(DISK_IMAGE) build/kernel/kernel.elf ::/build/kernel |
---|
174 | mcopy -o -i $(DISK_IMAGE) build/display/display.elf ::/build/display |
---|
175 | mcopy -o -i $(DISK_IMAGE) build/sort/sort.elf ::/build/sort |
---|
176 | mcopy -o -i $(DISK_IMAGE) build/transpose/transpose.elf ::/build/transpose |
---|
177 | mcopy -o -i $(DISK_IMAGE) build/convol/convol.elf ::/build/convol |
---|
178 | mcopy -o -i $(DISK_IMAGE) build/classif/classif.elf ::/build/classif |
---|
179 | mcopy -o -i $(DISK_IMAGE) build/hello/hello.elf ::/build/hello |
---|
180 | mcopy -o -i $(DISK_IMAGE) build/pgcd/pgcd.elf ::/build/pgcd |
---|
181 | mcopy -o -i $(DISK_IMAGE) build/router/router.elf ::/build/router |
---|
182 | mcopy -o -i $(DISK_IMAGE) build/gameoflife/gameoflife.elf ::/build/gameoflife |
---|
183 | mcopy -o -i $(DISK_IMAGE) build/dhrystone/dhrystone.elf ::/build/dhrystone |
---|
184 | mcopy -o -i $(DISK_IMAGE) applications/transpose/images.raw ::/misc |
---|
185 | mcopy -o -i $(DISK_IMAGE) applications/convol/philips_image.raw ::/misc |
---|
186 | mcopy -o -i $(DISK_IMAGE) map.bin ::/ |
---|
187 | ### Copy bootloader into sector 2 of disk image |
---|
188 | dd if=build/boot/boot.elf of=$(DISK_IMAGE) seek=2 conv=notrunc |
---|
189 | ### Checking root directory |
---|
190 | mdir -/ -b -i $(DISK_IMAGE) ::/ |
---|
191 | |
---|
192 | ### Disk image generation (no files in this step) |
---|
193 | ### This requires the generic LINUX/MacOS script "create_dmg" script |
---|
194 | ### written by C.Fuguet. (should be installed in GIET-VM root directory). |
---|
195 | $(DISK_IMAGE): |
---|
196 | ./create_dmg create $(basename $(DISK_IMAGE)) |
---|
197 | mmd -o -i $(DISK_IMAGE) ::/build |
---|
198 | mmd -o -i $(DISK_IMAGE) ::/build/kernel |
---|
199 | mmd -o -i $(DISK_IMAGE) ::/build/display |
---|
200 | mmd -o -i $(DISK_IMAGE) ::/build/sort |
---|
201 | mmd -o -i $(DISK_IMAGE) ::/build/transpose |
---|
202 | mmd -o -i $(DISK_IMAGE) ::/build/convol |
---|
203 | mmd -o -i $(DISK_IMAGE) ::/build/classif |
---|
204 | mmd -o -i $(DISK_IMAGE) ::/build/hello |
---|
205 | mmd -o -i $(DISK_IMAGE) ::/build/pgcd |
---|
206 | mmd -o -i $(DISK_IMAGE) ::/build/router |
---|
207 | mmd -o -i $(DISK_IMAGE) ::/build/gameoflife |
---|
208 | mmd -o -i $(DISK_IMAGE) ::/build/dhrystone |
---|
209 | mmd -o -i $(DISK_IMAGE) ::/misc |
---|
210 | dd if=$(DISK_IMAGE) of=temp.dmg count=65536 |
---|
211 | mv temp.dmg $(DISK_IMAGE) |
---|
212 | |
---|
213 | ### mapping generation: map.bin / map.xml / hard_config.h / giet_vsegs.ld |
---|
214 | map.bin hard_config.h giet_vsegs.ld: $(ARCH)/arch.py applications/$(APP)/$(APP).py |
---|
215 | giet_python/genmap --arch=$(ARCH) \ |
---|
216 | --x=$(X_SIZE) \ |
---|
217 | --y=$(Y_SIZE) \ |
---|
218 | --p=$(NB_PROCS) \ |
---|
219 | --tty=$(NB_TTYS) \ |
---|
220 | --fbf=$(FBF_WIDTH) \ |
---|
221 | --giet=. \ |
---|
222 | --$(APP) \ |
---|
223 | --xml=. |
---|
224 | |
---|
225 | ### drivers compilation |
---|
226 | build/drivers/cma_driver.o: giet_drivers/cma_driver.c \ |
---|
227 | giet_drivers/cma_driver.h \ |
---|
228 | hard_config.h \ |
---|
229 | giet_config.h |
---|
230 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
231 | |
---|
232 | build/drivers/dma_driver.o: giet_drivers/dma_driver.c \ |
---|
233 | giet_drivers/dma_driver.h \ |
---|
234 | hard_config.h \ |
---|
235 | giet_config.h |
---|
236 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
237 | |
---|
238 | build/drivers/xcu_driver.o: giet_drivers/xcu_driver.c \ |
---|
239 | giet_drivers/xcu_driver.h \ |
---|
240 | hard_config.h \ |
---|
241 | giet_config.h |
---|
242 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
243 | |
---|
244 | build/drivers/ioc_driver.o: giet_drivers/ioc_driver.c \ |
---|
245 | giet_drivers/ioc_driver.h \ |
---|
246 | hard_config.h \ |
---|
247 | giet_config.h |
---|
248 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
249 | |
---|
250 | build/drivers/bdv_driver.o: giet_drivers/bdv_driver.c \ |
---|
251 | giet_drivers/bdv_driver.h \ |
---|
252 | hard_config.h \ |
---|
253 | giet_config.h |
---|
254 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
255 | |
---|
256 | build/drivers/hba_driver.o: giet_drivers/hba_driver.c \ |
---|
257 | giet_drivers/hba_driver.h \ |
---|
258 | hard_config.h \ |
---|
259 | giet_config.h |
---|
260 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
261 | |
---|
262 | build/drivers/sdc_driver.o: giet_drivers/sdc_driver.c \ |
---|
263 | giet_drivers/sdc_driver.h \ |
---|
264 | hard_config.h \ |
---|
265 | giet_config.h |
---|
266 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
267 | |
---|
268 | build/drivers/spi_driver.o: giet_drivers/spi_driver.c \ |
---|
269 | giet_drivers/spi_driver.h \ |
---|
270 | hard_config.h \ |
---|
271 | giet_config.h |
---|
272 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
273 | |
---|
274 | build/drivers/rdk_driver.o: giet_drivers/rdk_driver.c \ |
---|
275 | giet_drivers/rdk_driver.h \ |
---|
276 | hard_config.h \ |
---|
277 | giet_config.h |
---|
278 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
279 | |
---|
280 | build/drivers/iob_driver.o: giet_drivers/iob_driver.c \ |
---|
281 | giet_drivers/iob_driver.h \ |
---|
282 | hard_config.h \ |
---|
283 | giet_config.h |
---|
284 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
285 | |
---|
286 | build/drivers/mmc_driver.o: giet_drivers/mmc_driver.c \ |
---|
287 | giet_drivers/mmc_driver.h \ |
---|
288 | hard_config.h \ |
---|
289 | giet_config.h |
---|
290 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
291 | |
---|
292 | build/drivers/mwr_driver.o: giet_drivers/mwr_driver.c \ |
---|
293 | giet_drivers/mwr_driver.h \ |
---|
294 | hard_config.h \ |
---|
295 | giet_config.h |
---|
296 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
297 | |
---|
298 | build/drivers/nic_driver.o: giet_drivers/nic_driver.c \ |
---|
299 | giet_drivers/nic_driver.h \ |
---|
300 | hard_config.h \ |
---|
301 | giet_config.h |
---|
302 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
303 | |
---|
304 | build/drivers/tim_driver.o: giet_drivers/tim_driver.c \ |
---|
305 | giet_drivers/tim_driver.h \ |
---|
306 | hard_config.h \ |
---|
307 | giet_config.h |
---|
308 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
309 | |
---|
310 | build/drivers/tty_driver.o: giet_drivers/tty_driver.c \ |
---|
311 | giet_drivers/tty_driver.h \ |
---|
312 | hard_config.h \ |
---|
313 | giet_config.h |
---|
314 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
315 | |
---|
316 | build/drivers/pic_driver.o: giet_drivers/pic_driver.c \ |
---|
317 | giet_drivers/pic_driver.h \ |
---|
318 | hard_config.h \ |
---|
319 | giet_config.h |
---|
320 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
321 | |
---|
322 | ################################ |
---|
323 | ### drivers library compilation |
---|
324 | build/drivers/libdrivers.a: $(DRIVERS_OBJS) |
---|
325 | $(AR) -rcs $@ $(DRIVERS_OBJS) |
---|
326 | |
---|
327 | ########################## |
---|
328 | ### common compilation |
---|
329 | build/fat32/fat32.o: giet_fat32/fat32.c \ |
---|
330 | giet_fat32/fat32.h \ |
---|
331 | hard_config.h \ |
---|
332 | giet_config.h |
---|
333 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
334 | |
---|
335 | build/common/utils.o: giet_common/utils.c \ |
---|
336 | giet_common/utils.h \ |
---|
337 | hard_config.h \ |
---|
338 | giet_config.h |
---|
339 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
340 | |
---|
341 | build/common/locks.o: giet_common/locks.c \ |
---|
342 | giet_common/locks.h \ |
---|
343 | hard_config.h \ |
---|
344 | giet_config.h |
---|
345 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
346 | |
---|
347 | build/common/tty0.o: giet_common/tty0.c \ |
---|
348 | giet_common/tty0.h \ |
---|
349 | hard_config.h \ |
---|
350 | giet_config.h |
---|
351 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
352 | |
---|
353 | build/common/vmem.o: giet_common/vmem.c \ |
---|
354 | giet_common/vmem.h \ |
---|
355 | hard_config.h \ |
---|
356 | giet_config.h |
---|
357 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
358 | |
---|
359 | build/common/pmem.o: giet_common/pmem.c \ |
---|
360 | giet_common/pmem.h \ |
---|
361 | hard_config.h \ |
---|
362 | giet_config.h |
---|
363 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
364 | |
---|
365 | ######################## |
---|
366 | ### boot compilation |
---|
367 | build/boot/boot.elf: $(BOOT_OBJS) \ |
---|
368 | giet_boot/boot.ld \ |
---|
369 | build/drivers/libdrivers.a |
---|
370 | $(LD) -o $@ -T giet_boot/boot.ld $(BOOT_OBJS) -Lbuild/drivers -ldrivers |
---|
371 | $(DU) -D $@ > $@.txt |
---|
372 | |
---|
373 | build/boot/boot.o: giet_boot/boot.c \ |
---|
374 | giet_common/utils.h \ |
---|
375 | giet_fat32/fat32.h \ |
---|
376 | giet_common/vmem.h \ |
---|
377 | giet_drivers/tty_driver.h \ |
---|
378 | giet_drivers/ioc_driver.h \ |
---|
379 | hard_config.h \ |
---|
380 | giet_config.h |
---|
381 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
382 | |
---|
383 | build/boot/boot_entry.o: giet_boot/boot_entry.S \ |
---|
384 | hard_config.h |
---|
385 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
386 | |
---|
387 | ######################### |
---|
388 | ### kernel compilation |
---|
389 | build/kernel/kernel.elf: $(KERNEL_OBJS) \ |
---|
390 | giet_kernel/kernel.ld \ |
---|
391 | build/drivers/libdrivers.a |
---|
392 | $(LD) -o $@ -T giet_kernel/kernel.ld $(KERNEL_OBJS) -Lbuild/drivers -ldrivers |
---|
393 | $(DU) -D $@ > $@.txt |
---|
394 | |
---|
395 | build/kernel/%.o: giet_kernel/%.c \ |
---|
396 | hard_config.h \ |
---|
397 | giet_config.h |
---|
398 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
399 | |
---|
400 | build/kernel/%.o: giet_kernel/%.s \ |
---|
401 | hard_config.h \ |
---|
402 | giet_config.h |
---|
403 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
404 | |
---|
405 | ########################### |
---|
406 | ### user libs compilation |
---|
407 | build/libs/stdio.o: giet_libs/stdio.c \ |
---|
408 | giet_libs/stdio.h \ |
---|
409 | hard_config.h \ |
---|
410 | giet_config.h |
---|
411 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
412 | |
---|
413 | build/libs/mwmr_channel.o: giet_libs/mwmr_channel.c \ |
---|
414 | giet_libs/mwmr_channel.h \ |
---|
415 | hard_config.h \ |
---|
416 | giet_config.h |
---|
417 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
418 | |
---|
419 | build/libs/malloc.o: giet_libs/malloc.c \ |
---|
420 | giet_libs/malloc.h \ |
---|
421 | hard_config.h \ |
---|
422 | giet_config.h |
---|
423 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
424 | |
---|
425 | build/libs/barrier.o: giet_libs/barrier.c \ |
---|
426 | giet_libs/barrier.h \ |
---|
427 | hard_config.h \ |
---|
428 | giet_config.h |
---|
429 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
430 | |
---|
431 | build/libs/stdlib.o: giet_libs/stdlib.c \ |
---|
432 | giet_libs/stdlib.h \ |
---|
433 | hard_config.h \ |
---|
434 | giet_config.h |
---|
435 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
436 | |
---|
437 | build/libs/string.o: giet_libs/string.c \ |
---|
438 | giet_libs/string.h \ |
---|
439 | hard_config.h \ |
---|
440 | giet_config.h |
---|
441 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
442 | |
---|
443 | build/libs/user_lock.o: giet_libs/user_lock.c \ |
---|
444 | giet_libs/user_lock.h \ |
---|
445 | hard_config.h \ |
---|
446 | giet_config.h |
---|
447 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
448 | |
---|
449 | build/libs/sbt_barrier.o: giet_libs/sbt_barrier.c \ |
---|
450 | hard_config.h \ |
---|
451 | giet_config.h |
---|
452 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
453 | |
---|
454 | ######################################## |
---|
455 | ### display application compilation |
---|
456 | build/display/display.elf: $(DISPLAY_OBJS) applications/display/display.ld hard_config.h |
---|
457 | $(LD) -o $@ -T applications/display/display.ld $(DISPLAY_OBJS) |
---|
458 | $(DU) -D $@ > $@.txt |
---|
459 | |
---|
460 | build/display/main.o: applications/display/main.c |
---|
461 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
462 | |
---|
463 | ######################################## |
---|
464 | ### router compilation |
---|
465 | build/router/router.elf: $(ROUTER_OBJS) applications/router/router.ld hard_config.h |
---|
466 | $(LD) -o $@ -T applications/router/router.ld $(ROUTER_OBJS) |
---|
467 | $(DU) -D $@ > $@.txt |
---|
468 | |
---|
469 | build/router/main.o: applications/router/main.c |
---|
470 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
471 | |
---|
472 | ######################################## |
---|
473 | ### hello compilation |
---|
474 | build/hello/hello.elf: $(HELLO_OBJS) applications/hello/hello.ld hard_config.h |
---|
475 | $(LD) -o $@ -T applications/hello/hello.ld $(HELLO_OBJS) |
---|
476 | $(DU) -D $@ > $@.txt |
---|
477 | |
---|
478 | build/hello/main.o: applications/hello/main.c |
---|
479 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
480 | |
---|
481 | ######################################## |
---|
482 | ### pgcd compilation |
---|
483 | build/pgcd/pgcd.elf: $(PGCD_OBJS) applications/pgcd/pgcd.ld hard_config.h |
---|
484 | $(LD) -o $@ -T applications/pgcd/pgcd.ld $(PGCD_OBJS) |
---|
485 | $(DU) -D $@ > $@.txt |
---|
486 | |
---|
487 | build/pgcd/main.o: applications/pgcd/main.c |
---|
488 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
489 | |
---|
490 | ######################################## |
---|
491 | ### gameoflife compilation |
---|
492 | build/gameoflife/gameoflife.elf: $(GAMEOFLIFE_OBJS) applications/gameoflife/gameoflife.ld |
---|
493 | $(LD) -o $@ -T applications/gameoflife/gameoflife.ld $(GAMEOFLIFE_OBJS) |
---|
494 | $(DU) -D $@ > $@.txt |
---|
495 | |
---|
496 | build/gameoflife/main.o: applications/gameoflife/main.c |
---|
497 | $(CC) $(USER_INCLUDE) $(CFLAGS) -O3 -c -o $@ $< |
---|
498 | |
---|
499 | ######################################## |
---|
500 | ### dhrystone compilation |
---|
501 | build/dhrystone/dhrystone.elf: $(DHRYSTONE_OBJS) applications/dhrystone/dhrystone.ld hard_config.h |
---|
502 | $(LD) -o $@ -T applications/dhrystone/dhrystone.ld $(DHRYSTONE_OBJS) |
---|
503 | $(DU) -D $@ > $@.txt |
---|
504 | |
---|
505 | build/dhrystone/dhry_1.o: applications/dhrystone/dhry_1.c |
---|
506 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
507 | |
---|
508 | build/dhrystone/dhry_2.o: applications/dhrystone/dhry_2.c |
---|
509 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
510 | |
---|
511 | ######################################## |
---|
512 | ### sort compilation |
---|
513 | build/sort/sort.elf: $(SORT_OBJS) applications/sort/sort.ld hard_config.h |
---|
514 | $(LD) -o $@ -T applications/sort/sort.ld $(SORT_OBJS) |
---|
515 | $(DU) -D $@ > $@.txt |
---|
516 | |
---|
517 | build/sort/main.o: applications/sort/main.c |
---|
518 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
519 | |
---|
520 | ######################################## |
---|
521 | ### transpose compilation |
---|
522 | build/transpose/transpose.elf: $(TRANSPOSE_OBJS) applications/transpose/transpose.ld hard_config.h |
---|
523 | $(LD) -o $@ -T applications/transpose/transpose.ld $(TRANSPOSE_OBJS) |
---|
524 | $(DU) -D $@ > $@.txt |
---|
525 | |
---|
526 | build/transpose/main.o: applications/transpose/main.c |
---|
527 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
528 | |
---|
529 | ######################################## |
---|
530 | ### convol compilation |
---|
531 | build/convol/convol.elf: $(CONVOL_OBJS) applications/convol/convol.ld hard_config.h |
---|
532 | $(LD) -o $@ -T applications/convol/convol.ld $(CONVOL_OBJS) |
---|
533 | $(DU) -D $@ > $@.txt |
---|
534 | |
---|
535 | build/convol/main.o: applications/convol/main.c |
---|
536 | $(CC) $(USER_INCLUDE) $(CFLAGS) -O0 -c -o $@ $< |
---|
537 | |
---|
538 | ######################################## |
---|
539 | ### classif compilation |
---|
540 | build/classif/classif.elf: $(CLASSIF_OBJS) applications/classif/classif.ld hard_config.h |
---|
541 | $(LD) -o $@ -T applications/classif/classif.ld $(CLASSIF_OBJS) |
---|
542 | $(DU) -D $@ > $@.txt |
---|
543 | |
---|
544 | build/classif/main.o: applications/classif/main.c |
---|
545 | $(CC) $(USER_INCLUDE) $(CFLAGS) -O0 -c -o $@ $< |
---|
546 | |
---|
547 | ######################################## |
---|
548 | ### clean |
---|
549 | clean: |
---|
550 | rm -f *.o *.elf *.bin *.txt core |
---|
551 | rm -f hard_config.h giet_vsegs.ld map.bin map.xml |
---|
552 | rm -rf build/boot/* |
---|
553 | rm -rf build/fat32/* |
---|
554 | rm -rf build/common/* |
---|
555 | rm -rf build/drivers/* |
---|
556 | rm -rf build/kernel/* |
---|
557 | rm -rf build/reset/* |
---|
558 | rm -rf build/libs/* |
---|
559 | rm -rf build/pgcd/* |
---|
560 | rm -rf build/hello/* |
---|
561 | rm -rf build/display/* |
---|
562 | rm -rf build/router/* |
---|
563 | rm -rf build/gameoflife/* |
---|
564 | rm -rf build/dhrystone/* |
---|
565 | rm -rf build/sort/* |
---|
566 | rm -rf build/transpose/* |
---|
567 | rm -rf build/convol/* |
---|
568 | rm -rf build/classif/* |
---|
569 | rm -rf $(DISK_IMAGE) |
---|