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