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