| 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    ?= 2 | 
|---|
| 14 | Y_SIZE    ?= 2 | 
|---|
| 15 | NB_PROCS  ?= 4 | 
|---|
| 16 | NB_TTYS   ?= 1 | 
|---|
| 17 | FBF_WIDTH ?= 128 | 
|---|
| 18 | IOC_TYPE  ?= HBA | 
|---|
| 19 | APP       ?= ocean | 
|---|
| 20 |  | 
|---|
| 21 |  | 
|---|
| 22 | .PHONY: map.bin build clean | 
|---|
| 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 | MATH_OBJ     = build/libs/math/e_pow.o          \ | 
|---|
| 98 | build/libs/math/e_rem_pio2.o     \ | 
|---|
| 99 | build/libs/math/k_cos.o          \ | 
|---|
| 100 | build/libs/math/k_rem_pio2.o     \ | 
|---|
| 101 | build/libs/math/k_sin.o          \ | 
|---|
| 102 | build/libs/math/s_copysign.o     \ | 
|---|
| 103 | build/libs/math/s_fabs.o         \ | 
|---|
| 104 | build/libs/math/s_finite.o       \ | 
|---|
| 105 | build/libs/math/s_floor.o        \ | 
|---|
| 106 | build/libs/math/s_isnan.o        \ | 
|---|
| 107 | build/libs/math/sqrt.o           \ | 
|---|
| 108 | build/libs/math/s_rint.o         \ | 
|---|
| 109 | build/libs/math/s_scalbn.o       \ | 
|---|
| 110 | build/libs/math/s_sin.o | 
|---|
| 111 | #               build/libs/math/e_sqrt.o                \ | 
|---|
| 112 |  | 
|---|
| 113 | ### Objects to be linked for display.elf | 
|---|
| 114 | DISPLAY_OBJS = build/display/main.o \ | 
|---|
| 115 | build/libs/stdio.o | 
|---|
| 116 |  | 
|---|
| 117 | ### Objects to be linked for router.elf | 
|---|
| 118 | ROUTER_OBJS  = build/router/main.o        \ | 
|---|
| 119 | build/libs/mwmr_channel.o  \ | 
|---|
| 120 | build/libs/user_lock.o     \ | 
|---|
| 121 | build/libs/stdio.o | 
|---|
| 122 |  | 
|---|
| 123 | ### Objects to be linked for hello.elf | 
|---|
| 124 | HELLO_OBJS   = build/hello/main.o   \ | 
|---|
| 125 | build/libs/stdio.o | 
|---|
| 126 |  | 
|---|
| 127 | ### Objects to be linked for pgcd.elf | 
|---|
| 128 | PGCD_OBJS    = build/pgcd/main.o \ | 
|---|
| 129 | build/libs/stdio.o | 
|---|
| 130 |  | 
|---|
| 131 | ### Objects to be linked for game.elf | 
|---|
| 132 | GAMEOFLIFE_OBJS = build/gameoflife/main.o   \ | 
|---|
| 133 | build/libs/stdio.o        \ | 
|---|
| 134 | build/libs/user_barrier.o \ | 
|---|
| 135 | build/libs/malloc.o       \ | 
|---|
| 136 | build/libs/user_lock.o | 
|---|
| 137 |  | 
|---|
| 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 |  | 
|---|
| 193 | CFLAGS = -Wall -ffreestanding -mno-gpopt -mips32 -g -O2 \ | 
|---|
| 194 | -fno-delete-null-pointer-checks | 
|---|
| 195 |  | 
|---|
| 196 | GIET_INCLUDE = -Igiet_boot    \ | 
|---|
| 197 | -Igiet_kernel  \ | 
|---|
| 198 | -Igiet_xml     \ | 
|---|
| 199 | -Igiet_fat32   \ | 
|---|
| 200 | -Igiet_drivers \ | 
|---|
| 201 | -Igiet_common  \ | 
|---|
| 202 | -Igiet_libs    \ | 
|---|
| 203 | -I. | 
|---|
| 204 |  | 
|---|
| 205 | USER_INCLUDE = -Igiet_libs    \ | 
|---|
| 206 | -Igiet_xml     \ | 
|---|
| 207 | -I. | 
|---|
| 208 |  | 
|---|
| 209 | DISK_IMAGE  := hdd/virt_hdd.dmg | 
|---|
| 210 |  | 
|---|
| 211 | all: build                           \ | 
|---|
| 212 | map.bin                         \ | 
|---|
| 213 | hard_config.h                   \ | 
|---|
| 214 | giet_vsegs.ld                   \ | 
|---|
| 215 | build/boot/boot.elf             \ | 
|---|
| 216 | build/kernel/kernel.elf         \ | 
|---|
| 217 | build/display/display.elf       \ | 
|---|
| 218 | build/hello/hello.elf           \ | 
|---|
| 219 | build/pgcd/pgcd.elf             \ | 
|---|
| 220 | build/router/router.elf         \ | 
|---|
| 221 | build/dhrystone/dhrystone.elf   \ | 
|---|
| 222 | build/gameoflife/gameoflife.elf \ | 
|---|
| 223 | build/sort/sort.elf             \ | 
|---|
| 224 | build/transpose/transpose.elf   \ | 
|---|
| 225 | build/convol/convol.elf         \ | 
|---|
| 226 | build/classif/classif.elf       \ | 
|---|
| 227 | build/coproc/coproc.elf         \ | 
|---|
| 228 | build/ocean/ocean.elf           \ | 
|---|
| 229 | $(DISK_IMAGE) | 
|---|
| 230 | ### Copy always all files into disk image | 
|---|
| 231 | mcopy -o -i $(DISK_IMAGE) build/kernel/kernel.elf ::/build/kernel | 
|---|
| 232 | mcopy -o -i $(DISK_IMAGE) build/display/display.elf ::/build/display | 
|---|
| 233 | mcopy -o -i $(DISK_IMAGE) build/hello/hello.elf ::/build/hello | 
|---|
| 234 | mcopy -o -i $(DISK_IMAGE) build/pgcd/pgcd.elf ::/build/pgcd | 
|---|
| 235 | mcopy -o -i $(DISK_IMAGE) build/router/router.elf ::/build/router | 
|---|
| 236 | mcopy -o -i $(DISK_IMAGE) build/dhrystone/dhrystone.elf ::/build/dhrystone | 
|---|
| 237 | mcopy -o -i $(DISK_IMAGE) build/gameoflife/gameoflife.elf ::/build/gameoflife | 
|---|
| 238 | mcopy -o -i $(DISK_IMAGE) build/sort/sort.elf ::/build/sort | 
|---|
| 239 | mcopy -o -i $(DISK_IMAGE) build/transpose/transpose.elf ::/build/transpose | 
|---|
| 240 | mcopy -o -i $(DISK_IMAGE) build/convol/convol.elf ::/build/convol | 
|---|
| 241 | mcopy -o -i $(DISK_IMAGE) build/classif/classif.elf ::/build/classif | 
|---|
| 242 | mcopy -o -i $(DISK_IMAGE) build/coproc/coproc.elf ::/build/coproc | 
|---|
| 243 | mcopy -o -i $(DISK_IMAGE) build/ocean/ocean.elf ::/build/ocean | 
|---|
| 244 | mcopy -o -i $(DISK_IMAGE) applications/transpose/images.raw ::/misc | 
|---|
| 245 | mcopy -o -i $(DISK_IMAGE) applications/convol/philips_image.raw ::/misc | 
|---|
| 246 | mcopy -o -i $(DISK_IMAGE) map.bin ::/ | 
|---|
| 247 | ### Copy bootloader into sector 2 of disk image | 
|---|
| 248 | dd if=build/boot/boot.elf of=$(DISK_IMAGE) seek=2 conv=notrunc | 
|---|
| 249 | ### Checking root directory | 
|---|
| 250 | mdir -/ -b -i $(DISK_IMAGE) ::/ | 
|---|
| 251 |  | 
|---|
| 252 |  | 
|---|
| 253 | build: | 
|---|
| 254 | mkdir -p build | 
|---|
| 255 | (cd build && mkdir -p $(BUILD_DIRS)) | 
|---|
| 256 |  | 
|---|
| 257 | ### Disk image generation (no files in this step) | 
|---|
| 258 | ### This requires the generic LINUX/MacOS script "create_dmg" script | 
|---|
| 259 | ### written by C.Fuguet. (should be installed in GIET-VM root directory). | 
|---|
| 260 | ### create the three build / misc / home directories | 
|---|
| 261 | ### store the images files into misc | 
|---|
| 262 | $(DISK_IMAGE): | 
|---|
| 263 | ./create_dmg create $(basename $(DISK_IMAGE)) | 
|---|
| 264 | dd if=$(DISK_IMAGE) of=temp.dmg count=65536 | 
|---|
| 265 | mv temp.dmg $(DISK_IMAGE) | 
|---|
| 266 | mmd -o -i $(DISK_IMAGE) ::/build | 
|---|
| 267 | mmd -o -i $(DISK_IMAGE) ::/build/ocean | 
|---|
| 268 | mmd -o -i $(DISK_IMAGE) ::/misc | 
|---|
| 269 | mmd -o -i $(DISK_IMAGE) ::/home | 
|---|
| 270 | mcopy -o -i $(DISK_IMAGE) applications/transpose/images.raw ::/misc | 
|---|
| 271 | mcopy -o -i $(DISK_IMAGE) applications/convol/philips_image.raw ::/misc | 
|---|
| 272 | mcopy -o -i $(DISK_IMAGE) applications/display/lena.raw ::/misc | 
|---|
| 273 |  | 
|---|
| 274 | ### mapping generation: map.bin / map.xml / hard_config.h / giet_vsegs.ld | 
|---|
| 275 | map.bin hard_config.h giet_vsegs.ld: $(ARCH)/arch.py  applications/$(APP)/$(APP).py | 
|---|
| 276 | giet_python/genmap --arch=$(ARCH)     \ | 
|---|
| 277 | --x=$(X_SIZE)      \ | 
|---|
| 278 | --y=$(Y_SIZE)      \ | 
|---|
| 279 | --p=$(NB_PROCS)    \ | 
|---|
| 280 | --tty=$(NB_TTYS)   \ | 
|---|
| 281 | --fbf=$(FBF_WIDTH) \ | 
|---|
| 282 | --ioc=$(IOC_TYPE)  \ | 
|---|
| 283 | --giet=.           \ | 
|---|
| 284 | --$(APP)           \ | 
|---|
| 285 | --xml=. | 
|---|
| 286 | mcopy -o -i $(DISK_IMAGE) map.bin ::/ | 
|---|
| 287 |  | 
|---|
| 288 | ### drivers compilation | 
|---|
| 289 | build/drivers/cma_driver.o: giet_drivers/cma_driver.c  \ | 
|---|
| 290 | giet_drivers/cma_driver.h  \ | 
|---|
| 291 | hard_config.h              \ | 
|---|
| 292 | giet_config.h | 
|---|
| 293 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 294 |  | 
|---|
| 295 | build/drivers/dma_driver.o: giet_drivers/dma_driver.c  \ | 
|---|
| 296 | giet_drivers/dma_driver.h  \ | 
|---|
| 297 | hard_config.h              \ | 
|---|
| 298 | giet_config.h | 
|---|
| 299 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 300 |  | 
|---|
| 301 | build/drivers/xcu_driver.o: giet_drivers/xcu_driver.c  \ | 
|---|
| 302 | giet_drivers/xcu_driver.h  \ | 
|---|
| 303 | hard_config.h              \ | 
|---|
| 304 | giet_config.h | 
|---|
| 305 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 306 |  | 
|---|
| 307 | build/drivers/bdv_driver.o: giet_drivers/bdv_driver.c  \ | 
|---|
| 308 | giet_drivers/bdv_driver.h  \ | 
|---|
| 309 | hard_config.h              \ | 
|---|
| 310 | giet_config.h | 
|---|
| 311 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 312 |  | 
|---|
| 313 | build/drivers/hba_driver.o: giet_drivers/hba_driver.c  \ | 
|---|
| 314 | giet_drivers/hba_driver.h  \ | 
|---|
| 315 | hard_config.h              \ | 
|---|
| 316 | giet_config.h | 
|---|
| 317 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 318 |  | 
|---|
| 319 | build/drivers/sdc_driver.o: giet_drivers/sdc_driver.c  \ | 
|---|
| 320 | giet_drivers/sdc_driver.h  \ | 
|---|
| 321 | hard_config.h              \ | 
|---|
| 322 | giet_config.h | 
|---|
| 323 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 324 |  | 
|---|
| 325 | build/drivers/spi_driver.o: giet_drivers/spi_driver.c  \ | 
|---|
| 326 | giet_drivers/spi_driver.h  \ | 
|---|
| 327 | hard_config.h              \ | 
|---|
| 328 | giet_config.h | 
|---|
| 329 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 330 |  | 
|---|
| 331 | build/drivers/rdk_driver.o: giet_drivers/rdk_driver.c  \ | 
|---|
| 332 | giet_drivers/rdk_driver.h  \ | 
|---|
| 333 | hard_config.h              \ | 
|---|
| 334 | giet_config.h | 
|---|
| 335 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 336 |  | 
|---|
| 337 | build/drivers/iob_driver.o: giet_drivers/iob_driver.c  \ | 
|---|
| 338 | giet_drivers/iob_driver.h  \ | 
|---|
| 339 | hard_config.h              \ | 
|---|
| 340 | giet_config.h | 
|---|
| 341 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 342 |  | 
|---|
| 343 | build/drivers/mmc_driver.o: giet_drivers/mmc_driver.c  \ | 
|---|
| 344 | giet_drivers/mmc_driver.h  \ | 
|---|
| 345 | hard_config.h              \ | 
|---|
| 346 | giet_config.h | 
|---|
| 347 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 348 |  | 
|---|
| 349 | build/drivers/mwr_driver.o: giet_drivers/mwr_driver.c  \ | 
|---|
| 350 | giet_drivers/mwr_driver.h  \ | 
|---|
| 351 | hard_config.h              \ | 
|---|
| 352 | giet_config.h | 
|---|
| 353 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 354 |  | 
|---|
| 355 | build/drivers/nic_driver.o: giet_drivers/nic_driver.c  \ | 
|---|
| 356 | giet_drivers/nic_driver.h  \ | 
|---|
| 357 | hard_config.h              \ | 
|---|
| 358 | giet_config.h | 
|---|
| 359 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 360 |  | 
|---|
| 361 | build/drivers/tim_driver.o: giet_drivers/tim_driver.c  \ | 
|---|
| 362 | giet_drivers/tim_driver.h  \ | 
|---|
| 363 | hard_config.h              \ | 
|---|
| 364 | giet_config.h | 
|---|
| 365 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 366 |  | 
|---|
| 367 | build/drivers/tty_driver.o: giet_drivers/tty_driver.c  \ | 
|---|
| 368 | giet_drivers/tty_driver.h  \ | 
|---|
| 369 | hard_config.h              \ | 
|---|
| 370 | giet_config.h | 
|---|
| 371 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 372 |  | 
|---|
| 373 | build/drivers/pic_driver.o: giet_drivers/pic_driver.c  \ | 
|---|
| 374 | giet_drivers/pic_driver.h  \ | 
|---|
| 375 | hard_config.h              \ | 
|---|
| 376 | giet_config.h | 
|---|
| 377 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 378 |  | 
|---|
| 379 | ################################ | 
|---|
| 380 | ### drivers library compilation | 
|---|
| 381 | build/drivers/libdrivers.a: $(DRIVERS_OBJS) | 
|---|
| 382 | $(AR) -rcs $@ $(DRIVERS_OBJS) | 
|---|
| 383 |  | 
|---|
| 384 | ########################## | 
|---|
| 385 | ### common compilation | 
|---|
| 386 | build/fat32/fat32.o: giet_fat32/fat32.c \ | 
|---|
| 387 | giet_fat32/fat32.h \ | 
|---|
| 388 | hard_config.h      \ | 
|---|
| 389 | giet_config.h | 
|---|
| 390 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 391 |  | 
|---|
| 392 | build/common/utils.o: giet_common/utils.c \ | 
|---|
| 393 | giet_common/utils.h \ | 
|---|
| 394 | hard_config.h       \ | 
|---|
| 395 | giet_config.h | 
|---|
| 396 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 397 |  | 
|---|
| 398 | build/common/kernel_locks.o: giet_common/kernel_locks.c \ | 
|---|
| 399 | giet_common/kernel_locks.h \ | 
|---|
| 400 | hard_config.h              \ | 
|---|
| 401 | giet_config.h | 
|---|
| 402 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 403 |  | 
|---|
| 404 | build/common/kernel_barriers.o: giet_common/kernel_barriers.c \ | 
|---|
| 405 | giet_common/kernel_barriers.h \ | 
|---|
| 406 | hard_config.h                 \ | 
|---|
| 407 | giet_config.h | 
|---|
| 408 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 409 |  | 
|---|
| 410 | build/common/tty0.o:  giet_common/tty0.c \ | 
|---|
| 411 | giet_common/tty0.h \ | 
|---|
| 412 | hard_config.h       \ | 
|---|
| 413 | giet_config.h | 
|---|
| 414 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 415 |  | 
|---|
| 416 | build/common/vmem.o: giet_common/vmem.c \ | 
|---|
| 417 | giet_common/vmem.h \ | 
|---|
| 418 | hard_config.h      \ | 
|---|
| 419 | giet_config.h | 
|---|
| 420 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 421 |  | 
|---|
| 422 | build/common/pmem.o: giet_common/pmem.c \ | 
|---|
| 423 | giet_common/pmem.h \ | 
|---|
| 424 | hard_config.h      \ | 
|---|
| 425 | giet_config.h | 
|---|
| 426 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 427 |  | 
|---|
| 428 | build/common/kernel_malloc.o: giet_common/kernel_malloc.c \ | 
|---|
| 429 | giet_common/kernel_malloc.h \ | 
|---|
| 430 | hard_config.h               \ | 
|---|
| 431 | giet_config.h | 
|---|
| 432 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 433 |  | 
|---|
| 434 | ######################## | 
|---|
| 435 | ### boot compilation | 
|---|
| 436 | ### Copy bootloader into sector 2 of disk image | 
|---|
| 437 | build/boot: | 
|---|
| 438 | mkdir $@ | 
|---|
| 439 |  | 
|---|
| 440 | build/boot/boot.elf: $(BOOT_OBJS)            \ | 
|---|
| 441 | giet_boot/boot.ld       \ | 
|---|
| 442 | build/drivers/libdrivers.a | build/boot | 
|---|
| 443 | $(LD) -o $@ -T giet_boot/boot.ld $(BOOT_OBJS) -Lbuild/drivers -ldrivers | 
|---|
| 444 | $(DU) -D $@ > $@.txt | 
|---|
| 445 | dd if=$@ of=$(DISK_IMAGE) seek=2 conv=notrunc | 
|---|
| 446 |  | 
|---|
| 447 | build/boot/boot.o: giet_boot/boot.c          \ | 
|---|
| 448 | giet_common/utils.h       \ | 
|---|
| 449 | giet_fat32/fat32.h        \ | 
|---|
| 450 | giet_common/vmem.h        \ | 
|---|
| 451 | hard_config.h             \ | 
|---|
| 452 | giet_config.h | 
|---|
| 453 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 454 |  | 
|---|
| 455 | build/boot/boot_entry.o: giet_boot/boot_entry.S \ | 
|---|
| 456 | hard_config.h | 
|---|
| 457 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 458 |  | 
|---|
| 459 | ######################### | 
|---|
| 460 | ### kernel compilation | 
|---|
| 461 | build/kernel/kernel.elf: $(KERNEL_OBJS)        \ | 
|---|
| 462 | giet_kernel/kernel.ld \ | 
|---|
| 463 | build/drivers/libdrivers.a | 
|---|
| 464 | $(LD) -o $@ -T giet_kernel/kernel.ld $(KERNEL_OBJS) -Lbuild/drivers -ldrivers | 
|---|
| 465 | $(DU) -D $@ > $@.txt | 
|---|
| 466 | mmd -o -i $(DISK_IMAGE) ::/build/kernel || true | 
|---|
| 467 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/kernel | 
|---|
| 468 |  | 
|---|
| 469 | build/kernel/%.o: giet_kernel/%.c    \ | 
|---|
| 470 | hard_config.h      \ | 
|---|
| 471 | giet_config.h | 
|---|
| 472 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 473 |  | 
|---|
| 474 | build/kernel/%.o: giet_kernel/%.s    \ | 
|---|
| 475 | hard_config.h      \ | 
|---|
| 476 | giet_config.h | 
|---|
| 477 | $(CC) $(GIET_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 478 |  | 
|---|
| 479 | ########################### | 
|---|
| 480 | ### user libs compilation | 
|---|
| 481 | build/libs/stdio.o: giet_libs/stdio.c \ | 
|---|
| 482 | giet_libs/stdio.h \ | 
|---|
| 483 | hard_config.h     \ | 
|---|
| 484 | giet_config.h | 
|---|
| 485 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< | 
|---|
| 486 |  | 
|---|
| 487 | build/libs/mwmr_channel.o: giet_libs/mwmr_channel.c \ | 
|---|
| 488 | giet_libs/mwmr_channel.h \ | 
|---|
| 489 | hard_config.h            \ | 
|---|
| 490 | giet_config.h | 
|---|
| 491 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< | 
|---|
| 492 |  | 
|---|
| 493 | build/libs/malloc.o: giet_libs/malloc.c         \ | 
|---|
| 494 | giet_libs/malloc.h         \ | 
|---|
| 495 | hard_config.h              \ | 
|---|
| 496 | giet_config.h | 
|---|
| 497 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< | 
|---|
| 498 |  | 
|---|
| 499 | build/libs/user_barrier.o: giet_libs/user_barrier.c \ | 
|---|
| 500 | giet_libs/user_barrier.h \ | 
|---|
| 501 | hard_config.h       \ | 
|---|
| 502 | giet_config.h | 
|---|
| 503 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< | 
|---|
| 504 |  | 
|---|
| 505 | build/libs/stdlib.o: giet_libs/stdlib.c \ | 
|---|
| 506 | giet_libs/stdlib.h \ | 
|---|
| 507 | hard_config.h      \ | 
|---|
| 508 | giet_config.h | 
|---|
| 509 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< | 
|---|
| 510 |  | 
|---|
| 511 | build/libs/string.o: giet_libs/string.c \ | 
|---|
| 512 | giet_libs/string.h \ | 
|---|
| 513 | hard_config.h      \ | 
|---|
| 514 | giet_config.h | 
|---|
| 515 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< | 
|---|
| 516 |  | 
|---|
| 517 | build/libs/user_lock.o: giet_libs/user_lock.c \ | 
|---|
| 518 | giet_libs/user_lock.h \ | 
|---|
| 519 | hard_config.h         \ | 
|---|
| 520 | giet_config.h | 
|---|
| 521 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< | 
|---|
| 522 |  | 
|---|
| 523 | build/libs/user_sqt_lock.o: giet_libs/user_sqt_lock.c \ | 
|---|
| 524 | giet_libs/user_sqt_lock.h \ | 
|---|
| 525 | giet_libs/user_lock.h     \ | 
|---|
| 526 | hard_config.h             \ | 
|---|
| 527 | giet_config.h | 
|---|
| 528 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< | 
|---|
| 529 |  | 
|---|
| 530 | build/libs/libmath.a: $(MATH_OBJ) | 
|---|
| 531 | $(AR) -rcs $@ $^ | 
|---|
| 532 |  | 
|---|
| 533 | build/libs/math/%.o: giet_libs/math/%.c giet_libs/math/math_private.h giet_libs/math.h | 
|---|
| 534 | $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< | 
|---|
| 535 |  | 
|---|
| 536 | ######################################## | 
|---|
| 537 | ### display application compilation | 
|---|
| 538 | build/display/display.elf: $(DISPLAY_OBJS) applications/display/display.ld hard_config.h | 
|---|
| 539 | $(LD) -o $@ -T applications/display/display.ld $(DISPLAY_OBJS) | 
|---|
| 540 | $(DU) -D $@ > $@.txt | 
|---|
| 541 | mmd -o -i $(DISK_IMAGE) ::/build/display || true | 
|---|
| 542 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/display | 
|---|
| 543 |  | 
|---|
| 544 | build/display/main.o: applications/display/main.c hard_config.h | 
|---|
| 545 | $(CC) $(USER_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 546 |  | 
|---|
| 547 | ######################################## | 
|---|
| 548 | ### router compilation | 
|---|
| 549 | build/router/router.elf: $(ROUTER_OBJS) applications/router/router.ld hard_config.h | 
|---|
| 550 | $(LD) -o $@ -T applications/router/router.ld $(ROUTER_OBJS) | 
|---|
| 551 | $(DU) -D $@ > $@.txt | 
|---|
| 552 | mmd -o -i $(DISK_IMAGE) ::/build/router || true | 
|---|
| 553 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/router | 
|---|
| 554 |  | 
|---|
| 555 | build/router/main.o: applications/router/main.c hard_config.h | 
|---|
| 556 | $(CC) $(USER_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 557 |  | 
|---|
| 558 | ######################################## | 
|---|
| 559 | ### hello compilation | 
|---|
| 560 | build/hello/hello.elf: $(HELLO_OBJS) applications/hello/hello.ld hard_config.h | 
|---|
| 561 | $(LD) -o $@ -T applications/hello/hello.ld $(HELLO_OBJS) | 
|---|
| 562 | $(DU) -D $@ > $@.txt | 
|---|
| 563 | mmd -o -i $(DISK_IMAGE) ::/build/hello || true | 
|---|
| 564 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/hello | 
|---|
| 565 |  | 
|---|
| 566 | build/hello/main.o: applications/hello/main.c hard_config.h | 
|---|
| 567 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< | 
|---|
| 568 |  | 
|---|
| 569 | ######################################## | 
|---|
| 570 | ### pgcd compilation | 
|---|
| 571 | build/pgcd/pgcd.elf: $(PGCD_OBJS) applications/pgcd/pgcd.ld hard_config.h | 
|---|
| 572 | $(LD) -o $@ -T applications/pgcd/pgcd.ld $(PGCD_OBJS) | 
|---|
| 573 | $(DU) -D $@ > $@.txt | 
|---|
| 574 | mmd -o -i $(DISK_IMAGE) ::/build/pgcd || true | 
|---|
| 575 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/pgcd | 
|---|
| 576 |  | 
|---|
| 577 | build/pgcd/main.o: applications/pgcd/main.c hard_config.h | 
|---|
| 578 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< | 
|---|
| 579 |  | 
|---|
| 580 | ######################################## | 
|---|
| 581 | ### gameoflife compilation | 
|---|
| 582 | build/gameoflife/gameoflife.elf: $(GAMEOFLIFE_OBJS) applications/gameoflife/gameoflife.ld | 
|---|
| 583 | $(LD) -o $@ -T applications/gameoflife/gameoflife.ld $(GAMEOFLIFE_OBJS) | 
|---|
| 584 | $(DU) -D $@ > $@.txt | 
|---|
| 585 | mmd -o -i $(DISK_IMAGE) ::/build/gameoflife || true | 
|---|
| 586 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/gameoflife | 
|---|
| 587 |  | 
|---|
| 588 | build/gameoflife/main.o: applications/gameoflife/main.c | 
|---|
| 589 | $(CC) $(USER_INCLUDE) $(CFLAGS) -O3 -c -o $@ $< | 
|---|
| 590 |  | 
|---|
| 591 | ######################################## | 
|---|
| 592 | ### dhrystone compilation | 
|---|
| 593 | build/dhrystone/dhrystone.elf: $(DHRYSTONE_OBJS) applications/dhrystone/dhrystone.ld hard_config.h | 
|---|
| 594 | $(LD) -o $@ -T applications/dhrystone/dhrystone.ld $(DHRYSTONE_OBJS) | 
|---|
| 595 | $(DU) -D $@ > $@.txt | 
|---|
| 596 | mmd -o -i $(DISK_IMAGE) ::/build/dhrystone || true | 
|---|
| 597 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/dhrystone | 
|---|
| 598 |  | 
|---|
| 599 | build/dhrystone/dhry_1.o: applications/dhrystone/dhry_1.c hard_config.h | 
|---|
| 600 | $(CC) $(USER_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 601 |  | 
|---|
| 602 | build/dhrystone/dhry_2.o: applications/dhrystone/dhry_2.c hard_config.h | 
|---|
| 603 | $(CC) $(USER_INCLUDE) $(CFLAGS)  -c -o $@ $< | 
|---|
| 604 |  | 
|---|
| 605 | ######################################## | 
|---|
| 606 | ### sort compilation | 
|---|
| 607 | build/sort/sort.elf: $(SORT_OBJS) applications/sort/sort.ld hard_config.h | 
|---|
| 608 | $(LD) -o $@ -T applications/sort/sort.ld $(SORT_OBJS) | 
|---|
| 609 | $(DU) -D $@ > $@.txt | 
|---|
| 610 | mmd -o -i $(DISK_IMAGE) ::/build/sort || true | 
|---|
| 611 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/sort | 
|---|
| 612 |  | 
|---|
| 613 | build/sort/main.o: applications/sort/main.c | 
|---|
| 614 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< | 
|---|
| 615 |  | 
|---|
| 616 | ######################################## | 
|---|
| 617 | ### transpose compilation | 
|---|
| 618 | build/transpose/transpose.elf: $(TRANSPOSE_OBJS) applications/transpose/transpose.ld hard_config.h | 
|---|
| 619 | $(LD) -o $@ -T applications/transpose/transpose.ld $(TRANSPOSE_OBJS) | 
|---|
| 620 | $(DU) -D $@ > $@.txt | 
|---|
| 621 | mmd -o -i $(DISK_IMAGE) ::/build/transpose || true | 
|---|
| 622 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/transpose | 
|---|
| 623 |  | 
|---|
| 624 | build/transpose/main.o: applications/transpose/main.c | 
|---|
| 625 | $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< | 
|---|
| 626 |  | 
|---|
| 627 | ######################################## | 
|---|
| 628 | ### convol compilation | 
|---|
| 629 | build/convol/convol.elf: $(CONVOL_OBJS) applications/convol/convol.ld hard_config.h | 
|---|
| 630 | $(LD) -o $@ -T applications/convol/convol.ld $(CONVOL_OBJS) | 
|---|
| 631 | $(DU) -D $@ > $@.txt | 
|---|
| 632 | mmd -o -i $(DISK_IMAGE) ::/build/convol || true | 
|---|
| 633 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/convol | 
|---|
| 634 |  | 
|---|
| 635 | build/convol/main.o: applications/convol/main.c | 
|---|
| 636 | $(CC) $(USER_INCLUDE) $(CFLAGS) -O0 -c -o $@ $< | 
|---|
| 637 |  | 
|---|
| 638 | ######################################## | 
|---|
| 639 | ### classif compilation | 
|---|
| 640 | build/classif/classif.elf: $(CLASSIF_OBJS) applications/classif/classif.ld hard_config.h | 
|---|
| 641 | $(LD) -o $@ -T applications/classif/classif.ld $(CLASSIF_OBJS) | 
|---|
| 642 | $(DU) -D $@ > $@.txt | 
|---|
| 643 | mmd -o -i $(DISK_IMAGE) ::/build/classif || true | 
|---|
| 644 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/classif | 
|---|
| 645 |  | 
|---|
| 646 | build/classif/main.o: applications/classif/main.c | 
|---|
| 647 | $(CC) $(USER_INCLUDE) $(CFLAGS) -O0 -c -o $@ $< | 
|---|
| 648 |  | 
|---|
| 649 | ######################################## | 
|---|
| 650 | ### coproc compilation | 
|---|
| 651 | build/coproc/coproc.elf: $(COPROC_OBJS) applications/coproc/coproc.ld hard_config.h | 
|---|
| 652 | $(LD) -o $@ -T applications/coproc/coproc.ld $(COPROC_OBJS) | 
|---|
| 653 | $(DU) -D $@ > $@.txt | 
|---|
| 654 | mmd -o -i $(DISK_IMAGE) ::/build/coproc || true | 
|---|
| 655 | mcopy -o -i $(DISK_IMAGE) $@ ::/build/coproc | 
|---|
| 656 |  | 
|---|
| 657 | build/coproc/main.o: applications/coproc/main.c | 
|---|
| 658 | $(CC) $(USER_INCLUDE) $(CFLAGS) -O0 -c -o $@ $< | 
|---|
| 659 |  | 
|---|
| 660 | ######################################## | 
|---|
| 661 | ### ocean compilation | 
|---|
| 662 | build/ocean/ocean.elf: applications/ocean/ocean.elf | 
|---|
| 663 | mv $< $@ | 
|---|
| 664 | $(DU) -D $@ > $@.txt | 
|---|
| 665 |  | 
|---|
| 666 | applications/ocean/ocean.elf: $(OCEAN_OBJS) | 
|---|
| 667 | cd applications/ocean/ && $(MAKE) | 
|---|
| 668 |  | 
|---|
| 669 | ######################################## | 
|---|
| 670 | ### clean | 
|---|
| 671 | clean: | 
|---|
| 672 | rm -f *.o *.elf *.bin *.txt core | 
|---|
| 673 | rm -f hard_config.h giet_vsegs.ld map.bin map.xml | 
|---|
| 674 | rm -rf build/ | 
|---|
| 675 | cd applications/ocean && $(MAKE) clean | 
|---|