|
|
1.1 root 1: # *****************************************************************************
2: # * Copyright (c) 2004, 2008 IBM Corporation
3: # * All rights reserved.
4: # * This program and the accompanying materials
5: # * are made available under the terms of the BSD License
6: # * which accompanies this distribution, and is available at
7: # * http://www.opensource.org/licenses/bsd-license.php
8: # *
9: # * Contributors:
10: # * IBM Corporation - initial implementation
11: # ****************************************************************************/
12:
13:
14: MAKEARG = BOARD=$(BOARD) PLATFORM=$(PLATFORM) FLAG=$(FLAG) TARG=$(TARG)
15:
16: BUILDS = tools_build romfs_build
17:
18: include ../make.rules
19:
20: ifdef DRIVER
21: RELEASE=$(shell cat ../VERSION)
22: export DRIVER_NAME=$(shell cat ../VERSION | sed -e "s/-/./g" | awk -F . '{ printf("%s%02d%02d%1s%02s",$$1,$$2,$$3,$$4,$$5); }')
23: else
24: RELEASE="$(USER)@$(HOSTNAME)(private build)"
25: export DRIVER_NAME=HEAD
26: endif
27:
28:
29: DRVDATE=$(shell date +%Y-%h%d)
30:
31: FLASH_SIZE_MB = `echo $$[ $(FLASH_SIZE)/1024/1024 ]`
32:
33: DTB_ROMFS_FLAG ?= 0
34: DTB_ROMFS_ADDR ?= 0
35:
36: llfw_disassembly:
1.1.1.2 ! root 37: $(MAKE) -C $(LLFWBRDDIR) stage1.dis stage2.dis stageS.dis
1.1 root 38:
39: clients_build:
1.1.1.2 ! root 40: @echo " ====== Building clients ======"
! 41: $(MAKE) -C ../clients $(MAKEARG)
1.1 root 42:
43: other_licence_build:
1.1.1.2 ! root 44: $(MAKE) -C ../other-licence $(MAKEARG)
1.1 root 45:
46: tools_build:
1.1.1.2 ! root 47: $(MAKE) -C ../tools
1.1 root 48:
49: romfs_build:
1.1.1.2 ! root 50: $(MAKE) -C ../romfs/tools $(MAKEARG)
1.1 root 51:
52: ../build_info.img:
1.1.1.2 ! root 53: @echo "$(CC)" > ../build_info.img
! 54: @$(CC) -v >> ../build_info.img 2>&1
! 55: @$(LD) -V >> ../build_info.img 2>&1
1.1 root 56:
57: ../$(SUBBOARD).dtb:
1.1.1.2 ! root 58: @if [ -e dts/$(SUBBOARD).dts ]; then \
! 59: dtc -q -I dts -O dtb dts/$(SUBBOARD).dts > $@; \
! 60: fi
! 61:
! 62: boot_rom.bin: $(BUILDS) ../build_info.img ../$(SUBBOARD).dtb
! 63: @echo " ====== Building $@ ======"
! 64: @if [ -e $(ROMFSBRDDIR)/boot_rom.$(SUBBOARD).ffs ]; then \
! 65: cat $(ROMFSBRDDIR)/boot_rom.$(SUBBOARD).ffs > ../.boot_rom.ffs; \
! 66: else \
! 67: cat $(ROMFSBRDDIR)/boot_rom.ffs > ../.boot_rom.ffs; \
! 68: fi
! 69: @if [ -e $(PCDBRDDIR)/pcdfiles.ffs ]; then \
! 70: cat $(PCDBRDDIR)/pcdfiles.ffs >> ../.boot_rom.ffs; \
! 71: fi
! 72: cat $(SLOFBRDDIR)/OF.ffs >> ../.boot_rom.ffs
! 73: @echo build_info.img build_info.img 0 0 >> ../.boot_rom.ffs
! 74: @if [ -e ../$(SUBBOARD).dtb ]; then \
! 75: echo dtb $(SUBBOARD).dtb $(DTB_ROMFS_FLAG) \
! 76: $(DTB_ROMFS_ADDR) >> ../.boot_rom.ffs; \
! 77: fi
! 78: cd .. && ./romfs/tools/build_romfs $(ROMFS_OPTIONS) .boot_rom.ffs $@
! 79: cd .. && if [ -f [email protected] ]; then rm -f [email protected]; gzip -9 $@ ; fi
! 80: rm -f ../.boot_rom.*ffs
! 81: rm -f ../$(SUBBOARD).dtb
1.1 root 82:
83:
84: external_flasher: ../boot_rom.bin
1.1.1.2 ! root 85: ../tools/make-flasher-image.sh $(FLASH_SIZE) ../boot_rom.bin \
! 86: ../boot_rom-$(FLASH_SIZE_MB)MB-BigEndian.bin
1.1 root 87:
88: driver_dirs:
1.1.1.2 ! root 89: @rm -rf ../driver-$(RELEASE)
! 90: @mkdir -p ../driver-$(RELEASE)/{rom,l2b,disassemblies}
1.1 root 91:
92: driver_prep:
1.1.1.2 ! root 93: @echo "Building driver "$(RELEASE)" for $(BOARD)"
1.1 root 94:
95: copy_disassemblies: llfw_disassembly
1.1.1.2 ! root 96: cp $(LLFWBRDDIR)/stage1.dis \
! 97: ../driver-$(RELEASE)/disassemblies/$(RELEASE)-stage1.dis
! 98: cp $(LLFWBRDDIR)/stage2.dis \
! 99: ../driver-$(RELEASE)/disassemblies/$(RELEASE)-stage2.dis
! 100: cp $(LLFWBRDDIR)/stageS.dis \
! 101: ../driver-$(RELEASE)/disassemblies/$(RELEASE)-stageS.dis
! 102: cp $(LLFWBRDDIR)/meminit.dis \
! 103: ../driver-$(RELEASE)/disassemblies/$(RELEASE)-meminit.dis
! 104: @if [ -e ../clients/snk/client.dis ]; then cp ../clients/snk/client.dis \
! 105: ../driver-$(RELEASE)/disassemblies/$(RELEASE)-client.dis; fi
1.1 root 106:
107: copy_driver: copy_disassemblies external_flasher
1.1.1.2 ! root 108: mv ../boot_rom-$(FLASH_SIZE_MB)MB-BigEndian.bin \
! 109: ../driver-$(RELEASE)/rom/$(RELEASE)-boot_rom-$(FLASH_SIZE_MB)MB-BigEndian.bin
! 110: mv ../boot_rom.bin \
! 111: ../driver-$(RELEASE)/rom/$(RELEASE)-boot_rom.bin
! 112: if [ -e ../boot_l2-dd2.ad ]; then \
! 113: mv ../boot_l2-dd2.ad ../driver-$(RELEASE)/l2b/; \
! 114: else \
! 115: mv ../boot_l2.ad ../driver-$(RELEASE)/l2b/; \
! 116: fi
! 117: mv ../boot_xdr.bin ../driver-$(RELEASE)/l2b/
! 118: cp ../VERSION ../driver-$(RELEASE)
! 119: cd ../driver-$(RELEASE) && md5sum rom/*.bin > md5sum.txt
1.1 root 120:
121: tar_gz: copy_driver
1.1.1.2 ! root 122: @cp -a ../driver-$(RELEASE) ../driver-$(RELEASE)-$(DRVDATE)-devel
! 123: tar czf ../driver-$(RELEASE)-$(DRVDATE)-devel.tar.gz \
! 124: ../driver-$(RELEASE)-$(DRVDATE)-devel > /dev/null 2>&1
! 125: @rm -rf ../driver-$(RELEASE)-$(DRVDATE)-devel
! 126: @rm -rf ../driver-$(RELEASE)/disassemblies
! 127: @mv ../driver-$(RELEASE) ../driver-$(RELEASE)-$(DRVDATE)
! 128: tar czf ../driver-$(RELEASE)-$(DRVDATE).tar.gz \
! 129: ../driver-$(RELEASE)-$(DRVDATE) > /dev/null 2>&1
! 130: @rm -rf ../driver-$(RELEASE)-$(DRVDATE)
1.1 root 131:
132: clean_top:
1.1.1.2 ! root 133: @rm -f ../build_info.img
! 134: @rm -f ../.crc_flash
! 135: @rm -f ../$(SUBBOARD).dtb
1.1 root 136:
137: clean_gen: clean_top
1.1.1.2 ! root 138: $(MAKE) -C ../romfs/tools BOARD=$(BOARD) clean
! 139: $(MAKE) -C ../tools clean
! 140: $(MAKE) -C ../other-licence clean
! 141: $(MAKE) -C ../clients clean
! 142: @for dir in $(COMMON_LIBS); do \
! 143: $(MAKE) -C ../lib/$$dir clean || exit 1; \
! 144: done
1.1 root 145:
146: distclean_gen: clean_top
1.1.1.2 ! root 147: $(MAKE) -C ../romfs/tools BOARD=$(BOARD) distclean
! 148: $(MAKE) -C ../tools distclean
! 149: $(MAKE) -C ../other-licence distclean
! 150: $(MAKE) -C ../clients distclean
! 151: @for dir in $(COMMON_LIBS); do \
! 152: $(MAKE) -C ../lib/$$dir distclean || exit 1; \
! 153: done
1.1 root 154:
155: common-libs:
1.1.1.2 ! root 156: @echo " ====== Building common libraries ======"
! 157: $(MAKE) -C $(LIBCMNDIR) $(COMMON_LIBS)
1.1 root 158:
159: board-libs:
1.1.1.2 ! root 160: $(MAKE) -C lib $(MAKEARG)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.