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