| 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 | ARCH ?= ../../../tsar/platforms/tsar_generic_iob |
|---|
| 13 | X_SIZE ?= 1 |
|---|
| 14 | Y_SIZE ?= 1 |
|---|
| 15 | NB_PROCS ?= 4 |
|---|
| 16 | NB_TTYS ?= 1 |
|---|
| 17 | FBF_WIDTH ?= 128 |
|---|
| 18 | IOC_TYPE ?= HBA |
|---|
| 19 | APP ?= ocean |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | .PHONY: clean map.bin build |
|---|
| 23 | |
|---|
| 24 | ### FAT parameters definition for Disk image |
|---|
| 25 | ### sector_size = 512 |
|---|
| 26 | ### partition_begin_lba = 300 |
|---|
| 27 | ### sector_per_cluster = 8 |
|---|
| 28 | ### partition sectors = 524832 |
|---|
| 29 | |
|---|
| 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 | |
|---|
| 49 | ### Objects to be linked for the drivers library |
|---|
| 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 \ |
|---|
| 64 | build/drivers/pic_driver.o |
|---|
| 65 | |
|---|
| 66 | ### Objects to be linked for kernel.elf |
|---|
| 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 \ |
|---|
| 80 | build/kernel/kernel_init.o |
|---|
| 81 | |
|---|
| 82 | ### Objects to be linked for boot.elf |
|---|
| 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 \ |
|---|
| 92 | build/kernel/irq_handler.o \ |
|---|
| 93 | build/kernel/switch.o \ |
|---|
| 94 | build/boot/boot.o \ |
|---|
| 95 | build/boot/boot_entry.o |
|---|
| 96 | |
|---|
| 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 \ |
|---|
| 113 | |
|---|
| 114 | ### Objects to be linked for display.elf |
|---|
| 115 | DISPLAY_OBJS = build/display/main.o \ |
|---|
| 116 | build/libs/stdio.o |
|---|
| 117 | |
|---|
| 118 | ### Objects to be linked for router.elf |
|---|
| 119 | ROUTER_OBJS = build/router/main.o \ |
|---|
| 120 | build/libs/mwmr_channel.o \ |
|---|
| 121 | build/libs/user_lock.o \ |
|---|
| 122 | build/libs/stdio.o |
|---|
| 123 | |
|---|
| 124 | ### Objects to be linked for hello.elf |
|---|
| 125 | HELLO_OBJS = build/hello/main.o \ |
|---|
| 126 | build/libs/stdio.o |
|---|
| 127 | |
|---|
| 128 | ### Objects to be linked for pgcd.elf |
|---|
| 129 | PGCD_OBJS = build/pgcd/main.o \ |
|---|
| 130 | build/libs/stdio.o |
|---|
| 131 | |
|---|
| 132 | ### Objects to be linked for game.elf |
|---|
| 133 | GAMEOFLIFE_OBJS = build/gameoflife/main.o \ |
|---|
| 134 | build/libs/stdio.o \ |
|---|
| 135 | build/libs/user_barrier.o \ |
|---|
| 136 | build/libs/malloc.o \ |
|---|
| 137 | build/libs/user_lock.o |
|---|
| 138 | |
|---|
| 139 | ### Objects to be linked for dhrystone.elf |
|---|
| 140 | DHRYSTONE_OBJS = build/dhrystone/dhry_1.o \ |
|---|
| 141 | build/dhrystone/dhry_2.o \ |
|---|
| 142 | build/libs/stdlib.o \ |
|---|
| 143 | build/libs/stdio.o \ |
|---|
| 144 | build/libs/string.o \ |
|---|
| 145 | build/libs/user_lock.o \ |
|---|
| 146 | build/libs/malloc.o |
|---|
| 147 | |
|---|
| 148 | ### Objects to be linked for sort.elf |
|---|
| 149 | SORT_OBJS = build/sort/main.o \ |
|---|
| 150 | build/libs/stdio.o \ |
|---|
| 151 | build/libs/user_barrier.o \ |
|---|
| 152 | build/libs/malloc.o \ |
|---|
| 153 | build/libs/user_lock.o |
|---|
| 154 | |
|---|
| 155 | ### Objects to be linked for transpose.elf |
|---|
| 156 | TRANSPOSE_OBJS = build/transpose/main.o \ |
|---|
| 157 | build/libs/stdio.o \ |
|---|
| 158 | build/libs/user_barrier.o \ |
|---|
| 159 | build/libs/malloc.o \ |
|---|
| 160 | build/libs/user_lock.o |
|---|
| 161 | |
|---|
| 162 | ### Objects to be linked for convol.elf |
|---|
| 163 | CONVOL_OBJS = build/convol/main.o \ |
|---|
| 164 | build/libs/stdio.o \ |
|---|
| 165 | build/libs/stdlib.o \ |
|---|
| 166 | build/libs/user_barrier.o \ |
|---|
| 167 | build/libs/malloc.o \ |
|---|
| 168 | build/libs/user_lock.o |
|---|
| 169 | |
|---|
| 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 \ |
|---|
| 174 | build/libs/user_barrier.o \ |
|---|
| 175 | build/libs/malloc.o \ |
|---|
| 176 | build/libs/user_lock.o |
|---|
| 177 | |
|---|
| 178 | ### Objects to be linked for coproc.elf |
|---|
| 179 | COPROC_OBJS = build/coproc/main.o \ |
|---|
| 180 | build/libs/stdio.o |
|---|
| 181 | |
|---|
| 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 | |
|---|
| 192 | CFLAGS = -Wall -ffreestanding -mno-gpopt -mips32 -g -O2 \ |
|---|
| 193 | -fno-delete-null-pointer-checks |
|---|
| 194 | |
|---|
| 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. |
|---|
| 203 | |
|---|
| 204 | USER_INCLUDE = -Igiet_libs \ |
|---|
| 205 | -Igiet_xml \ |
|---|
| 206 | -I. |
|---|
| 207 | |
|---|
| 208 | DISK_IMAGE := hdd/virt_hdd.dmg |
|---|
| 209 | |
|---|
| 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 | |
|---|
| 216 | all: build \ |
|---|
| 217 | $(DISK_IMAGE) \ |
|---|
| 218 | map.bin \ |
|---|
| 219 | hard_config.h \ |
|---|
| 220 | giet_vsegs.ld \ |
|---|
| 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 \ |
|---|
| 226 | build/router/router.elf \ |
|---|
| 227 | build/dhrystone/dhrystone.elf \ |
|---|
| 228 | build/gameoflife/gameoflife.elf \ |
|---|
| 229 | build/sort/sort.elf \ |
|---|
| 230 | build/transpose/transpose.elf \ |
|---|
| 231 | build/convol/convol.elf \ |
|---|
| 232 | build/classif/classif.elf \ |
|---|
| 233 | build/coproc/coproc.elf \ |
|---|
| 234 | build/ocean/ocean.elf |
|---|
| 235 | mdir -/ -b -i $(DISK_IMAGE) ::/ |
|---|
| 236 | |
|---|
| 237 | build: |
|---|
| 238 | mkdir -p build |
|---|
| 239 | (cd build && mkdir -p $(BUILD_DIRS)) |
|---|
| 240 | |
|---|
| 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 | |
|---|
| 246 | ### Disk image generation (no files in this step) |
|---|
| 247 | ### This requires the generic LINUX/MacOS script "create_dmg" script |
|---|
| 248 | ### written by C.Fuguet. (should be installed in GIET-VM root directory). |
|---|
| 249 | ### create the three build / misc / home directories |
|---|
| 250 | ### store the images files into misc |
|---|
| 251 | $(DISK_IMAGE): |
|---|
| 252 | ./create_dmg create $(basename $(DISK_IMAGE)) |
|---|
| 253 | dd if=$(DISK_IMAGE) of=temp.dmg count=65536 |
|---|
| 254 | mv temp.dmg $(DISK_IMAGE) |
|---|
| 255 | mmd -o -i $(DISK_IMAGE) ::/build |
|---|
| 256 | mmd -o -i $(DISK_IMAGE) ::/build/ocean |
|---|
| 257 | mmd -o -i $(DISK_IMAGE) ::/misc |
|---|
| 258 | mmd -o -i $(DISK_IMAGE) ::/home |
|---|
| 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 |
|---|
| 262 | |
|---|
| 263 | ### mapping generation: map.bin / map.xml / hard_config.h / giet_vsegs.ld |
|---|
| 264 | map.bin hard_config.h giet_vsegs.ld: $(ARCH)/arch.py applications/$(APP)/$(APP).py $(DISK_IMAGE) |
|---|
| 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) \ |
|---|
| 271 | --ioc=$(IOC_TYPE) \ |
|---|
| 272 | --giet=. \ |
|---|
| 273 | --$(APP) \ |
|---|
| 274 | --xml=. |
|---|
| 275 | mcopy -o -i $(DISK_IMAGE) map.bin ::/ |
|---|
| 276 | |
|---|
| 277 | ################################ |
|---|
| 278 | ### drivers library compilation |
|---|
| 279 | build/drivers/%.o: giet_drivers/%.c \ |
|---|
| 280 | giet_drivers/%.h \ |
|---|
| 281 | hard_config.h \ |
|---|
| 282 | giet_config.h |
|---|
| 283 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
|---|
| 284 | |
|---|
| 285 | build/drivers/libdrivers.a: $(DRIVERS_OBJS) |
|---|
| 286 | $(AR) -rcs $@ $(DRIVERS_OBJS) |
|---|
| 287 | |
|---|
| 288 | ########################## |
|---|
| 289 | ### fat32 compilation |
|---|
| 290 | build/fat32/fat32.o: giet_fat32/fat32.c \ |
|---|
| 291 | giet_fat32/fat32.h \ |
|---|
| 292 | hard_config.h \ |
|---|
| 293 | giet_config.h |
|---|
| 294 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
|---|
| 295 | |
|---|
| 296 | ########################## |
|---|
| 297 | ### common compilation |
|---|
| 298 | build/common/%.o: giet_common/%.c \ |
|---|
| 299 | giet_common/%.h \ |
|---|
| 300 | hard_config.h \ |
|---|
| 301 | giet_config.h |
|---|
| 302 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
|---|
| 303 | |
|---|
| 304 | ######################## |
|---|
| 305 | ### boot compilation |
|---|
| 306 | ### Copy bootloader into sector 2 of disk image |
|---|
| 307 | build/boot/boot.elf: $(BOOT_OBJS) \ |
|---|
| 308 | $(DISK_IMAGE) \ |
|---|
| 309 | giet_boot/boot.ld \ |
|---|
| 310 | build/drivers/libdrivers.a |
|---|
| 311 | $(LD) -o $@ -T giet_boot/boot.ld $(BOOT_OBJS) -Lbuild/drivers -ldrivers |
|---|
| 312 | $(DU) -D $@ > $@.txt |
|---|
| 313 | dd if=$@ of=$(DISK_IMAGE) seek=2 conv=notrunc |
|---|
| 314 | |
|---|
| 315 | build/boot/boot.o: giet_boot/boot.c \ |
|---|
| 316 | giet_common/utils.h \ |
|---|
| 317 | giet_fat32/fat32.h \ |
|---|
| 318 | giet_common/vmem.h \ |
|---|
| 319 | hard_config.h \ |
|---|
| 320 | giet_config.h |
|---|
| 321 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
|---|
| 322 | |
|---|
| 323 | build/boot/boot_entry.o: giet_boot/boot_entry.S \ |
|---|
| 324 | hard_config.h |
|---|
| 325 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
|---|
| 326 | |
|---|
| 327 | ######################### |
|---|
| 328 | ### kernel compilation |
|---|
| 329 | build/kernel/kernel.elf: $(KERNEL_OBJS) \ |
|---|
| 330 | $(DISK_IMAGE) \ |
|---|
| 331 | giet_kernel/kernel.ld \ |
|---|
| 332 | build/drivers/libdrivers.a |
|---|
| 333 | $(LD) -o $@ -T giet_kernel/kernel.ld $(KERNEL_OBJS) -Lbuild/drivers -ldrivers |
|---|
| 334 | $(DU) -D $@ > $@.txt |
|---|
| 335 | mmd -o -i $(DISK_IMAGE) ::/build/kernel || true |
|---|
| 336 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/kernel |
|---|
| 337 | |
|---|
| 338 | build/kernel/%.o: giet_kernel/%.c \ |
|---|
| 339 | hard_config.h \ |
|---|
| 340 | giet_config.h |
|---|
| 341 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
|---|
| 342 | |
|---|
| 343 | build/kernel/%.o: giet_kernel/%.s \ |
|---|
| 344 | hard_config.h \ |
|---|
| 345 | giet_config.h |
|---|
| 346 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
|---|
| 347 | |
|---|
| 348 | ########################### |
|---|
| 349 | ### user libs compilation |
|---|
| 350 | build/libs/%.o: giet_libs/%.c \ |
|---|
| 351 | giet_libs/%.h \ |
|---|
| 352 | hard_config.h \ |
|---|
| 353 | giet_config.h |
|---|
| 354 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
|---|
| 355 | |
|---|
| 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 |
|---|
| 361 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
|---|
| 362 | |
|---|
| 363 | build/libs/libmath.a: $(MATH_OBJS) |
|---|
| 364 | $(AR) -rcs $@ $^ |
|---|
| 365 | |
|---|
| 366 | ######################################## |
|---|
| 367 | ### display application compilation |
|---|
| 368 | build/display/display.elf: $(DISPLAY_OBJS) applications/display/display.ld hard_config.h $(DISK_IMAGE) |
|---|
| 369 | $(LD) -o $@ -T applications/display/display.ld $(DISPLAY_OBJS) |
|---|
| 370 | $(DU) -D $@ > $@.txt |
|---|
| 371 | mmd -o -i $(DISK_IMAGE) ::/build/display || true |
|---|
| 372 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/display |
|---|
| 373 | |
|---|
| 374 | build/display/main.o: applications/display/main.c hard_config.h |
|---|
| 375 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
|---|
| 376 | |
|---|
| 377 | ######################################## |
|---|
| 378 | ### router compilation |
|---|
| 379 | build/router/router.elf: $(ROUTER_OBJS) applications/router/router.ld hard_config.h $(DISK_IMAGE) |
|---|
| 380 | $(LD) -o $@ -T applications/router/router.ld $(ROUTER_OBJS) |
|---|
| 381 | $(DU) -D $@ > $@.txt |
|---|
| 382 | mmd -o -i $(DISK_IMAGE) ::/build/router || true |
|---|
| 383 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/router |
|---|
| 384 | |
|---|
| 385 | build/router/main.o: applications/router/main.c hard_config.h |
|---|
| 386 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
|---|
| 387 | |
|---|
| 388 | ######################################## |
|---|
| 389 | ### hello compilation |
|---|
| 390 | build/hello/hello.elf: $(HELLO_OBJS) applications/hello/hello.ld hard_config.h $(DISK_IMAGE) |
|---|
| 391 | $(LD) -o $@ -T applications/hello/hello.ld $(HELLO_OBJS) |
|---|
| 392 | $(DU) -D $@ > $@.txt |
|---|
| 393 | mmd -o -i $(DISK_IMAGE) ::/build/hello || true |
|---|
| 394 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/hello |
|---|
| 395 | |
|---|
| 396 | build/hello/main.o: applications/hello/main.c hard_config.h |
|---|
| 397 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
|---|
| 398 | |
|---|
| 399 | ######################################## |
|---|
| 400 | ### pgcd compilation |
|---|
| 401 | build/pgcd/pgcd.elf: $(PGCD_OBJS) applications/pgcd/pgcd.ld hard_config.h $(DISK_IMAGE) |
|---|
| 402 | $(LD) -o $@ -T applications/pgcd/pgcd.ld $(PGCD_OBJS) |
|---|
| 403 | $(DU) -D $@ > $@.txt |
|---|
| 404 | mmd -o -i $(DISK_IMAGE) ::/build/pgcd || true |
|---|
| 405 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/pgcd |
|---|
| 406 | |
|---|
| 407 | build/pgcd/main.o: applications/pgcd/main.c hard_config.h |
|---|
| 408 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
|---|
| 409 | |
|---|
| 410 | ######################################## |
|---|
| 411 | ### gameoflife compilation |
|---|
| 412 | build/gameoflife/gameoflife.elf: $(GAMEOFLIFE_OBJS) applications/gameoflife/gameoflife.ld $(DISK_IMAGE) |
|---|
| 413 | $(LD) -o $@ -T applications/gameoflife/gameoflife.ld $(GAMEOFLIFE_OBJS) |
|---|
| 414 | $(DU) -D $@ > $@.txt |
|---|
| 415 | mmd -o -i $(DISK_IMAGE) ::/build/gameoflife || true |
|---|
| 416 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/gameoflife |
|---|
| 417 | |
|---|
| 418 | build/gameoflife/main.o: applications/gameoflife/main.c hard_config.h |
|---|
| 419 | $(CC) $(USER_INCLUDE) $(CFLAGS) -O3 -c -o $@ $< |
|---|
| 420 | |
|---|
| 421 | ######################################## |
|---|
| 422 | ### dhrystone compilation |
|---|
| 423 | build/dhrystone/dhrystone.elf: $(DHRYSTONE_OBJS) applications/dhrystone/dhrystone.ld hard_config.h $(DISK_IMAGE) |
|---|
| 424 | $(LD) -o $@ -T applications/dhrystone/dhrystone.ld $(DHRYSTONE_OBJS) |
|---|
| 425 | $(DU) -D $@ > $@.txt |
|---|
| 426 | mmd -o -i $(DISK_IMAGE) ::/build/dhrystone || true |
|---|
| 427 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/dhrystone |
|---|
| 428 | |
|---|
| 429 | build/dhrystone/dhry_1.o: applications/dhrystone/dhry_1.c hard_config.h |
|---|
| 430 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
|---|
| 431 | |
|---|
| 432 | build/dhrystone/dhry_2.o: applications/dhrystone/dhry_2.c hard_config.h |
|---|
| 433 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
|---|
| 434 | |
|---|
| 435 | ######################################## |
|---|
| 436 | ### sort compilation |
|---|
| 437 | build/sort/sort.elf: $(SORT_OBJS) applications/sort/sort.ld hard_config.h $(DISK_IMAGE) |
|---|
| 438 | $(LD) -o $@ -T applications/sort/sort.ld $(SORT_OBJS) |
|---|
| 439 | $(DU) -D $@ > $@.txt |
|---|
| 440 | mmd -o -i $(DISK_IMAGE) ::/build/sort || true |
|---|
| 441 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/sort |
|---|
| 442 | |
|---|
| 443 | build/sort/main.o: applications/sort/main.c hard_config.h |
|---|
| 444 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
|---|
| 445 | |
|---|
| 446 | ######################################## |
|---|
| 447 | ### transpose compilation |
|---|
| 448 | build/transpose/transpose.elf: $(TRANSPOSE_OBJS) applications/transpose/transpose.ld hard_config.h $(DISK_IMAGE) |
|---|
| 449 | $(LD) -o $@ -T applications/transpose/transpose.ld $(TRANSPOSE_OBJS) |
|---|
| 450 | $(DU) -D $@ > $@.txt |
|---|
| 451 | mmd -o -i $(DISK_IMAGE) ::/build/transpose || true |
|---|
| 452 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/transpose |
|---|
| 453 | |
|---|
| 454 | build/transpose/main.o: applications/transpose/main.c hard_config.h |
|---|
| 455 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
|---|
| 456 | |
|---|
| 457 | ######################################## |
|---|
| 458 | ### convol compilation |
|---|
| 459 | build/convol/convol.elf: $(CONVOL_OBJS) applications/convol/convol.ld hard_config.h $(DISK_IMAGE) |
|---|
| 460 | $(LD) -o $@ -T applications/convol/convol.ld $(CONVOL_OBJS) |
|---|
| 461 | $(DU) -D $@ > $@.txt |
|---|
| 462 | mmd -o -i $(DISK_IMAGE) ::/build/convol || true |
|---|
| 463 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/convol |
|---|
| 464 | |
|---|
| 465 | build/convol/main.o: applications/convol/main.c hard_config.h |
|---|
| 466 | $(CC) $(USER_INCLUDE) $(CFLAGS) -O0 -c -o $@ $< |
|---|
| 467 | |
|---|
| 468 | ######################################## |
|---|
| 469 | ### classif compilation |
|---|
| 470 | build/classif/classif.elf: $(CLASSIF_OBJS) applications/classif/classif.ld hard_config.h $(DISK_IMAGE) |
|---|
| 471 | $(LD) -o $@ -T applications/classif/classif.ld $(CLASSIF_OBJS) |
|---|
| 472 | $(DU) -D $@ > $@.txt |
|---|
| 473 | mmd -o -i $(DISK_IMAGE) ::/build/classif || true |
|---|
| 474 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/classif |
|---|
| 475 | |
|---|
| 476 | build/classif/main.o: applications/classif/main.c hard_config.h |
|---|
| 477 | $(CC) $(USER_INCLUDE) $(CFLAGS) -O0 -c -o $@ $< |
|---|
| 478 | |
|---|
| 479 | ######################################## |
|---|
| 480 | ### coproc compilation |
|---|
| 481 | build/coproc/coproc.elf: $(COPROC_OBJS) applications/coproc/coproc.ld hard_config.h $(DISK_IMAGE) |
|---|
| 482 | $(LD) -o $@ -T applications/coproc/coproc.ld $(COPROC_OBJS) |
|---|
| 483 | $(DU) -D $@ > $@.txt |
|---|
| 484 | mmd -o -i $(DISK_IMAGE) ::/build/coproc || true |
|---|
| 485 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/coproc |
|---|
| 486 | |
|---|
| 487 | build/coproc/main.o: applications/coproc/main.c hard_config.h |
|---|
| 488 | $(CC) $(USER_INCLUDE) $(CFLAGS) -O0 -c -o $@ $< |
|---|
| 489 | |
|---|
| 490 | ######################################## |
|---|
| 491 | ### ocean compilation |
|---|
| 492 | build/ocean/ocean.elf: applications/ocean/ocean.elf hard_config.h |
|---|
| 493 | mv $< $@ |
|---|
| 494 | $(DU) -D $@ > $@.txt |
|---|
| 495 | mmd -o -i $(DISK_IMAGE) ::/build/ocean || true |
|---|
| 496 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/ocean |
|---|
| 497 | |
|---|
| 498 | applications/ocean/ocean.elf: $(OCEAN_OBJS) hard_config.h |
|---|
| 499 | cd applications/ocean/ && $(MAKE) |
|---|
| 500 | |
|---|
| 501 | ######################################## |
|---|
| 502 | ### clean |
|---|
| 503 | clean: |
|---|
| 504 | rm -f *.o *.elf *.bin *.txt core |
|---|
| 505 | rm -f hard_config.h giet_vsegs.ld map.bin map.xml |
|---|
| 506 | rm -rf build/ |
|---|
| 507 | cd applications/ocean && $(MAKE) clean |
|---|
| 508 | |
|---|
| 509 | clean-disk: |
|---|
| 510 | rm -f $(DISK_IMAGE) |
|---|