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