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