Changeset 776
- Timestamp:
- Feb 4, 2016, 5:20:26 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/Makefile
r772 r776 28 28 applications/convol/convol.py \ 29 29 applications/coproc/coproc.py \ 30 applications/coremark/coremark.py \ 30 31 applications/display/display.py \ 31 32 applications/dhrystone/dhrystone.py \ … … 34 35 applications/ocean/ocean.py \ 35 36 applications/raycast/raycast.py \ 37 applications/rosenfeld/rosenfeld.py \ 36 38 applications/router/router.py \ 37 applications/rosenfeld/rosenfeld.py \38 39 applications/shell/shell.py \ 39 40 applications/sort/sort.py \ 40 applications/transpose/transpose.py \41 applications/coremark/coremark.py 42 43 # build the list of applications to be executed (used in the allrule)41 applications/transpose/transpose.py 42 43 44 # build the list of applications to be executed (used in the "compile" rule) 44 45 APPLIS_ELF := $(addsuffix /appli.elf,$(addprefix applications/,$(APPLIS))) 45 46 … … 53 54 54 55 ### Rules that don't build a target file 55 .PHONY: all dirs list extract clean clean-disk install-disk $(APPLIS_ELF) 56 .PHONY: compil \ 57 dirs \ 58 list \ 59 extract \ 60 clean \ 61 clean-disk \ 62 build/kernel/kernel.elf \ 63 build/boot/boot.elf \ 64 $(APPLIS_ELF) 56 65 57 66 ### Objects to be linked for the drivers library … … 133 142 134 143 CFLAGS = -Wall -ffreestanding -mno-gpopt -mips32 -g -O2 \ 135 -fno-delete-null-pointer-checks $(XCFLAGS)144 -fno-delete-null-pointer-checks 136 145 137 146 GIET_INCLUDE = -Igiet_boot \ … … 150 159 ### of the disk image used by the Giet-VM is not MS-DOS compliant. 151 160 ### Setting this variable prevents these checks. 161 152 162 MTOOLS_SKIP_CHECK := 1 153 163 154 164 ################################## 155 ### first rule executed (make all) 156 all: dirs \ 157 install-disk 165 ### first rule executed 166 ### compile boot.elf, kernel.elf, and selected appli.elf 167 ### update these .elf files on virtual disk 168 compile: dirs \ 169 hard_config.h \ 170 build/kernel/kernel.elf \ 171 build/boot/boot.elf \ 172 $(APPLIS_ELF) 158 173 mdir -/ -b -i $(DISK_IMAGE) ::/ 159 174 160 ######################################## #############161 ### create build directories 175 ######################################## 176 ### create build directories for giet_vm 162 177 dirs: 163 178 @mkdir -p build/boot … … 174 189 mdir -/ -w -i $(DISK_IMAGE) ::/ 175 190 191 ##################################################### 192 ### make a file system check for the the virtual disk 193 fsck: 194 fsck_msdos $(DISK_IMAGE) 195 176 196 ######################################################## 177 197 ### copy the files generated by the virtual prototype on 178 ### the virtual disk "home" directory to the giet_vm homedirectory198 ### the virtual disk "home" directory to the current directory 179 199 extract: 180 200 mcopy -o -i $(DISK_IMAGE) ::/home . 181 201 182 ######################################## 183 ### clean all binary files 202 #################################################### 203 ### delete all binary files from Unix File System 204 ### but does NOT modify the virtual disk 184 205 clean: 185 206 rm -f *.o *.elf *.bin *.txt core … … 189 210 cd applications/convol && $(MAKE) clean && cd ../.. 190 211 cd applications/coproc && $(MAKE) clean && cd ../.. 212 cd applications/coremark && $(MAKE) clean && cd ../.. 191 213 cd applications/display && $(MAKE) clean && cd ../.. 192 214 cd applications/dhrystone && $(MAKE) clean && cd ../.. … … 195 217 cd applications/ocean && $(MAKE) clean && cd ../.. 196 218 cd applications/raycast && $(MAKE) clean && cd ../.. 219 cd applications/rosenfeld && $(MAKE) clean && cd ../.. 197 220 cd applications/router && $(MAKE) clean && cd ../.. 198 cd applications/rosenfeld && $(MAKE) clean && cd ../..199 221 cd applications/shell && $(MAKE) clean && cd ../.. 200 222 cd applications/sort && $(MAKE) clean && cd ../.. 201 223 cd applications/transpose && $(MAKE) clean && cd ../.. 202 cd applications/coremark && $(MAKE) clean && cd ../.. 203 204 ######################################## 205 ### delete disk image 206 clean-disk: 207 rm -rf $(DISK_IMAGE) 208 209 ######################################## 210 ### Copy content in the disk image 211 ### create the three build / misc / home directories 212 ### store the images files into misc 213 install-disk: $(DISK_IMAGE) build/kernel/kernel.elf $(APPLIS_ELF) 214 mmd -o -i $< ::/bin || true 215 mmd -o -i $< ::/bin/kernel || true 216 mmd -o -i $< ::/bin/classif || true 217 mmd -o -i $< ::/bin/convol || true 218 mmd -o -i $< ::/bin/coproc || true 219 mmd -o -i $< ::/bin/dhrystone || true 220 mmd -o -i $< ::/bin/display || true 221 mmd -o -i $< ::/bin/gameoflife || true 222 mmd -o -i $< ::/bin/mjpeg || true 223 mmd -o -i $< ::/bin/ocean || true 224 mmd -o -i $< ::/bin/raycast || true 225 mmd -o -i $< ::/bin/router || true 226 mmd -o -i $< ::/bin/rosenfeld || true 227 mmd -o -i $< ::/bin/shell || true 228 mmd -o -i $< ::/bin/sort || true 229 mmd -o -i $< ::/bin/transpose || true 230 mmd -o -i $< ::/bin/coremark || true 231 mmd -o -i $< ::/misc || true 232 mmd -o -i $< ::/home || true 233 mcopy -o -i $< map.bin ::/ 234 mcopy -o -i $< build/kernel/kernel.elf ::/bin/kernel 235 mcopy -o -i $< applications/classif/appli.elf ::/bin/classif || true 236 mcopy -o -i $< applications/convol/appli.elf ::/bin/convol || true 237 mcopy -o -i $< applications/coproc/appli.elf ::/bin/coproc || true 238 mcopy -o -i $< applications/dhrystone/appli.elf ::/bin/dhrystone || true 239 mcopy -o -i $< applications/display/appli.elf ::/bin/display || true 240 mcopy -o -i $< applications/gameoflife/appli.elf ::/bin/gameoflife || true 241 mcopy -o -i $< applications/mjpeg/appli.elf ::/bin/mjpeg || true 242 mcopy -o -i $< applications/ocean/appli.elf ::/bin/ocean || true 243 mcopy -o -i $< applications/raycast/appli.elf ::/bin/raycast || true 244 mcopy -o -i $< applications/router/appli.elf ::/bin/router || true 245 mcopy -o -i $< applications/rosenfeld/appli.elf ::/bin/rosenfeld || true 246 mcopy -o -i $< applications/shell/appli.elf ::/bin/shell || true 247 mcopy -o -i $< applications/sort/appli.elf ::/bin/sort || true 248 mcopy -o -i $< applications/transpose/appli.elf ::/bin/transpose || true 249 mcopy -o -i $< applications/coremark/appli.elf ::/bin/coremark || true 250 mcopy -o -i $< images/images_128.raw ::/misc 251 mcopy -o -i $< images/philips_1024.raw ::/misc 252 mcopy -o -i $< images/lena_256.raw ::/misc 253 mcopy -o -i $< images/bridge_256.raw ::/misc 254 mcopy -o -i $< images/couple_512.raw ::/misc 255 mcopy -o -i $< images/door_32.raw ::/misc 256 mcopy -o -i $< images/handle_32.raw ::/misc 257 mcopy -o -i $< images/rock_32.raw ::/misc 258 mcopy -o -i $< images/wood_32.raw ::/misc 259 mcopy -o -i $< images/wood_32.raw ::/misc 260 mcopy -o -i $< images/plan_48.mjpg ::/misc 261 mcopy -o -i $< images/mandel_128.mjpg ::/misc 262 mcopy -o -i $< images/video_160_120.mjpg ::/misc 263 264 ######################### 265 ### Disk image generation 224 225 ##################################################### 226 ### delete all binary files from Unix File System 227 ### and build a new virtual disk : 228 ### - create the bin / misc / home directories 229 ### - create applications sub-directories 230 ### - store various files into misc 266 231 ### This requires the generic LINUX/MacOS script "create_dmg" script 267 232 ### written by C.Fuguet. (should be installed in GIET-VM root directory). 268 $(DISK_IMAGE): build/boot/boot.elf 269 rm -f $@ 270 ./create_dmg create $(basename $@) 271 dd if=$@ of=temp.dmg count=65536 272 mv temp.dmg $@ 273 dd if=build/boot/boot.elf of=$@ seek=2 conv=notrunc 233 clean-disk: clean 234 rm -f $(DISK_IMAGE) 235 ./create_dmg create $(basename $(DISK_IMAGE)) 236 dd if=$(DISK_IMAGE) of=temp.dmg count=65536 237 mv temp.dmg $(DISK_IMAGE) 238 mmd -o -i $(DISK_IMAGE) ::/bin || true 239 mmd -o -i $(DISK_IMAGE) ::/bin/kernel || true 240 mmd -o -i $(DISK_IMAGE) ::/bin/classif || true 241 mmd -o -i $(DISK_IMAGE) ::/bin/convol || true 242 mmd -o -i $(DISK_IMAGE) ::/bin/coproc || true 243 mmd -o -i $(DISK_IMAGE) ::/bin/coremark || true 244 mmd -o -i $(DISK_IMAGE) ::/bin/dhrystone || true 245 mmd -o -i $(DISK_IMAGE) ::/bin/display || true 246 mmd -o -i $(DISK_IMAGE) ::/bin/gameoflife || true 247 mmd -o -i $(DISK_IMAGE) ::/bin/mjpeg || true 248 mmd -o -i $(DISK_IMAGE) ::/bin/ocean || true 249 mmd -o -i $(DISK_IMAGE) ::/bin/raycast || true 250 mmd -o -i $(DISK_IMAGE) ::/bin/rosenfeld || true 251 mmd -o -i $(DISK_IMAGE) ::/bin/router || true 252 mmd -o -i $(DISK_IMAGE) ::/bin/shell || true 253 mmd -o -i $(DISK_IMAGE) ::/bin/sort || true 254 mmd -o -i $(DISK_IMAGE) ::/bin/transpose || true 255 mmd -o -i $(DISK_IMAGE) ::/misc || true 256 mmd -o -i $(DISK_IMAGE) ::/home || true 257 mcopy -o -i $(DISK_IMAGE) images/images_128.raw ::/misc 258 mcopy -o -i $(DISK_IMAGE) images/philips_1024.raw ::/misc 259 mcopy -o -i $(DISK_IMAGE) images/lena_256.raw ::/misc 260 mcopy -o -i $(DISK_IMAGE) images/bridge_256.raw ::/misc 261 mcopy -o -i $(DISK_IMAGE) images/couple_512.raw ::/misc 262 mcopy -o -i $(DISK_IMAGE) images/door_32.raw ::/misc 263 mcopy -o -i $(DISK_IMAGE) images/handle_32.raw ::/misc 264 mcopy -o -i $(DISK_IMAGE) images/rock_32.raw ::/misc 265 mcopy -o -i $(DISK_IMAGE) images/wood_32.raw ::/misc 266 mcopy -o -i $(DISK_IMAGE) images/wood_32.raw ::/misc 267 mcopy -o -i $(DISK_IMAGE) images/plan_48.mjpg ::/misc 268 mcopy -o -i $(DISK_IMAGE) images/mandel_128.mjpg ::/misc 269 mcopy -o -i $(DISK_IMAGE) images/video_160_120.mjpg ::/misc 270 mdir -/ -b -i $(DISK_IMAGE) ::/ 274 271 275 272 ######################################################################### 276 273 ### mapping generation: map.bin / map.xml / hard_config.h / giet_vsegs.ld 274 ### update map.bin on virtual disk 277 275 hard_config.h: $(ARCH)/arch.py $(APPLIS_PY) 278 276 giet_python/genmap --arch=$(ARCH) \ … … 287 285 $(GENMAP_APPLIS) \ 288 286 --xml=. 287 mcopy -o -i $(DISK_IMAGE) map.bin ::/ || true 289 288 290 289 ################################ … … 315 314 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 316 315 317 ######################## 316 ########################## 318 317 ### boot compilation 319 ### Copy boot loaderinto sector 2 of disk image318 ### Copy boot.elf into sector 2 of disk image 320 319 build/boot/boot.elf: $(BOOT_OBJS) \ 321 320 giet_boot/boot.ld \ … … 323 322 $(LD) -o $@ -T giet_boot/boot.ld $(BOOT_OBJS) -Lbuild/drivers -ldrivers 324 323 $(DU) -D $@ > $@.txt 324 dd if=build/boot/boot.elf of=$(DISK_IMAGE) seek=2 conv=notrunc 325 325 326 326 327 build/boot/boot.o: giet_boot/boot.c \ … … 336 337 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 337 338 338 ######################### 339 ### kernel compilation 339 ########################## 340 ### kernel.elf compilation 341 ### update kernel.elf on virtual disk 340 342 build/kernel/kernel.elf: $(KERNEL_OBJS) \ 341 343 giet_kernel/kernel.ld \ … … 343 345 $(LD) -o $@ -T giet_kernel/kernel.ld $(KERNEL_OBJS) -Lbuild/drivers -ldrivers 344 346 $(DU) -D $@ > $@.txt 347 mdel -i $(DISK_IMAGE) ::/bin/kernel/kernel.elf || true 348 mcopy -i $(DISK_IMAGE) build/kernel/kernel.elf ::/bin/kernel 345 349 346 350 build/kernel/%.o: giet_kernel/%.c \ … … 354 358 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 355 359 356 ########################### 360 ############################ 357 361 ### user library compilation 358 362 build/libs/%.o: giet_libs/%.c \ … … 365 369 $(AR) -rcs $@ $^ 366 370 367 ############################ ####371 ############################ 368 372 ### math library compilation 369 373 build/libs/math/%.o: giet_libs/math/%.c \ … … 375 379 $(AR) -rcs $@ $^ 376 380 377 ##################################### ###381 ##################################### 378 382 ### classif application compilation 383 ### update classif/appli.elf on virtual disk 379 384 applications/classif/appli.elf: build/libs/libuser.a 380 385 $(MAKE) -C applications/classif 381 382 ######################################## 386 mdel -i $(DISK_IMAGE) ::/bin/classif/appli.elf || true 387 mcopy -o -i $(DISK_IMAGE) applications/classif/appli.elf ::/bin/classif 388 389 390 #################################### 383 391 ### convol application compilation 392 ### update convol/appli.elf on virtual disk 384 393 applications/convol/appli.elf: build/libs/libuser.a 385 394 $(MAKE) -C applications/convol 395 mdel -i $(DISK_IMAGE) ::/bin/convol/appli.elf || true 396 mcopy -o -i $(DISK_IMAGE) applications/convol/appli.elf ::/bin/convol 386 397 387 398 ######################################## 388 399 ### coproc application compilation 400 ### update coproc/appli.elf on virtual disk 389 401 applications/coproc/appli.elf: build/libs/libuser.a 390 402 $(MAKE) -C applications/coproc 391 392 ######################################## 393 ### dhrystone application compilation 394 applications/dhrystone/appli.elf: build/libs/libuser.a 395 $(MAKE) -C applications/dhrystone 396 397 ######################################## 398 ### display application compilation 399 applications/display/appli.elf: build/libs/libuser.a 400 $(MAKE) -C applications/display 401 402 ######################################## 403 ### gameoflife application compilation 404 applications/gameoflife/appli.elf: build/libs/libuser.a 405 $(MAKE) -C applications/gameoflife 406 407 ######################################## 408 ### mjpeg application compilation 409 applications/mjpeg/appli.elf: build/libs/libuser.a 410 $(MAKE) -C applications/mjpeg 411 412 ######################################## 413 ### ocean application compilation 414 applications/ocean/appli.elf: build/libs/libmath.a build/libs/libuser.a 415 cd applications/ocean && $(MAKE) && cd ../.. 416 417 ######################################## 418 ### raycast application compilation 419 applications/raycast/appli.elf: build/libs/libmath.a build/libs/libuser.a 420 $(MAKE) -C applications/raycast 421 422 ######################################## 423 ### router application compilation 424 applications/router/appli.elf: build/libs/libuser.a 425 $(MAKE) -C applications/router 426 427 ######################################## 428 ### rosenfeld application compilation 429 applications/rosenfeld/appli.elf: build/libs/libmath.a build/libs/libuser.a 430 $(MAKE) -C applications/rosenfeld 431 432 ######################################## 433 ### shell application compilation 434 applications/shell/appli.elf: build/libs/libuser.a 435 $(MAKE) -C applications/shell 436 437 ######################################## 438 ### sort application compilation 439 applications/sort/appli.elf: build/libs/libuser.a 440 $(MAKE) -C applications/sort 441 442 ######################################## 443 ### transpose compilation 444 applications/transpose/appli.elf: build/libs/libuser.a 445 $(MAKE) -C applications/transpose 403 mdel -i $(DISK_IMAGE) ::/bin/coproc/appli.elf || true 404 mcopy -o -i $(DISK_IMAGE) applications/coproc/appli.elf ::/bin/coproc 446 405 447 406 ######################################## … … 449 408 applications/coremark/appli.elf: build/libs/libuser.a 450 409 $(MAKE) -C applications/coremark 451 410 mdel -i $(DISK_IMAGE) ::/bin/coremark/appli.elf || true 411 mcopy -o -i $(DISK_IMAGE) applications/coremark/appli.elf ::/bin/coremark 412 413 414 ######################################## 415 ### dhrystone application compilation 416 ### update dhrystone/appli.elf on virtual disk 417 applications/dhrystone/appli.elf: build/libs/libuser.a 418 $(MAKE) -C applications/dhrystone 419 mdel -i $(DISK_IMAGE) ::/bin/dhrystone/appli.elf || true 420 mcopy -o -i $(DISK_IMAGE) applications/dhtystone/appli.elf ::/bin/dhrystone 421 422 ######################################## 423 ### display application compilation 424 ### update display/appli.elf on virtual disk 425 applications/display/appli.elf: build/libs/libuser.a 426 $(MAKE) -C applications/display 427 mdel -i $(DISK_IMAGE) ::/bin/display/appli.elf || true 428 mcopy -o -i $(DISK_IMAGE) applications/display/appli.elf ::/bin/display 429 430 ######################################## 431 ### gameoflife application compilation 432 ### update gameoflife/appli.elf on virtual disk 433 applications/gameoflife/appli.elf: build/libs/libuser.a 434 $(MAKE) -C applications/gameoflife 435 mdel -i $(DISK_IMAGE) ::/bin/gameoflife/appli.elf || true 436 mcopy -o -i $(DISK_IMAGE) applications/gameoflife/appli.elf ::/bin/gameoflife 437 438 ######################################## 439 ### mjpeg application compilation 440 ### update mjpeg/appli.elf on virtual disk 441 applications/mjpeg/appli.elf: build/libs/libuser.a 442 $(MAKE) -C applications/mjpeg 443 mdel -i $(DISK_IMAGE) ::/bin/mjpeg/appli.elf || true 444 mcopy -o -i $(DISK_IMAGE) applications/mjpeg/appli.elf ::/bin/mjpeg 445 446 ######################################## 447 ### ocean application compilation 448 ### update ocean/appli.elf on virtual disk 449 applications/ocean/appli.elf: build/libs/libmath.a build/libs/libuser.a 450 cd applications/ocean && $(MAKE) && cd ../.. 451 mdel -i $(DISK_IMAGE) ::/bin/ocean/appli.elf || true 452 mcopy -o -i $(DISK_IMAGE) applications/ocean/appli.elf ::/bin/ocean 453 454 ######################################## 455 ### raycast application compilation 456 ### update raycast/appli.elf on virtual disk 457 applications/raycast/appli.elf: build/libs/libmath.a build/libs/libuser.a 458 $(MAKE) -C applications/raycast 459 mdel -i $(DISK_IMAGE) ::/bin/raycast/appli.elf || true 460 mcopy -o -i $(DISK_IMAGE) applications/raycast/appli.elf ::/bin/raycast 461 462 ######################################## 463 ### rosenfeld application compilation 464 ### update rosenfeld/appli.elf on virtual disk 465 applications/rosenfeld/appli.elf: build/libs/libuser.a 466 $(MAKE) -C applications/rosenfeld 467 mdel -i $(DISK_IMAGE) ::/bin/rosenfeld/appli.elf || true 468 mcopy -o -i $(DISK_IMAGE) applications/rosenfeld/appli.elf ::/bin/router 469 470 ######################################## 471 ### router application compilation 472 ### update router/appli.elf on virtual disk 473 applications/router/appli.elf: build/libs/libuser.a 474 $(MAKE) -C applications/router 475 mdel -i $(DISK_IMAGE) ::/bin/router/appli.elf || true 476 mcopy -o -i $(DISK_IMAGE) applications/router/appli.elf ::/bin/router 477 478 ######################################## 479 ### shell application compilation 480 ### update shell/appli.elf on virtual disk 481 applications/shell/appli.elf: build/libs/libuser.a 482 $(MAKE) -C applications/shell 483 mdel -i $(DISK_IMAGE) ::/bin/shell/appli.elf || true 484 mcopy -o -i $(DISK_IMAGE) applications/shell/appli.elf ::/bin/shell 485 486 ######################################## 487 ### sort application compilation 488 ### update sort/appli.elf on virtual disk 489 applications/sort/appli.elf: build/libs/libuser.a 490 $(MAKE) -C applications/sort 491 mdel -i $(DISK_IMAGE) ::/bin/sort/appli.elf || true 492 mcopy -o -i $(DISK_IMAGE) applications/sort/appli.elf ::/bin/sort 493 494 ######################################## 495 ### transpose compilation 496 ### update transpose/appli.elf on virtual disk 497 applications/transpose/appli.elf: build/libs/libuser.a 498 $(MAKE) -C applications/transpose 499 mdel -i $(DISK_IMAGE) ::/bin/transpose/appli.elf || true 500 mcopy -o -i $(DISK_IMAGE) applications/transpose/appli.elf ::/bin/transpose 501
Note: See TracChangeset
for help on using the changeset viewer.