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