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