[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 | |
---|
[304] | 15 | MAP_XML ?= mappings/tsar_leti_2_2_4_sort.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 |
---|
| 155 | mcopy -o -i $(DISK_IMAGE) map.bin ::/ |
---|
[302] | 156 | dd if=build/boot/boot.elf of=$(DISK_IMAGE) seek=2 conv=notrunc |
---|
[160] | 157 | |
---|
[258] | 158 | ### Disk image generation |
---|
[272] | 159 | ### This requires the generic LINUX/MacOS script "create_dmg" script |
---|
[258] | 160 | ### written by C.Fuguet. (should be installed in GIET-VM root directory). |
---|
[302] | 161 | $(DISK_IMAGE): |
---|
| 162 | ./create_dmg create $(basename $(DISK_IMAGE)) |
---|
[304] | 163 | mmd -o -i $(DISK_IMAGE) ::/build |
---|
| 164 | mmd -o -i $(DISK_IMAGE) ::/build/kernel |
---|
| 165 | mmd -o -i $(DISK_IMAGE) ::/build/display |
---|
| 166 | mmd -o -i $(DISK_IMAGE) ::/build/sort |
---|
| 167 | mmd -o -i $(DISK_IMAGE) ::/build/transpose |
---|
| 168 | mmd -o -i $(DISK_IMAGE) ::/build/hello |
---|
| 169 | mmd -o -i $(DISK_IMAGE) ::/build/pgcd |
---|
| 170 | mmd -o -i $(DISK_IMAGE) ::/build/router |
---|
| 171 | mmd -o -i $(DISK_IMAGE) ::/build/gameoflife |
---|
| 172 | mmd -o -i $(DISK_IMAGE) ::/build/dhrystone |
---|
| 173 | mmd -o -i $(DISK_IMAGE) ::/misc |
---|
| 174 | dd if=$(DISK_IMAGE) of=temp.dmg count=65536 |
---|
| 175 | mv temp.dmg $(DISK_IMAGE) |
---|
[295] | 176 | |
---|
[177] | 177 | ### mapping compilation |
---|
[204] | 178 | map.bin: $(MAP_XML) |
---|
[258] | 179 | $(MAKE) -C giet_xml |
---|
| 180 | giet_xml/xml2bin $< . |
---|
[158] | 181 | |
---|
[258] | 182 | ### drivers compilation |
---|
[295] | 183 | build/drivers/cma_driver.o: giet_drivers/cma_driver.c \ |
---|
| 184 | giet_drivers/cma_driver.h \ |
---|
| 185 | giet_config.h \ |
---|
| 186 | $(MAP_XML) |
---|
| 187 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 188 | |
---|
[258] | 189 | build/drivers/dma_driver.o: giet_drivers/dma_driver.c \ |
---|
| 190 | giet_drivers/dma_driver.h \ |
---|
| 191 | giet_config.h \ |
---|
| 192 | $(MAP_XML) |
---|
| 193 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
[158] | 194 | |
---|
[258] | 195 | build/drivers/fbf_driver.o: giet_drivers/fbf_driver.c \ |
---|
| 196 | giet_drivers/fbf_driver.h \ |
---|
| 197 | giet_config.h \ |
---|
| 198 | $(MAP_XML) |
---|
| 199 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
[158] | 200 | |
---|
[258] | 201 | build/drivers/xcu_driver.o: giet_drivers/xcu_driver.c \ |
---|
| 202 | giet_drivers/xcu_driver.h \ |
---|
| 203 | giet_config.h \ |
---|
| 204 | $(MAP_XML) |
---|
| 205 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
[158] | 206 | |
---|
[258] | 207 | build/drivers/icu_driver.o: giet_drivers/icu_driver.c \ |
---|
| 208 | giet_drivers/icu_driver.h \ |
---|
| 209 | giet_config.h \ |
---|
| 210 | $(MAP_XML) |
---|
| 211 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 212 | |
---|
| 213 | build/drivers/ioc_driver.o: giet_drivers/ioc_driver.c \ |
---|
| 214 | giet_drivers/ioc_driver.h \ |
---|
| 215 | giet_config.h \ |
---|
| 216 | $(MAP_XML) |
---|
| 217 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 218 | |
---|
[289] | 219 | build/drivers/bdv_driver.o: giet_drivers/bdv_driver.c \ |
---|
| 220 | giet_drivers/bdv_driver.h \ |
---|
| 221 | giet_config.h \ |
---|
| 222 | $(MAP_XML) |
---|
| 223 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 224 | |
---|
| 225 | build/drivers/hba_driver.o: giet_drivers/hba_driver.c \ |
---|
| 226 | giet_drivers/hba_driver.h \ |
---|
| 227 | giet_config.h \ |
---|
| 228 | $(MAP_XML) |
---|
| 229 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 230 | |
---|
| 231 | build/drivers/sdc_driver.o: giet_drivers/sdc_driver.c \ |
---|
| 232 | giet_drivers/sdc_driver.h \ |
---|
| 233 | giet_config.h \ |
---|
| 234 | $(MAP_XML) |
---|
| 235 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 236 | |
---|
| 237 | build/drivers/spi_driver.o: giet_drivers/spi_driver.c \ |
---|
| 238 | giet_drivers/spi_driver.h \ |
---|
| 239 | giet_config.h \ |
---|
| 240 | $(MAP_XML) |
---|
| 241 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 242 | |
---|
[295] | 243 | build/drivers/rdk_driver.o: giet_drivers/rdk_driver.c \ |
---|
| 244 | giet_drivers/rdk_driver.h \ |
---|
| 245 | giet_config.h \ |
---|
| 246 | $(MAP_XML) |
---|
| 247 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 248 | |
---|
[258] | 249 | build/drivers/iob_driver.o: giet_drivers/iob_driver.c \ |
---|
| 250 | giet_drivers/iob_driver.h \ |
---|
| 251 | giet_config.h \ |
---|
| 252 | $(MAP_XML) |
---|
| 253 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 254 | |
---|
| 255 | build/drivers/mmc_driver.o: giet_drivers/mmc_driver.c \ |
---|
| 256 | giet_drivers/mmc_driver.h \ |
---|
| 257 | giet_config.h \ |
---|
| 258 | $(MAP_XML) |
---|
| 259 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 260 | |
---|
| 261 | build/drivers/mwr_driver.o: giet_drivers/mwr_driver.c \ |
---|
| 262 | giet_drivers/mwr_driver.h \ |
---|
| 263 | giet_config.h \ |
---|
| 264 | $(MAP_XML) |
---|
| 265 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 266 | |
---|
| 267 | build/drivers/nic_driver.o: giet_drivers/nic_driver.c \ |
---|
| 268 | giet_drivers/nic_driver.h \ |
---|
| 269 | giet_config.h \ |
---|
| 270 | $(MAP_XML) |
---|
| 271 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 272 | |
---|
| 273 | build/drivers/tim_driver.o: giet_drivers/tim_driver.c \ |
---|
| 274 | giet_drivers/tim_driver.h \ |
---|
| 275 | giet_config.h \ |
---|
| 276 | $(MAP_XML) |
---|
| 277 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 278 | |
---|
| 279 | build/drivers/tty_driver.o: giet_drivers/tty_driver.c \ |
---|
| 280 | giet_drivers/tty_driver.h \ |
---|
| 281 | giet_config.h \ |
---|
| 282 | $(MAP_XML) |
---|
| 283 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 284 | |
---|
[295] | 285 | build/drivers/pic_driver.o: giet_drivers/pic_driver.c \ |
---|
| 286 | giet_drivers/pic_driver.h \ |
---|
| 287 | giet_config.h \ |
---|
| 288 | $(MAP_XML) |
---|
| 289 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 290 | |
---|
[258] | 291 | ### fat32 compilation |
---|
| 292 | build/fat32/fat32.o: giet_fat32/fat32.c \ |
---|
| 293 | giet_fat32/fat32.h \ |
---|
| 294 | giet_config.h \ |
---|
| 295 | $(MAP_XML) |
---|
| 296 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 297 | |
---|
| 298 | ### utils compilation |
---|
| 299 | build/common/utils.o: giet_common/utils.c \ |
---|
| 300 | giet_common/utils.h \ |
---|
| 301 | giet_config.h \ |
---|
| 302 | $(MAP_XML) |
---|
| 303 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 304 | |
---|
| 305 | ### vmem compilation |
---|
| 306 | build/common/vmem.o: giet_common/vmem.c \ |
---|
| 307 | giet_common/vmem.h \ |
---|
| 308 | giet_config.h \ |
---|
| 309 | $(MAP_XML) |
---|
| 310 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 311 | |
---|
[177] | 312 | ### boot compilation |
---|
[258] | 313 | build/boot/boot.elf: $(BOOT_OBJS) |
---|
| 314 | $(LD) -o $@ -T giet_boot/boot.ld $(BOOT_OBJS) |
---|
[189] | 315 | $(DU) -D $@ > $@.txt |
---|
[158] | 316 | |
---|
[258] | 317 | build/boot/boot.o: giet_boot/boot.c \ |
---|
| 318 | giet_common/utils.h \ |
---|
| 319 | giet_fat32/fat32.h \ |
---|
[289] | 320 | giet_common/vmem.h \ |
---|
[258] | 321 | giet_drivers/tty_driver.h \ |
---|
| 322 | giet_drivers/ioc_driver.h \ |
---|
| 323 | giet_config.h \ |
---|
| 324 | $(MAP_XML) |
---|
| 325 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
[158] | 326 | |
---|
[258] | 327 | ### kernel compilation |
---|
| 328 | build/kernel/kernel.elf: $(KERNEL_OBJS) giet_kernel/kernel.ld |
---|
| 329 | $(LD) -o $@ -T giet_kernel/kernel.ld $(KERNEL_OBJS) |
---|
| 330 | $(DU) -D $@ > $@.txt |
---|
[158] | 331 | |
---|
[258] | 332 | build/kernel/%.o: giet_kernel/%.c giet_config.h $(MAP_XML) |
---|
| 333 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 334 | |
---|
| 335 | build/kernel/%.o: giet_kernel/%.s giet_config.h $(MAP_XML) |
---|
| 336 | $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 337 | |
---|
| 338 | |
---|
| 339 | |
---|
| 340 | |
---|
| 341 | ### libs compilation |
---|
| 342 | build/libs/stdio.o: giet_libs/stdio.c \ |
---|
| 343 | giet_libs/stdio.h \ |
---|
| 344 | giet_config.h |
---|
| 345 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
| 346 | |
---|
| 347 | build/libs/mwmr_channel.o: giet_libs/mwmr_channel.c \ |
---|
| 348 | giet_libs/mwmr_channel.h \ |
---|
| 349 | giet_config.h |
---|
| 350 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
| 351 | |
---|
| 352 | build/libs/malloc.o: giet_libs/malloc.c \ |
---|
| 353 | giet_libs/malloc.h \ |
---|
| 354 | giet_libs/malloc_private.h \ |
---|
| 355 | giet_config.h |
---|
| 356 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
| 357 | |
---|
| 358 | build/libs/barrier.o: giet_libs/barrier.c \ |
---|
| 359 | giet_libs/barrier.h \ |
---|
| 360 | giet_config.h |
---|
| 361 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
| 362 | |
---|
[259] | 363 | build/libs/stdlib.o: giet_libs/stdlib.c \ |
---|
| 364 | giet_libs/stdlib.h \ |
---|
| 365 | giet_config.h |
---|
| 366 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
| 367 | |
---|
[258] | 368 | build/libs/string.o: giet_libs/string.c \ |
---|
| 369 | giet_libs/string.h \ |
---|
| 370 | giet_config.h |
---|
| 371 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
| 372 | |
---|
| 373 | build/libs/spin_lock.o: giet_libs/spin_lock.c \ |
---|
| 374 | giet_libs/spin_lock.h \ |
---|
| 375 | giet_config.h |
---|
| 376 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< |
---|
| 377 | |
---|
| 378 | |
---|
| 379 | |
---|
| 380 | |
---|
[189] | 381 | ### display compilation |
---|
| 382 | build/display/display.elf: $(DISPLAY_OBJS) display/display.ld |
---|
| 383 | $(LD) -o $@ -T display/display.ld $(DISPLAY_OBJS) |
---|
| 384 | $(DU) -D $@ > $@.txt |
---|
[158] | 385 | |
---|
[258] | 386 | build/display/main.o: display/main_cma.c |
---|
| 387 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
[189] | 388 | |
---|
| 389 | ### router compilation |
---|
| 390 | build/router/router.elf: $(ROUTER_OBJS) router/router.ld |
---|
| 391 | $(LD) -o $@ -T router/router.ld $(ROUTER_OBJS) |
---|
| 392 | $(DU) -D $@ > $@.txt |
---|
| 393 | |
---|
| 394 | build/router/main.o: router/main.c |
---|
[258] | 395 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
[189] | 396 | |
---|
| 397 | ### hello compilation |
---|
| 398 | build/hello/hello.elf: $(HELLO_OBJS) hello/hello.ld |
---|
| 399 | $(LD) -o $@ -T hello/hello.ld $(HELLO_OBJS) |
---|
| 400 | $(DU) -D $@ > $@.txt |
---|
| 401 | |
---|
| 402 | build/hello/main.o: hello/main.c |
---|
[258] | 403 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
[189] | 404 | |
---|
| 405 | ### pgcd compilation |
---|
| 406 | build/pgcd/pgcd.elf: $(PGCD_OBJS) pgcd/pgcd.ld |
---|
| 407 | $(LD) -o $@ -T pgcd/pgcd.ld $(PGCD_OBJS) |
---|
| 408 | $(DU) -D $@ > $@.txt |
---|
| 409 | |
---|
| 410 | build/pgcd/main.o: pgcd/main.c |
---|
[258] | 411 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
[189] | 412 | |
---|
[251] | 413 | ### gameoflife compilation |
---|
| 414 | build/gameoflife/gameoflife.elf: $(GAMEOFLIFE_OBJS) gameoflife/gameoflife.ld |
---|
| 415 | $(LD) -o $@ -T gameoflife/gameoflife.ld $(GAMEOFLIFE_OBJS) |
---|
| 416 | $(DU) -D $@ > $@.txt |
---|
| 417 | |
---|
| 418 | build/gameoflife/main.o: gameoflife/main.c |
---|
[258] | 419 | $(CC) $(USER_INCLUDE) $(CFLAGS) -O3 -c -o $@ $< |
---|
[251] | 420 | |
---|
[241] | 421 | ### dhrystone compilation |
---|
| 422 | build/dhrystone/dhrystone.elf: $(DHRYSTONE_OBJS) dhrystone/dhrystone.ld |
---|
| 423 | $(LD) -o $@ -T dhrystone/dhrystone.ld $(DHRYSTONE_OBJS) |
---|
| 424 | $(DU) -D $@ > $@.txt |
---|
| 425 | |
---|
| 426 | build/dhrystone/dhry_1.o: dhrystone/dhry_1.c |
---|
[258] | 427 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
[241] | 428 | |
---|
| 429 | build/dhrystone/dhry_2.o: dhrystone/dhry_2.c |
---|
[258] | 430 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
[241] | 431 | |
---|
[256] | 432 | ### sort compilation |
---|
[258] | 433 | build/sort/sort.elf: $(SORT_OBJS) sort/sort.ld |
---|
[256] | 434 | $(LD) -o $@ -T sort/sort.ld $(SORT_OBJS) |
---|
| 435 | $(DU) -D $@ > $@.txt |
---|
| 436 | |
---|
| 437 | build/sort/main.o: sort/main.c |
---|
[258] | 438 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
[256] | 439 | |
---|
[295] | 440 | ### transpose compilation |
---|
| 441 | build/transpose/transpose.elf: $(TRANSPOSE_OBJS) transpose/transpose.ld |
---|
| 442 | $(LD) -o $@ -T transpose/transpose.ld $(TRANSPOSE_OBJS) |
---|
| 443 | $(DU) -D $@ > $@.txt |
---|
| 444 | |
---|
| 445 | build/transpose/main.o: transpose/main.c |
---|
| 446 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 447 | |
---|
[177] | 448 | ### clean |
---|
[158] | 449 | clean: |
---|
[252] | 450 | rm -f *.o *.elf *.bin *.txt core giet_vsegs.ld hard_config.h map.bin*~ |
---|
[258] | 451 | $(MAKE) -s clean -C giet_xml |
---|
[232] | 452 | rm -rf build/boot/* |
---|
[258] | 453 | rm -rf build/fat32/* |
---|
| 454 | rm -rf build/common/* |
---|
| 455 | rm -rf build/drivers/* |
---|
| 456 | rm -rf build/kernel/* |
---|
| 457 | rm -rf build/reset/* |
---|
[232] | 458 | rm -rf build/libs/* |
---|
| 459 | rm -rf build/pgcd/* |
---|
| 460 | rm -rf build/hello/* |
---|
| 461 | rm -rf build/display/* |
---|
| 462 | rm -rf build/router/* |
---|
[251] | 463 | rm -rf build/gameoflife/* |
---|
[241] | 464 | rm -rf build/dhrystone/* |
---|
[258] | 465 | rm -rf build/sort/* |
---|
[295] | 466 | rm -rf build/transpose/* |
---|
[258] | 467 | rm -rf build/map.bin |
---|
[302] | 468 | |
---|
| 469 | distclean: clean |
---|
[258] | 470 | rm -rf hdd/virt_hdd.dmg |
---|