lsw: JPN fix
[savezelda.git] / Makefile
1 # Copyright 2008-2009  Segher Boessenkool  <segher@kernel.crashing.org>
2 # This code is licensed to you under the terms of the GNU GPL, version 2;
3 # see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
4
5
6 # Configuration:
7
8 # What toolchain prefix should we use
9 CROSS ?= broadway-
10
11 # Where are the tools (http://git.infradead.org/users/segher/wii.git)
12 TOOLS ?= $(HOME)/wii/segher
13
14 # End of configuration.
15
16
17
18 # Set CC, LD, OBJCOPY based on CROSS, unless they are set already
19
20 ifeq ($(origin CC), default)
21         CC := $(CROSS)gcc -m32
22 endif
23 ifeq ($(origin LD), default)
24         LD := $(CROSS)ld
25 endif
26 OBJCOPY ?= $(CROSS)objcopy
27
28
29 # The compiler flags we need.
30
31 CFLAGS := -Wall -W -Os -ffreestanding -mno-eabi -mno-sdata -mcpu=750
32
33
34 # Build with "V=1" to see the commands executed; be quiet otherwise.
35
36 ifeq ($(V),1)
37         Q :=
38 else
39         Q := @
40         MAKEFLAGS += --no-print-directory
41 endif
42
43
44 all:
45
46 .version: FORCE
47         $(Q)./describe.sh > .$@-tmp
48         $(Q)cmp -s $@ .$@-tmp || cp .$@-tmp $@
49         $(Q)rm .$@-tmp
50
51 all: FORCE .version
52         $(Q)$(MAKE) -C loader
53         $(Q)$(MAKE) -C twilight
54         $(Q)$(MAKE) -C lego
55         $(Q)$(MAKE) -C batman
56         $(Q)$(MAKE) -C lsw
57
58 FORCE:
59
60 clean:
61         -rm -f .version
62         $(MAKE) -C loader clean
63         $(MAKE) -C twilight clean
64         $(MAKE) -C lego clean
65         $(MAKE) -C batman clean
66         $(MAKE) -C lsw clean