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: map.bin \ |
---|
165 | hard_config.h \ |
---|
166 | giet_vsegs.ld \ |
---|
167 | build/boot/boot.elf \ |
---|
168 | build/kernel/kernel.elf \ |
---|
169 | build/display/display.elf \ |
---|
170 | build/hello/hello.elf \ |
---|
171 | build/pgcd/pgcd.elf \ |
---|
172 | build/router/router.elf \ |
---|
173 | build/dhrystone/dhrystone.elf \ |
---|
174 | build/gameoflife/gameoflife.elf \ |
---|
175 | build/sort/sort.elf \ |
---|
176 | build/transpose/transpose.elf \ |
---|
177 | build/convol/convol.elf \ |
---|
178 | build/classif/classif.elf \ |
---|
179 | build/coproc/coproc.elf \ |
---|
180 | $(DISK_IMAGE) |
---|
181 | |
---|
182 | ### Copy always all files into disk image |
---|
183 | mcopy -o -i $(DISK_IMAGE) build/kernel/kernel.elf ::/build/kernel |
---|
184 | mcopy -o -i $(DISK_IMAGE) build/display/display.elf ::/build/display |
---|
185 | mcopy -o -i $(DISK_IMAGE) build/hello/hello.elf ::/build/hello |
---|
186 | mcopy -o -i $(DISK_IMAGE) build/pgcd/pgcd.elf ::/build/pgcd |
---|
187 | mcopy -o -i $(DISK_IMAGE) build/router/router.elf ::/build/router |
---|
188 | mcopy -o -i $(DISK_IMAGE) build/dhrystone/dhrystone.elf ::/build/dhrystone |
---|
189 | mcopy -o -i $(DISK_IMAGE) build/gameoflife/gameoflife.elf ::/build/gameoflife |
---|
190 | mcopy -o -i $(DISK_IMAGE) build/sort/sort.elf ::/build/sort |
---|
191 | mcopy -o -i $(DISK_IMAGE) build/transpose/transpose.elf ::/build/transpose |
---|
192 | mcopy -o -i $(DISK_IMAGE) build/convol/convol.elf ::/build/convol |
---|
193 | mcopy -o -i $(DISK_IMAGE) build/classif/classif.elf ::/build/classif |
---|
194 | mcopy -o -i $(DISK_IMAGE) build/coproc/coproc.elf ::/build/coproc |
---|
195 | mcopy -o -i $(DISK_IMAGE) applications/transpose/images.raw ::/misc |
---|
196 | mcopy -o -i $(DISK_IMAGE) applications/convol/philips_image.raw ::/misc |
---|
197 | mcopy -o -i $(DISK_IMAGE) applications/display/lena.raw ::/misc |
---|
198 | mcopy -o -i $(DISK_IMAGE) map.bin ::/ |
---|
199 | ### Copy bootloader into sector 2 of disk image |
---|
200 | dd if=build/boot/boot.elf of=$(DISK_IMAGE) seek=2 conv=notrunc |
---|
201 | ### Checking root directory |
---|
202 | mdir -/ -b -i $(DISK_IMAGE) ::/ |
---|
203 | |
---|
204 | ### Disk image generation (no files in this step) |
---|
205 | ### This requires the generic LINUX/MacOS script "create_dmg" script |
---|
206 | ### written by C.Fuguet. (should be installed in GIET-VM root directory). |
---|
207 | $(DISK_IMAGE): |
---|
208 | ./create_dmg create $(basename $(DISK_IMAGE)) |
---|
209 | mmd -o -i $(DISK_IMAGE) ::/build |
---|
210 | mmd -o -i $(DISK_IMAGE) ::/build/kernel |
---|
211 | mmd -o -i $(DISK_IMAGE) ::/build/display |
---|
212 | mmd -o -i $(DISK_IMAGE) ::/build/hello |
---|
213 | mmd -o -i $(DISK_IMAGE) ::/build/pgcd |
---|
214 | mmd -o -i $(DISK_IMAGE) ::/build/router |
---|
215 | mmd -o -i $(DISK_IMAGE) ::/build/dhrystone |
---|
216 | mmd -o -i $(DISK_IMAGE) ::/build/gameoflife |
---|
217 | mmd -o -i $(DISK_IMAGE) ::/build/sort |
---|
218 | mmd -o -i $(DISK_IMAGE) ::/build/transpose |
---|
219 | mmd -o -i $(DISK_IMAGE) ::/build/convol |
---|
220 | mmd -o -i $(DISK_IMAGE) ::/build/classif |
---|
221 | mmd -o -i $(DISK_IMAGE) ::/build/coproc |
---|
222 | mmd -o -i $(DISK_IMAGE) ::/misc |
---|
223 | dd if=$(DISK_IMAGE) of=temp.dmg count=65536 |
---|
224 | mv temp.dmg $(DISK_IMAGE) |
---|
225 | |
---|
226 | ### mapping generation: map.bin / map.xml / hard_config.h / giet_vsegs.ld |
---|
227 | map.bin hard_config.h giet_vsegs.ld: $(ARCH)/arch.py applications/$(APP)/$(APP).py |
---|
228 | giet_python/genmap --arch=$(ARCH) \ |
---|
229 | --x=$(X_SIZE) \ |
---|
230 | --y=$(Y_SIZE) \ |
---|
231 | --p=$(NB_PROCS) \ |
---|
232 | --tty=$(NB_TTYS) \ |
---|
233 | --fbf=$(FBF_WIDTH) \ |
---|
234 | --ioc=$(IOC_TYPE) \ |
---|
235 | --giet=. \ |
---|
236 | --$(APP) \ |
---|
237 | --xml=. |
---|
238 | |
---|
239 | ### drivers compilation |
---|
240 | build/drivers/cma_driver.o: giet_drivers/cma_driver.c \ |
---|
241 | giet_drivers/cma_driver.h \ |
---|
242 | hard_config.h \ |
---|
243 | giet_config.h |
---|
244 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
245 | |
---|
246 | build/drivers/dma_driver.o: giet_drivers/dma_driver.c \ |
---|
247 | giet_drivers/dma_driver.h \ |
---|
248 | hard_config.h \ |
---|
249 | giet_config.h |
---|
250 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
251 | |
---|
252 | build/drivers/xcu_driver.o: giet_drivers/xcu_driver.c \ |
---|
253 | giet_drivers/xcu_driver.h \ |
---|
254 | hard_config.h \ |
---|
255 | giet_config.h |
---|
256 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
257 | |
---|
258 | build/drivers/bdv_driver.o: giet_drivers/bdv_driver.c \ |
---|
259 | giet_drivers/bdv_driver.h \ |
---|
260 | hard_config.h \ |
---|
261 | giet_config.h |
---|
262 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
263 | |
---|
264 | build/drivers/hba_driver.o: giet_drivers/hba_driver.c \ |
---|
265 | giet_drivers/hba_driver.h \ |
---|
266 | hard_config.h \ |
---|
267 | giet_config.h |
---|
268 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
269 | |
---|
270 | build/drivers/sdc_driver.o: giet_drivers/sdc_driver.c \ |
---|
271 | giet_drivers/sdc_driver.h \ |
---|
272 | hard_config.h \ |
---|
273 | giet_config.h |
---|
274 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
275 | |
---|
276 | build/drivers/spi_driver.o: giet_drivers/spi_driver.c \ |
---|
277 | giet_drivers/spi_driver.h \ |
---|
278 | hard_config.h \ |
---|
279 | giet_config.h |
---|
280 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
281 | |
---|
282 | build/drivers/rdk_driver.o: giet_drivers/rdk_driver.c \ |
---|
283 | giet_drivers/rdk_driver.h \ |
---|
284 | hard_config.h \ |
---|
285 | giet_config.h |
---|
286 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
287 | |
---|
288 | build/drivers/iob_driver.o: giet_drivers/iob_driver.c \ |
---|
289 | giet_drivers/iob_driver.h \ |
---|
290 | hard_config.h \ |
---|
291 | giet_config.h |
---|
292 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
293 | |
---|
294 | build/drivers/mmc_driver.o: giet_drivers/mmc_driver.c \ |
---|
295 | giet_drivers/mmc_driver.h \ |
---|
296 | hard_config.h \ |
---|
297 | giet_config.h |
---|
298 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
299 | |
---|
300 | build/drivers/mwr_driver.o: giet_drivers/mwr_driver.c \ |
---|
301 | giet_drivers/mwr_driver.h \ |
---|
302 | hard_config.h \ |
---|
303 | giet_config.h |
---|
304 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
305 | |
---|
306 | build/drivers/nic_driver.o: giet_drivers/nic_driver.c \ |
---|
307 | giet_drivers/nic_driver.h \ |
---|
308 | hard_config.h \ |
---|
309 | giet_config.h |
---|
310 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
311 | |
---|
312 | build/drivers/tim_driver.o: giet_drivers/tim_driver.c \ |
---|
313 | giet_drivers/tim_driver.h \ |
---|
314 | hard_config.h \ |
---|
315 | giet_config.h |
---|
316 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
317 | |
---|
318 | build/drivers/tty_driver.o: giet_drivers/tty_driver.c \ |
---|
319 | giet_drivers/tty_driver.h \ |
---|
320 | hard_config.h \ |
---|
321 | giet_config.h |
---|
322 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
323 | |
---|
324 | build/drivers/pic_driver.o: giet_drivers/pic_driver.c \ |
---|
325 | giet_drivers/pic_driver.h \ |
---|
326 | hard_config.h \ |
---|
327 | giet_config.h |
---|
328 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
329 | |
---|
330 | ################################ |
---|
331 | ### drivers library compilation |
---|
332 | build/drivers/libdrivers.a: $(DRIVERS_OBJS) |
---|
333 | $(AR) -rcs $@ $(DRIVERS_OBJS) |
---|
334 | |
---|
335 | ########################## |
---|
336 | ### common compilation |
---|
337 | build/fat32/fat32.o: giet_fat32/fat32.c \ |
---|
338 | giet_fat32/fat32.h \ |
---|
339 | hard_config.h \ |
---|
340 | giet_config.h |
---|
341 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
342 | |
---|
343 | build/common/utils.o: giet_common/utils.c \ |
---|
344 | giet_common/utils.h \ |
---|
345 | hard_config.h \ |
---|
346 | giet_config.h |
---|
347 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
348 | |
---|
349 | build/common/kernel_locks.o: giet_common/kernel_locks.c \ |
---|
350 | giet_common/kernel_locks.h \ |
---|
351 | hard_config.h \ |
---|
352 | giet_config.h |
---|
353 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
354 | |
---|
355 | build/common/kernel_barriers.o: giet_common/kernel_barriers.c \ |
---|
356 | giet_common/kernel_barriers.h \ |
---|
357 | hard_config.h \ |
---|
358 | giet_config.h |
---|
359 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
360 | |
---|
361 | build/common/tty0.o: giet_common/tty0.c \ |
---|
362 | giet_common/tty0.h \ |
---|
363 | hard_config.h \ |
---|
364 | giet_config.h |
---|
365 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
366 | |
---|
367 | build/common/vmem.o: giet_common/vmem.c \ |
---|
368 | giet_common/vmem.h \ |
---|
369 | hard_config.h \ |
---|
370 | giet_config.h |
---|
371 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
372 | |
---|
373 | build/common/pmem.o: giet_common/pmem.c \ |
---|
374 | giet_common/pmem.h \ |
---|
375 | hard_config.h \ |
---|
376 | giet_config.h |
---|
377 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
378 | |
---|
379 | build/common/kernel_malloc.o: giet_common/kernel_malloc.c \ |
---|
380 | giet_common/kernel_malloc.h \ |
---|
381 | hard_config.h \ |
---|
382 | giet_config.h |
---|
383 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
384 | |
---|
385 | ######################## |
---|
386 | ### boot compilation |
---|
387 | build/boot: |
---|
388 | mkdir $@ |
---|
389 | |
---|
390 | build/boot/boot.elf: $(BOOT_OBJS) \ |
---|
391 | giet_boot/boot.ld \ |
---|
392 | build/drivers/libdrivers.a | build/boot |
---|
393 | $(LD) -o $@ -T giet_boot/boot.ld $(BOOT_OBJS) -Lbuild/drivers -ldrivers |
---|
394 | $(DU) -D $@ > $@.txt |
---|
395 | |
---|
396 | build/boot/boot.o: giet_boot/boot.c \ |
---|
397 | giet_common/utils.h \ |
---|
398 | giet_fat32/fat32.h \ |
---|
399 | giet_common/vmem.h \ |
---|
400 | hard_config.h \ |
---|
401 | giet_config.h |
---|
402 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
403 | |
---|
404 | build/boot/boot_entry.o: giet_boot/boot_entry.S \ |
---|
405 | hard_config.h |
---|
406 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
407 | |
---|
408 | ######################### |
---|
409 | ### kernel compilation |
---|
410 | build/kernel/kernel.elf: $(KERNEL_OBJS) \ |
---|
411 | giet_kernel/kernel.ld \ |
---|
412 | build/drivers/libdrivers.a |
---|
413 | $(LD) -o $@ -T giet_kernel/kernel.ld $(KERNEL_OBJS) -Lbuild/drivers -ldrivers |
---|
414 | $(DU) -D $@ > $@.txt |
---|
415 | |
---|
416 | build/kernel/%.o: giet_kernel/%.c \ |
---|
417 | hard_config.h \ |
---|
418 | giet_config.h |
---|
419 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
420 | |
---|
421 | build/kernel/%.o: giet_kernel/%.s \ |
---|
422 | hard_config.h \ |
---|
423 | giet_config.h |
---|
424 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
425 | |
---|
426 | ########################### |
---|
427 | ### user libs compilation |
---|
428 | build/libs/stdio.o: giet_libs/stdio.c \ |
---|
429 | giet_libs/stdio.h \ |
---|
430 | hard_config.h \ |
---|
431 | giet_config.h |
---|
432 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
433 | |
---|
434 | build/libs/mwmr_channel.o: giet_libs/mwmr_channel.c \ |
---|
435 | giet_libs/mwmr_channel.h \ |
---|
436 | hard_config.h \ |
---|
437 | giet_config.h |
---|
438 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
439 | |
---|
440 | build/libs/malloc.o: giet_libs/malloc.c \ |
---|
441 | giet_libs/malloc.h \ |
---|
442 | hard_config.h \ |
---|
443 | giet_config.h |
---|
444 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
445 | |
---|
446 | build/libs/user_barrier.o: giet_libs/user_barrier.c \ |
---|
447 | giet_libs/user_barrier.h \ |
---|
448 | hard_config.h \ |
---|
449 | giet_config.h |
---|
450 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
451 | |
---|
452 | build/libs/stdlib.o: giet_libs/stdlib.c \ |
---|
453 | giet_libs/stdlib.h \ |
---|
454 | hard_config.h \ |
---|
455 | giet_config.h |
---|
456 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
457 | |
---|
458 | build/libs/string.o: giet_libs/string.c \ |
---|
459 | giet_libs/string.h \ |
---|
460 | hard_config.h \ |
---|
461 | giet_config.h |
---|
462 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
463 | |
---|
464 | build/libs/user_lock.o: giet_libs/user_lock.c \ |
---|
465 | giet_libs/user_lock.h \ |
---|
466 | hard_config.h \ |
---|
467 | giet_config.h |
---|
468 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
469 | |
---|
470 | ######################################## |
---|
471 | ### display application compilation |
---|
472 | build/display/display.elf: $(DISPLAY_OBJS) applications/display/display.ld hard_config.h |
---|
473 | $(LD) -o $@ -T applications/display/display.ld $(DISPLAY_OBJS) |
---|
474 | $(DU) -D $@ > $@.txt |
---|
475 | |
---|
476 | build/display/main.o: applications/display/main.c |
---|
477 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
478 | |
---|
479 | ######################################## |
---|
480 | ### router compilation |
---|
481 | build/router/router.elf: $(ROUTER_OBJS) applications/router/router.ld hard_config.h |
---|
482 | $(LD) -o $@ -T applications/router/router.ld $(ROUTER_OBJS) |
---|
483 | $(DU) -D $@ > $@.txt |
---|
484 | |
---|
485 | build/router/main.o: applications/router/main.c |
---|
486 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
487 | |
---|
488 | ######################################## |
---|
489 | ### hello compilation |
---|
490 | build/hello/hello.elf: $(HELLO_OBJS) applications/hello/hello.ld hard_config.h |
---|
491 | $(LD) -o $@ -T applications/hello/hello.ld $(HELLO_OBJS) |
---|
492 | $(DU) -D $@ > $@.txt |
---|
493 | |
---|
494 | build/hello/main.o: applications/hello/main.c |
---|
495 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
496 | |
---|
497 | ######################################## |
---|
498 | ### pgcd compilation |
---|
499 | build/pgcd/pgcd.elf: $(PGCD_OBJS) applications/pgcd/pgcd.ld hard_config.h |
---|
500 | $(LD) -o $@ -T applications/pgcd/pgcd.ld $(PGCD_OBJS) |
---|
501 | $(DU) -D $@ > $@.txt |
---|
502 | |
---|
503 | build/pgcd/main.o: applications/pgcd/main.c |
---|
504 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
505 | |
---|
506 | ######################################## |
---|
507 | ### gameoflife compilation |
---|
508 | build/gameoflife/gameoflife.elf: $(GAMEOFLIFE_OBJS) applications/gameoflife/gameoflife.ld |
---|
509 | $(LD) -o $@ -T applications/gameoflife/gameoflife.ld $(GAMEOFLIFE_OBJS) |
---|
510 | $(DU) -D $@ > $@.txt |
---|
511 | |
---|
512 | build/gameoflife/main.o: applications/gameoflife/main.c |
---|
513 | $(CC) $(USER_INCLUDE) $(CFLAGS) -O3 -c -o $@ $< |
---|
514 | |
---|
515 | ######################################## |
---|
516 | ### dhrystone compilation |
---|
517 | build/dhrystone/dhrystone.elf: $(DHRYSTONE_OBJS) applications/dhrystone/dhrystone.ld hard_config.h |
---|
518 | $(LD) -o $@ -T applications/dhrystone/dhrystone.ld $(DHRYSTONE_OBJS) |
---|
519 | $(DU) -D $@ > $@.txt |
---|
520 | |
---|
521 | build/dhrystone/dhry_1.o: applications/dhrystone/dhry_1.c |
---|
522 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
523 | |
---|
524 | build/dhrystone/dhry_2.o: applications/dhrystone/dhry_2.c |
---|
525 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
526 | |
---|
527 | ######################################## |
---|
528 | ### sort compilation |
---|
529 | build/sort/sort.elf: $(SORT_OBJS) applications/sort/sort.ld hard_config.h |
---|
530 | $(LD) -o $@ -T applications/sort/sort.ld $(SORT_OBJS) |
---|
531 | $(DU) -D $@ > $@.txt |
---|
532 | |
---|
533 | build/sort/main.o: applications/sort/main.c |
---|
534 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
535 | |
---|
536 | ######################################## |
---|
537 | ### transpose compilation |
---|
538 | build/transpose/transpose.elf: $(TRANSPOSE_OBJS) applications/transpose/transpose.ld hard_config.h |
---|
539 | $(LD) -o $@ -T applications/transpose/transpose.ld $(TRANSPOSE_OBJS) |
---|
540 | $(DU) -D $@ > $@.txt |
---|
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 | |
---|
551 | build/convol/main.o: applications/convol/main.c |
---|
552 | $(CC) $(USER_INCLUDE) $(CFLAGS) -O0 -c -o $@ $< |
---|
553 | |
---|
554 | ######################################## |
---|
555 | ### classif compilation |
---|
556 | build/classif/classif.elf: $(CLASSIF_OBJS) applications/classif/classif.ld hard_config.h |
---|
557 | $(LD) -o $@ -T applications/classif/classif.ld $(CLASSIF_OBJS) |
---|
558 | $(DU) -D $@ > $@.txt |
---|
559 | |
---|
560 | build/classif/main.o: applications/classif/main.c |
---|
561 | $(CC) $(USER_INCLUDE) $(CFLAGS) -O0 -c -o $@ $< |
---|
562 | |
---|
563 | ######################################## |
---|
564 | ### coproc compilation |
---|
565 | build/coproc/coproc.elf: $(COPROC_OBJS) applications/coproc/coproc.ld hard_config.h |
---|
566 | $(LD) -o $@ -T applications/coproc/coproc.ld $(COPROC_OBJS) |
---|
567 | $(DU) -D $@ > $@.txt |
---|
568 | |
---|
569 | build/coproc/main.o: applications/coproc/main.c |
---|
570 | $(CC) $(USER_INCLUDE) $(CFLAGS) -O0 -c -o $@ $< |
---|
571 | |
---|
572 | ######################################## |
---|
573 | ### clean |
---|
574 | clean: |
---|
575 | rm -f *.o *.elf *.bin *.txt core |
---|
576 | rm -f hard_config.h giet_vsegs.ld map.bin map.xml |
---|
577 | rm -rf build/boot/* |
---|
578 | rm -rf build/fat32/* |
---|
579 | rm -rf build/common/* |
---|
580 | rm -rf build/drivers/* |
---|
581 | rm -rf build/kernel/* |
---|
582 | rm -rf build/reset/* |
---|
583 | rm -rf build/libs/* |
---|
584 | rm -rf build/pgcd/* |
---|
585 | rm -rf build/hello/* |
---|
586 | rm -rf build/display/* |
---|
587 | rm -rf build/router/* |
---|
588 | rm -rf build/gameoflife/* |
---|
589 | rm -rf build/dhrystone/* |
---|
590 | rm -rf build/sort/* |
---|
591 | rm -rf build/transpose/* |
---|
592 | rm -rf build/convol/* |
---|
593 | rm -rf build/classif/* |
---|
594 | rm -rf build/coproc/* |
---|
595 | rm -rf $(DISK_IMAGE) |
---|