Changeset 609 for soft/giet_vm/Makefile


Ignore:
Timestamp:
Jul 13, 2015, 5:02:08 PM (9 years ago)
Author:
guerin
Message:

Makefile: generate disk image in one place

This allows parallel builds. Clean up dependencies.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/Makefile

    r608 r609  
    3838
    3939### Rules that don't build a target file
    40 .PHONY: all dirs list extract clean clean-disk
    41 
    42 .NOTPARALLEL:
     40.PHONY: all dirs list extract clean clean-disk install-disk
    4341
    4442### Objects to be linked for the drivers library
     
    142140### first rule executed (make all)
    143141all: dirs                            \
    144      $(DISK_IMAGE)                   \
    145142     map.bin                         \
    146143     hard_config.h                   \
    147144     giet_vsegs.ld                   \
    148      build/boot/boot.elf             \
    149      build/kernel/kernel.elf         \
    150      $(APPLIS_ELF)
    151 
    152         mcopy -o -i $(DISK_IMAGE) map.bin ::/
     145     install-disk
    153146        mdir -/ -b -i $(DISK_IMAGE) ::/
    154147
     
    200193        rm -f $(DISK_IMAGE)
    201194
     195########################################
     196### Copy content in the disk image
     197### create the three build / misc / home directories
     198### store the images files into misc
     199install-disk: $(DISK_IMAGE) build/kernel/kernel.elf $(APPLIS_ELF)
     200        mmd -o -i $< ::/build               || true
     201        mmd -o -i $< ::/build/kernel        || true
     202        mmd -o -i $< ::/build/classif       || true
     203        mmd -o -i $< ::/build/convol        || true
     204        mmd -o -i $< ::/build/coproc        || true
     205        mmd -o -i $< ::/build/dhrystone     || true
     206        mmd -o -i $< ::/build/display       || true
     207        mmd -o -i $< ::/build/gameoflife    || true
     208        mmd -o -i $< ::/build/ocean         || true
     209        mmd -o -i $< ::/build/router        || true
     210        mmd -o -i $< ::/build/shell         || true
     211        mmd -o -i $< ::/build/sort          || true
     212        mmd -o -i $< ::/build/transpose     || true
     213        mmd -o -i $< ::/misc                || true
     214        mmd -o -i $< ::/home                || true
     215        mcopy -o -i $< map.bin ::/
     216        mcopy -o -i $< build/kernel/kernel.elf ::/build/kernel
     217        mcopy -o -i $< applications/classif/appli.elf ::/build/classif          || true
     218        mcopy -o -i $< applications/convol/appli.elf ::/build/convol            || true
     219        mcopy -o -i $< applications/coproc/appli.elf ::/build/coproc            || true
     220        mcopy -o -i $< applications/dhrystone/appli.elf ::/build/dhrystone      || true
     221        mcopy -o -i $< applications/display/appli.elf ::/build/display          || true
     222        mcopy -o -i $< applications/gameoflife/appli.elf ::/build/gameoflife    || true
     223        mcopy -o -i $< applications/ocean/appli.elf ::/build/ocean              || true
     224        mcopy -o -i $< applications/router/appli.elf ::/build/router            || true
     225        mcopy -o -i $< applications/shell/appli.elf ::/build/shell              || true
     226        mcopy -o -i $< applications/sort/appli.elf ::/build/sort                || true
     227        mcopy -o -i $< applications/transpose/appli.elf ::/build/transpose      || true
     228        mcopy -o -i $< images/images_128.raw ::/misc
     229        mcopy -o -i $< images/philips_1024.raw ::/misc
     230        mcopy -o -i $< images/lena_256.raw ::/misc
     231        mcopy -o -i $< images/bridge_256.raw ::/misc
     232        mcopy -o -i $< images/couple_512.raw ::/misc
     233
    202234#########################
    203235### Disk image generation
    204236### This requires the generic LINUX/MacOS script "create_dmg" script
    205237### written by C.Fuguet. (should be installed in GIET-VM root directory).
    206 ### create the three build / misc / home directories
    207 ### store the images files into misc
    208 $(DISK_IMAGE):
    209         ./create_dmg create $(basename $(DISK_IMAGE))
    210         dd if=$(DISK_IMAGE) of=temp.dmg count=65536
    211         mv temp.dmg $(DISK_IMAGE)
    212         mmd -o -i $(DISK_IMAGE) ::/build
    213         mmd -o -i $(DISK_IMAGE) ::/build/ocean
    214         mmd -o -i $(DISK_IMAGE) ::/misc
    215         mmd -o -i $(DISK_IMAGE) ::/home
    216         mcopy -o -i $(DISK_IMAGE) images/images_128.raw ::/misc
    217         mcopy -o -i $(DISK_IMAGE) images/philips_1024.raw ::/misc
    218         mcopy -o -i $(DISK_IMAGE) images/lena_256.raw ::/misc
    219         mcopy -o -i $(DISK_IMAGE) images/bridge_256.raw ::/misc
    220         mcopy -o -i $(DISK_IMAGE) images/couple_512.raw ::/misc
     238$(DISK_IMAGE): build/boot/boot.elf
     239        rm -f $@
     240        ./create_dmg create $(basename $@)
     241        dd if=$@ of=temp.dmg count=65536
     242        mv temp.dmg $@
     243        dd if=build/boot/boot.elf of=$@ seek=2 conv=notrunc
    221244
    222245#########################################################################
     
    266289### Copy bootloader into sector 2 of disk image
    267290build/boot/boot.elf: $(BOOT_OBJS)            \
    268                      $(DISK_IMAGE)           \
    269291                     giet_boot/boot.ld       \
    270292                     build/drivers/libdrivers.a
    271293        $(LD) -o $@ -T giet_boot/boot.ld $(BOOT_OBJS) -Lbuild/drivers -ldrivers
    272294        $(DU) -D $@ > $@.txt
    273         dd if=$@ of=$(DISK_IMAGE) seek=2 conv=notrunc
    274295
    275296build/boot/boot.o: giet_boot/boot.c          \
     
    288309### kernel compilation
    289310build/kernel/kernel.elf: $(KERNEL_OBJS)        \
    290                          $(DISK_IMAGE)         \
    291311                         giet_kernel/kernel.ld \
    292312                         build/drivers/libdrivers.a
    293313        $(LD) -o $@ -T giet_kernel/kernel.ld $(KERNEL_OBJS) -Lbuild/drivers -ldrivers
    294314        $(DU) -D $@ > $@.txt
    295         mmd -o -i $(DISK_IMAGE) ::/build/kernel || true
    296         mcopy -o -i $(DISK_IMAGE) $@ ::/build/kernel
    297315
    298316build/kernel/%.o: giet_kernel/%.c    \
     
    329347########################################
    330348### classif   application compilation
    331 applications/classif/appli.elf: build/libs/libuser.a | $(DISK_IMAGE)
     349applications/classif/appli.elf: build/libs/libuser.a
    332350        $(MAKE) -C applications/classif
    333         mmd -o -i $(DISK_IMAGE) ::/build/classif || true
    334         mcopy -o -i $(DISK_IMAGE) $@ ::/build/classif
    335351
    336352########################################
    337353### convol   application compilation
    338 applications/convol/appli.elf: build/libs/libuser.a | $(DISK_IMAGE)
     354applications/convol/appli.elf: build/libs/libuser.a
    339355        $(MAKE) -C applications/convol
    340         mmd -o -i $(DISK_IMAGE) ::/build/convol || true
    341         mcopy -o -i $(DISK_IMAGE) $@ ::/build/convol
    342356
    343357########################################
    344358### coproc   application compilation
    345 applications/coproc/appli.elf: build/libs/libuser.a | $(DISK_IMAGE)
     359applications/coproc/appli.elf: build/libs/libuser.a
    346360        $(MAKE) -C applications/coproc
    347         mmd -o -i $(DISK_IMAGE) ::/build/coproc || true
    348         mcopy -o -i $(DISK_IMAGE) $@ ::/build/coproc
    349361
    350362########################################
    351363### dhrystone   application compilation
    352 applications/dhrystone/appli.elf: build/libs/libuser.a | $(DISK_IMAGE)
     364applications/dhrystone/appli.elf: build/libs/libuser.a
    353365        $(MAKE) -C applications/dhrystone
    354         mmd -o -i $(DISK_IMAGE) ::/build/dhrystone || true
    355         mcopy -o -i $(DISK_IMAGE) $@ ::/build/dhrystone
    356366
    357367########################################
    358368### display  application compilation
    359 applications/display/appli.elf: build/libs/libuser.a | $(DISK_IMAGE)
     369applications/display/appli.elf: build/libs/libuser.a
    360370        $(MAKE) -C applications/display
    361         mmd -o -i $(DISK_IMAGE) ::/build/display || true
    362         mcopy -o -i $(DISK_IMAGE) $@ ::/build/display
    363371
    364372########################################
    365373### gameoflife  application compilation
    366 applications/gameoflife/appli.elf: build/libs/libuser.a | $(DISK_IMAGE)
     374applications/gameoflife/appli.elf: build/libs/libuser.a
    367375        $(MAKE) -C applications/gameoflife
    368         mmd -o -i $(DISK_IMAGE) ::/build/gameoflife || true
    369         mcopy -o -i $(DISK_IMAGE) $@ ::/build/gameoflife
    370376
    371377########################################
    372378### ocean  application compilation
    373 applications/ocean/appli.elf: build/libs/libmath.a  build/libs/libuser.a | $(DISK_IMAGE)
     379applications/ocean/appli.elf: build/libs/libmath.a  build/libs/libuser.a
    374380        cd applications/ocean && $(MAKE) && cd ../..
    375         mmd -o -i $(DISK_IMAGE) ::/build/ocean || true
    376         mcopy -o -i $(DISK_IMAGE) $@ ::/build/ocean
    377381
    378382########################################
    379383### router  application compilation
    380 applications/router/appli.elf: build/libs/libuser.a | $(DISK_IMAGE)
     384applications/router/appli.elf: build/libs/libuser.a
    381385        $(MAKE) -C applications/router
    382         mmd -o -i $(DISK_IMAGE) ::/build/router || true
    383         mcopy -o -i $(DISK_IMAGE) $@ ::/build/router
    384386
    385387########################################
    386388### shell  application compilation
    387 applications/shell/appli.elf: build/libs/libuser.a | $(DISK_IMAGE)
     389applications/shell/appli.elf: build/libs/libuser.a
    388390        $(MAKE) -C applications/shell
    389         mmd -o -i $(DISK_IMAGE) ::/build/shell || true
    390         mcopy -o -i $(DISK_IMAGE) $@ ::/build/shell
    391391
    392392########################################
    393393### sort  application compilation
    394 applications/sort/appli.elf: build/libs/libuser.a | $(DISK_IMAGE)
     394applications/sort/appli.elf: build/libs/libuser.a
    395395        $(MAKE) -C applications/sort
    396         mmd -o -i $(DISK_IMAGE) ::/build/sort || true
    397         mcopy -o -i $(DISK_IMAGE) $@ ::/build/sort
    398396
    399397########################################
    400398### transpose compilation
    401 applications/transpose/appli.elf: build/libs/libuser.a | $(DISK_IMAGE)
     399applications/transpose/appli.elf: build/libs/libuser.a
    402400        $(MAKE) -C applications/transpose
    403         mmd -o -i $(DISK_IMAGE) ::/build/transpose || true
    404         mcopy -o -i $(DISK_IMAGE) $@ ::/build/transpose
    405 
     401
Note: See TracChangeset for help on using the changeset viewer.