|
|
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: include make.rules
14:
15: STD_BOARDS = $(shell targets=""; \
16: for a in `echo board-*`; do \
17: if [ -e $$a/config ]; then \
18: targets="$$targets $$a"; \
19: else \
20: cd $$a; \
21: for b in `echo config* | sed -e s/config.//g`; do \
22: if [ "X$$b" != "Xsimics" ]; then \
23: if [ "X$$b" != "X`echo $$a|sed -e s/board-//g`" ]; then \
24: targets="$$targets $$a-$$b"; \
25: else \
26: targets="$$targets $$b"; \
27: fi fi \
28: done; \
29: cd ..; \
30: fi; \
31: done; \
32: echo $$targets | sed -e s/board-//g)
33:
34: all:
35: @if [ ! -f .target ]; then \
36: echo "Please specify a build target:"; \
37: echo " $(STD_BOARDS)"; \
38: exit 1; \
39: fi
1.1.1.2 ! root 40: @$(MAKE) `cat .target`
1.1 root 41:
42: rom:
43: @echo "******* Build $(BOARD) System ********"
44: @echo $(BOARD) > .target
1.1.1.2 ! root 45: @$(MAKE) -C board-$(BOARD)
1.1 root 46: @$(RM) -f .crc_flash
47: rw:
48: @echo "******* Build $(BOARD) system (RISCWatch boot) ********"
49: @echo $(BOARD) > .target
1.1.1.2 ! root 50: @$(MAKE) -C board-$(BOARD) l2b
1.1 root 51: @$(RM) -f .crc_flash
52:
53: $(STD_BOARDS):
54: @echo "******** Building $@ system ********"
55: @if [ -f .target ]; then \
56: if [ `cat .target` != $@ ]; then \
57: echo "Configuration changed - cleaning up first..."; \
1.1.1.2 ! root 58: $(MAKE) distclean; \
1.1 root 59: echo $@ > .target; \
60: fi; \
61: else \
62: echo $@ > .target; \
63: fi
64: @b=`echo $@ | grep "-"`; \
65: if [ -n "$$b" ]; then \
66: subboard=$${b##*-}; \
67: board=$${b%%-*}; \
1.1.1.2 ! root 68: $(MAKE) -C board-$$board SUBBOARD=$$subboard; \
1.1 root 69: else \
1.1.1.2 ! root 70: $(MAKE) -C board-$@; \
1.1 root 71: fi
72: @$(RM) .crc_flash
73:
74: test_all:
1.1.1.2 ! root 75: @for i in $(STD_BOARDS); do $(MAKE) distclean $$i; done
1.1 root 76:
77: driver:
78: @echo "******** Building $(BOARD) system ********"
79: @b=`echo $(BOARD) | grep "-"`; \
80: if [ -n "$$b" ]; then \
81: subboard=$${b##*-}; \
82: board=$${b%%-*}; \
1.1.1.2 ! root 83: DRIVER=1 $(MAKE) -C board-$$board SUBBOARD=$$subboard driver; \
1.1 root 84: else \
1.1.1.2 ! root 85: DRIVER=1 $(MAKE) -C board-$(BOARD) driver; \
1.1 root 86: fi
87: @$(RM) -f .crc_flash .boot_xdr.ffs
88:
89: cli:
1.1.1.2 ! root 90: $(MAKE) -C clients
1.1 root 91:
92: # Rules for making clean:
93: clean_here:
1.1.1.2 ! root 94: $(RM) boot_rom.bin .boot_rom.ffs boot_xdr.bin .boot_xdr.ffs
! 95: $(RM) boot_l2-dd2.ad boot_l2b.bin .crc_flash
1.1 root 96:
97:
98: clean: clean_here
1.1.1.2 ! root 99: @if [ -e .target ]; then \
! 100: tar=`cat .target`; \
! 101: b=`echo $$tar | grep "-"`; \
! 102: if [ -n "$$b" ]; then \
! 103: subboard=$${b##*-}; \
! 104: board=$${b%%-*}; \
! 105: $(MAKE) -C board-$$board SUBBOARD=$$subboard clean; \
! 106: else \
! 107: pwd; \
! 108: $(MAKE) -C board-$$tar clean; \
! 109: fi \
! 110: fi
1.1 root 111:
112: distclean: clean_here
1.1.1.2 ! root 113: @if [ -e .target ]; then \
! 114: tar=`cat .target`; \
! 115: b=`echo $$tar | grep "-"`; \
! 116: if [ -n "$$b" ]; then \
! 117: subboard=$${b##*-}; \
! 118: board=$${b%%-*}; \
! 119: $(MAKE) -C board-$$board SUBBOARD=$$subboard distclean; \
! 120: else \
! 121: $(MAKE) -C board-$$tar distclean; \
! 122: fi; \
! 123: $(RM) .target; \
! 124: fi
1.1 root 125:
126: distclean_all: clean_here
1.1.1.2 ! root 127: @for dir in board-* ; do \
! 128: $(MAKE) -C $$dir distclean || exit 1; \
! 129: done
! 130: $(RM) .target
1.1 root 131:
132: cli-clean:
1.1.1.2 ! root 133: $(MAKE) -C clients clean
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.