Changeset 302 for soft/giet_vm/Makefile


Ignore:
Timestamp:
Apr 14, 2014, 6:47:07 PM (11 years ago)
Author:
cfuguet
Message:

Optimization in disk image generation

When disk image exists, we dont need to recreate it, we only
copy new files in it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/Makefile

    r300 r302  
     1-include build.mk
     2
    13export # export all variable to sub-Makefile
    24CC = mipsel-unknown-elf-gcc
     
    1113### partition sectors    = 524832
    1214
    13 MAP_XML     ?= mappings/4c_1p_iob_sort.xml
     15MAP_XML     ?= mappings/4c_1p_sort_leti.xml
    1416
    1517### Objects to be linked for kernel.elf
     
    123125               -I.
    124126
    125 all: map.bin                         \
     127DISK_IMAGE  := hdd/virt_hdd.dmg
     128
     129### Copy executable and miscellaneous files into disk image
     130### Copy bootloader into sector 2 of disk image
     131all: $(DISK_IMAGE)                   \
     132     $(MAP_XML)                      \
     133     giet_config.h                   \
     134     map.bin                         \
    126135     build/boot/boot.elf             \
    127136     build/kernel/kernel.elf         \
    128137     build/display/display.elf       \
    129      build/router/router.elf         \
    130138     build/hello/hello.elf           \
    131139     build/pgcd/pgcd.elf             \
     140     build/router/router.elf         \
    132141     build/dhrystone/dhrystone.elf   \
    133142     build/gameoflife/gameoflife.elf \
    134143     build/sort/sort.elf             \
    135144     build/transpose/transpose.elf   \
    136      hdd/virt_hdd.dmg
     145         
     146        mcopy -so -i $(DISK_IMAGE) build ::/
     147        mcopy -so -i $(DISK_IMAGE) hdd/misc ::/
     148        mcopy -so -i $(DISK_IMAGE) map.bin ::/
     149        dd if=build/boot/boot.elf of=$(DISK_IMAGE) seek=2 conv=notrunc
    137150
    138151### Disk image generation
    139152### This requires the generic LINUX/MacOS script "create_dmg" script
    140153### written by C.Fuguet. (should be installed in GIET-VM root directory).
    141 hdd/virt_hdd.dmg: map.bin                \
    142          build/boot/boot.elf             \
    143          build/kernel/kernel.elf         \
    144          build/display/display.elf       \
    145          build/hello/hello.elf           \
    146          build/pgcd/pgcd.elf             \
    147          build/router/router.elf         \
    148          build/dhrystone/dhrystone.elf   \
    149          build/gameoflife/gameoflife.elf \
    150          build/sort/sort.elf             \
    151          build/transpose/transpose.elf
    152 
    153 ### remove all content of virtual disk virt_hdd
    154         rm -rf hdd/virt_hdd/*
    155 ### copy content to virtual disk from build, misc and map.bin
    156 ### the boot.elf file is not copied on the virtual disk
    157         cp -r build hdd/virt_hdd
    158         rm -rf hdd/virt_hdd/build/boot
    159         cp -r hdd/misc hdd/virt_hdd
    160         cp map.bin  hdd/virt_hdd
    161 ### create temporary partition image
    162         ./create_dmg create hdd/virt_hdd $(basename $@)
    163 ### copy boot.elf into virtual disk image (sector 2)
    164         dd if=build/boot/boot.elf of=$@ seek=2 conv=notrunc
     154$(DISK_IMAGE):
     155        ./create_dmg create $(basename $(DISK_IMAGE))
    165156
    166157### mapping compilation
     
    455446        rm -rf build/transpose/*
    456447        rm -rf build/map.bin
    457         rm -rf hdd/virt_hdd/*
     448
     449distclean: clean
    458450        rm -rf hdd/virt_hdd.dmg
Note: See TracChangeset for help on using the changeset viewer.