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