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
10 # * IBM Corporation - initial implementation
11 # ****************************************************************************/
13 BOARD_TARGETS = tools_build romfs_build clients_build stage1 subdirs
16 COMMON_LIBS = libc libipmi libbootmsg libbases libnvram libelf libusb libbcm
21 .PHONY : subdirs $(SUBDIRS) clean distclean
25 include $(TOPCMNDIR)/make.rules
26 include $(TOPCMNDIR)/Makefile.gen
30 $(SUBDIRS): common-libs
31 @echo " ====== Building $@ ======"
32 $(MAKE) -C $@ $(MAKEARG)
35 @echo " ====== Building llfw ======"
36 $(MAKE) -C llfw RELEASE=-DRELEASE=\"\\\"$(RELEASE)\\\"\"
42 clean: clean_here clean_gen
43 @for dir in $(SUBDIRS); do \
44 $(MAKE) -C $$dir clean || exit 1; \
46 rm -f ../boot_rom.bin ../js2*.img
47 @$(MAKE) -C llfw clean
48 @$(MAKE) -C $(TOPCMNDIR)/clients/takeover clean
50 distclean: clean_here distclean_gen
51 @for dir in $(SUBDIRS); do \
52 $(MAKE) -C $$dir distclean || exit 1; \
54 rm -f ../boot_rom.bin ../js2*.img
56 $(MAKE) -C $(TOPCMNDIR)/clients/takeover distclean
59 $(MAKE) -C $(TOPCMNDIR)/clients/takeover
62 @rm -rf ../driver-$(RELEASE)
63 @mkdir -p ../driver-$(RELEASE)
65 .tar_gz: .driver_dirs takeover external_flasher
67 ../driver-$(RELEASE)/$(RELEASE)-js2x.bin
68 @mv ../boot_rom-$(FLASH_SIZE_MB)MB-BigEndian.bin \
69 ../driver-$(RELEASE)/$(RELEASE)-$(FLASH_SIZE_MB)MB-BigEndian.bin
70 @mv $(TOPCMNDIR)/clients/takeover/takeover.elf \
71 ../driver-$(RELEASE)/$(RELEASE)-takeover.bin
72 @cp ../VERSION ../driver-$(RELEASE)
73 @cp changes.txt ../driver-$(RELEASE)
74 @cd ../driver-$(RELEASE) && md5sum * > md5sum.txt
75 @chmod 644 ../driver-$(RELEASE)/*
76 @mv ../driver-$(RELEASE) ../driver-$(RELEASE)-`date +%Y-%h%d`
77 @tar czf ../driver-$(RELEASE)-`date +%Y-%h%d`.tar.gz \
78 ../driver-$(RELEASE)-`date +%Y-%h%d` > /dev/null 2>&1
79 @rm -rf ../driver-$(RELEASE)-`date +%Y-%h%d`
81 driver: driver_prep clean .tar_gz