diff options
author | Thomas Huth <thuth@linux.vnet.ibm.com> | 2011-09-06 14:38:26 +0200 |
---|---|---|
committer | Thomas Huth <thuth@linux.vnet.ibm.com> | 2011-10-12 12:50:05 +0200 |
commit | f227b3301221bb1bbcd30d4739115a875fb1c434 (patch) | |
tree | 3f37a4ced8e7b35b5df85db521bd65abef8fc4b1 /Makefile.gen | |
parent | 1645f050f8a77040c1db0617d729615117fb089b (diff) | |
download | SLOF-f227b3301221bb1bbcd30d4739115a875fb1c434.zip SLOF-f227b3301221bb1bbcd30d4739115a875fb1c434.tar.gz SLOF-f227b3301221bb1bbcd30d4739115a875fb1c434.tar.bz2 |
Cleaned up Makefiles
Replaced "make" by "$(MAKE)" to be able to built in parallel, fixed
the indentation of some rules and removed some unused targets.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Diffstat (limited to 'Makefile.gen')
-rw-r--r-- | Makefile.gen | 233 |
1 files changed, 90 insertions, 143 deletions
diff --git a/Makefile.gen b/Makefile.gen index 3c5d116..69bcdf1 100644 --- a/Makefile.gen +++ b/Makefile.gen @@ -34,180 +34,127 @@ DTB_ROMFS_FLAG ?= 0 DTB_ROMFS_ADDR ?= 0 llfw_disassembly: - make -C $(LLFWBRDDIR) stage1.dis stage2.dis stageS.dis + $(MAKE) -C $(LLFWBRDDIR) stage1.dis stage2.dis stageS.dis clients_build: - @echo " ====== Building clients ======" - make -C ../clients $(MAKEARG) + @echo " ====== Building clients ======" + $(MAKE) -C ../clients $(MAKEARG) other_licence_build: - make -C ../other-licence $(MAKEARG) + $(MAKE) -C ../other-licence $(MAKEARG) tools_build: - make -C ../tools + $(MAKE) -C ../tools romfs_build: - make -C ../romfs/tools $(MAKEARG) + $(MAKE) -C ../romfs/tools $(MAKEARG) ../build_info.img: - @echo "$(CC)" > ../build_info.img - @$(CC) -v >> ../build_info.img 2>&1 - @$(LD) -V >> ../build_info.img 2>&1 + @echo "$(CC)" > ../build_info.img + @$(CC) -v >> ../build_info.img 2>&1 + @$(LD) -V >> ../build_info.img 2>&1 ../$(SUBBOARD).dtb: - @if [ -e dts/$(SUBBOARD).dts ]; then \ - dtc -q -I dts -O dtb dts/$(SUBBOARD).dts > $@; \ - fi - -boot_rom.bin boot_xdr.bin: $(BUILDS) ../build_info.img ../$(SUBBOARD).dtb -ifeq ($(DO_COMPRESS),1) - - @echo " ====== Building packed $@ ======" - @if [ -e $(ROMFSBRDDIR)/boot_rom.$(SUBBOARD).ffs ]; then \ - cat $(ROMFSBRDDIR)/boot_rom.$(SUBBOARD).ffs > ../.boot_rom.ffs; \ - cat $(ROMFSBRDDIR)/boot_rom.$(SUBBOARD).pack.ffs > ../.boot_rom.pack.ffs; \ - else \ - cat $(ROMFSBRDDIR)/boot_rom.ffs > ../.boot_rom.ffs; \ - cat $(ROMFSBRDDIR)/boot_rom.pack.ffs > ../.boot_rom.pack.ffs; \ - fi - @if [ -e $(PCDBRDDIR)/pcdfiles.ffs ]; then \ - cat $(PCDBRDDIR)/pcdfiles.ffs >> ../.boot_rom.ffs; \ - cat $(PCDBRDDIR)/pcdfiles.ffs >> ../.boot_rom.pack.ffs; \ - fi - - @echo "romfs.pack boot_rom.bin.pack.nv 0 0" >> ../.boot_rom.ffs - - cat $(SLOFBRDDIR)/OF.ffs >> ../.boot_rom.pack.ffs - @echo build_info.img build_info.img 0 0 >> ../.boot_rom.pack.ffs - @if [ -e ../$(SUBBOARD).dtb ]; then \ - echo dtb $(SUBBOARD).dtb $(DTB_ROMFS_FLAG) \ - $(DTB_ROMFS_ADDR) >> ../.boot_rom.pack.ffs; \ - fi; - cd .. && ./romfs/tools/build_romfs $(ROMFS_OPTIONS) .boot_rom.pack.ffs boot_rom.bin.pack - cd .. && ./tools/pknova -q boot_rom.bin.pack boot_rom.bin.pack.nv; - cd .. && ./romfs/tools/build_romfs $(ROMFS_OPTIONS) .boot_rom.ffs $@ - if [ "$@" = "boot_rom.bin" ]; then \ - rm ../boot_rom.bin.pack; \ - rm ../boot_rom.bin.pack.nv; \ - fi; -else - @echo " ====== Building $@ ======" - @if [ -e $(ROMFSBRDDIR)/boot_rom.$(SUBBOARD).ffs ]; then \ - cat $(ROMFSBRDDIR)/boot_rom.$(SUBBOARD).ffs > ../.boot_rom.ffs; \ - else \ - cat $(ROMFSBRDDIR)/boot_rom.ffs > ../.boot_rom.ffs; \ - fi - @if [ -e $(PCDBRDDIR)/pcdfiles.ffs ]; then \ - cat $(PCDBRDDIR)/pcdfiles.ffs >> ../.boot_rom.ffs; \ - fi - cat $(SLOFBRDDIR)/OF.ffs >> ../.boot_rom.ffs - @echo build_info.img build_info.img 0 0 >> ../.boot_rom.ffs - @if [ -e ../$(SUBBOARD).dtb ]; then \ - echo dtb $(SUBBOARD).dtb $(DTB_ROMFS_FLAG) \ - $(DTB_ROMFS_ADDR) >> ../.boot_rom.ffs; \ - fi - @if [ -e slik.elf ]; then \ - echo "slik.elf available ..."; \ - echo slik board-$(BOARD)/slik.elf 0 0 >> \ - ../.boot_rom.ffs; \ - fi - cd .. && ./romfs/tools/build_romfs $(ROMFS_OPTIONS) .boot_rom.ffs $@ -endif - cd .. && if [ -f $@.gz ]; then rm -f $@.gz; gzip -9 $@ ; fi - rm -f ../.boot_rom.*ffs - rm -f ../$(SUBBOARD).dtb - -../boot_l2b.bin: $(BUILDS) ../romfs/copyright.img ../$(SUBBOARD).dtb - @if [ -e $(ROMFSBRDDIR)/boot_l2.$(SUBBOARD).ffs ]; then \ - cd .. && ./romfs/tools/build_romfs $(ROMFS_OPTIONS) $(ROMFSBRDDIR)/boot_l2.$(SUBBOARD).ffs boot_l2b.bin; \ - else \ - cd .. && ./romfs/tools/build_romfs $(ROMFS_OPTIONS) $(ROMFSBRDDIR)/boot_l2.ffs boot_l2b.bin; \ - fi - @if [ -e ../$(SUBBOARD).dtb ]; then \ - echo dtb $(SUBBOARD).dtb $(DTB_ROMFS_FLAG) \ - $(DTB_ROMFS_ADDR) >> ../.boot_rom.ffs; \ - fi - rm -f ../$(SUBBOARD).dtb - -boot_l2.ad boot_l2-dd2.ad: ../boot_l2b.bin - @cd ../tools && ./elf2l2 dd2 ../boot_l2b.bin 0 ../$@ + @if [ -e dts/$(SUBBOARD).dts ]; then \ + dtc -q -I dts -O dtb dts/$(SUBBOARD).dts > $@; \ + fi + +boot_rom.bin: $(BUILDS) ../build_info.img ../$(SUBBOARD).dtb + @echo " ====== Building $@ ======" + @if [ -e $(ROMFSBRDDIR)/boot_rom.$(SUBBOARD).ffs ]; then \ + cat $(ROMFSBRDDIR)/boot_rom.$(SUBBOARD).ffs > ../.boot_rom.ffs; \ + else \ + cat $(ROMFSBRDDIR)/boot_rom.ffs > ../.boot_rom.ffs; \ + fi + @if [ -e $(PCDBRDDIR)/pcdfiles.ffs ]; then \ + cat $(PCDBRDDIR)/pcdfiles.ffs >> ../.boot_rom.ffs; \ + fi + cat $(SLOFBRDDIR)/OF.ffs >> ../.boot_rom.ffs + @echo build_info.img build_info.img 0 0 >> ../.boot_rom.ffs + @if [ -e ../$(SUBBOARD).dtb ]; then \ + echo dtb $(SUBBOARD).dtb $(DTB_ROMFS_FLAG) \ + $(DTB_ROMFS_ADDR) >> ../.boot_rom.ffs; \ + fi + cd .. && ./romfs/tools/build_romfs $(ROMFS_OPTIONS) .boot_rom.ffs $@ + cd .. && if [ -f $@.gz ]; then rm -f $@.gz; gzip -9 $@ ; fi + rm -f ../.boot_rom.*ffs + rm -f ../$(SUBBOARD).dtb + external_flasher: ../boot_rom.bin - ../tools/make-flasher-image.sh $(FLASH_SIZE) ../boot_rom.bin \ - ../boot_rom-$(FLASH_SIZE_MB)MB-BigEndian.bin + ../tools/make-flasher-image.sh $(FLASH_SIZE) ../boot_rom.bin \ + ../boot_rom-$(FLASH_SIZE_MB)MB-BigEndian.bin driver_dirs: - @rm -rf ../driver-$(RELEASE) - @mkdir -p ../driver-$(RELEASE)/{rom,l2b,disassemblies} + @rm -rf ../driver-$(RELEASE) + @mkdir -p ../driver-$(RELEASE)/{rom,l2b,disassemblies} driver_prep: - @echo "Building driver "$(RELEASE)" for $(BOARD)" + @echo "Building driver "$(RELEASE)" for $(BOARD)" copy_disassemblies: llfw_disassembly - cp $(LLFWBRDDIR)/stage1.dis \ - ../driver-$(RELEASE)/disassemblies/$(RELEASE)-stage1.dis - cp $(LLFWBRDDIR)/stage2.dis \ - ../driver-$(RELEASE)/disassemblies/$(RELEASE)-stage2.dis - cp $(LLFWBRDDIR)/stageS.dis \ - ../driver-$(RELEASE)/disassemblies/$(RELEASE)-stageS.dis - cp $(LLFWBRDDIR)/meminit.dis \ - ../driver-$(RELEASE)/disassemblies/$(RELEASE)-meminit.dis - @if [ -e ../clients/snk/client.dis ]; then cp ../clients/snk/client.dis \ - ../driver-$(RELEASE)/disassemblies/$(RELEASE)-client.dis; fi + cp $(LLFWBRDDIR)/stage1.dis \ + ../driver-$(RELEASE)/disassemblies/$(RELEASE)-stage1.dis + cp $(LLFWBRDDIR)/stage2.dis \ + ../driver-$(RELEASE)/disassemblies/$(RELEASE)-stage2.dis + cp $(LLFWBRDDIR)/stageS.dis \ + ../driver-$(RELEASE)/disassemblies/$(RELEASE)-stageS.dis + cp $(LLFWBRDDIR)/meminit.dis \ + ../driver-$(RELEASE)/disassemblies/$(RELEASE)-meminit.dis + @if [ -e ../clients/snk/client.dis ]; then cp ../clients/snk/client.dis \ + ../driver-$(RELEASE)/disassemblies/$(RELEASE)-client.dis; fi copy_driver: copy_disassemblies external_flasher - mv ../boot_rom-$(FLASH_SIZE_MB)MB-BigEndian.bin \ - ../driver-$(RELEASE)/rom/$(RELEASE)-boot_rom-$(FLASH_SIZE_MB)MB-BigEndian.bin - mv ../boot_rom.bin \ - ../driver-$(RELEASE)/rom/$(RELEASE)-boot_rom.bin - if [ -e ../boot_l2-dd2.ad ]; then \ - mv ../boot_l2-dd2.ad \ - ../driver-$(RELEASE)/l2b/; \ - else \ - mv ../boot_l2.ad \ - ../driver-$(RELEASE)/l2b/; fi - mv ../boot_xdr.bin \ - ../driver-$(RELEASE)/l2b/ - cp ../VERSION ../driver-$(RELEASE) - cd ../driver-$(RELEASE) && md5sum rom/*.bin > md5sum.txt + mv ../boot_rom-$(FLASH_SIZE_MB)MB-BigEndian.bin \ + ../driver-$(RELEASE)/rom/$(RELEASE)-boot_rom-$(FLASH_SIZE_MB)MB-BigEndian.bin + mv ../boot_rom.bin \ + ../driver-$(RELEASE)/rom/$(RELEASE)-boot_rom.bin + if [ -e ../boot_l2-dd2.ad ]; then \ + mv ../boot_l2-dd2.ad ../driver-$(RELEASE)/l2b/; \ + else \ + mv ../boot_l2.ad ../driver-$(RELEASE)/l2b/; \ + fi + mv ../boot_xdr.bin ../driver-$(RELEASE)/l2b/ + cp ../VERSION ../driver-$(RELEASE) + cd ../driver-$(RELEASE) && md5sum rom/*.bin > md5sum.txt tar_gz: copy_driver - @cp -a ../driver-$(RELEASE) ../driver-$(RELEASE)-$(DRVDATE)-devel - tar czf ../driver-$(RELEASE)-$(DRVDATE)-devel.tar.gz \ - ../driver-$(RELEASE)-$(DRVDATE)-devel > /dev/null 2>&1 - @rm -rf ../driver-$(RELEASE)-$(DRVDATE)-devel - @rm -rf ../driver-$(RELEASE)/disassemblies - @mv ../driver-$(RELEASE) ../driver-$(RELEASE)-$(DRVDATE) - tar czf ../driver-$(RELEASE)-$(DRVDATE).tar.gz \ - ../driver-$(RELEASE)-$(DRVDATE) > /dev/null 2>&1 - @rm -rf ../driver-$(RELEASE)-$(DRVDATE) + @cp -a ../driver-$(RELEASE) ../driver-$(RELEASE)-$(DRVDATE)-devel + tar czf ../driver-$(RELEASE)-$(DRVDATE)-devel.tar.gz \ + ../driver-$(RELEASE)-$(DRVDATE)-devel > /dev/null 2>&1 + @rm -rf ../driver-$(RELEASE)-$(DRVDATE)-devel + @rm -rf ../driver-$(RELEASE)/disassemblies + @mv ../driver-$(RELEASE) ../driver-$(RELEASE)-$(DRVDATE) + tar czf ../driver-$(RELEASE)-$(DRVDATE).tar.gz \ + ../driver-$(RELEASE)-$(DRVDATE) > /dev/null 2>&1 + @rm -rf ../driver-$(RELEASE)-$(DRVDATE) clean_top: - @rm -f ../build_info.img - @rm -f ../.crc_flash - @rm -f ../$(SUBBOARD).dtb + @rm -f ../build_info.img + @rm -f ../.crc_flash + @rm -f ../$(SUBBOARD).dtb clean_gen: clean_top - make -C ../romfs/tools BOARD=$(BOARD) clean - make -C ../tools clean - make -C ../other-licence clean - make -C ../clients clean - @for dir in $(COMMON_LIBS); do \ - $(MAKE) -C ../lib/$$dir clean || exit 1; \ - done + $(MAKE) -C ../romfs/tools BOARD=$(BOARD) clean + $(MAKE) -C ../tools clean + $(MAKE) -C ../other-licence clean + $(MAKE) -C ../clients clean + @for dir in $(COMMON_LIBS); do \ + $(MAKE) -C ../lib/$$dir clean || exit 1; \ + done distclean_gen: clean_top - make -C ../romfs/tools BOARD=$(BOARD) distclean - make -C ../tools distclean - make -C ../other-licence distclean - make -C ../clients distclean - @for dir in $(COMMON_LIBS); do \ - $(MAKE) -C ../lib/$$dir distclean || exit 1; \ - done + $(MAKE) -C ../romfs/tools BOARD=$(BOARD) distclean + $(MAKE) -C ../tools distclean + $(MAKE) -C ../other-licence distclean + $(MAKE) -C ../clients distclean + @for dir in $(COMMON_LIBS); do \ + $(MAKE) -C ../lib/$$dir distclean || exit 1; \ + done common-libs: - @echo " ====== Building common libraries ======" - $(MAKE) -C $(LIBCMNDIR) $(COMMON_LIBS) + @echo " ====== Building common libraries ======" + $(MAKE) -C $(LIBCMNDIR) $(COMMON_LIBS) board-libs: - $(MAKE) -C lib $(MAKEARG) + $(MAKE) -C lib $(MAKEARG) |