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
8 ifeq ($(origin CC), default)
11 ifeq ($(origin LD), default)
14 OBJCOPY ?= $(CROSS)objcopy
17 CFLAGS := -Wall -W -Os -ffreestanding -std=gnu99 -Wstrict-aliasing=2 \
18 -mno-eabi -mno-sdata -mcpu=750
23 objs := crt0.o main.o string.o video.o ios.o sd.o fat.o elf.o sync.o font.o \
24 console.o exception.o exception_2200.o usbgecko.o time.o version.o
32 MAKEFLAGS += --no-print-directory
38 $(targets): %.bin: %.elf
40 $(Q)$(OBJCOPY) -O binary $< $@
42 elfs := $(targets:.bin=.elf)
43 $(elfs): %.elf: %.lds $(objs)
45 $(Q)$(LD) $(LDFLAGS) -n -T $^ -o $@
49 $(Q)$(CC) $(CFLAGS) -c $< -o $@
51 crt0.o exception_2200.o: %.o: %.s
53 $(Q)$(CC) $(CFLAGS) -c $< -o $@
55 version.c: ../.version
57 $(Q)echo "const char version[] = \"`cat $^` (`whoami`@`hostname -s`)\";" > $@
60 $(Q)$(MAKE) -C .. .version
66 font.c: %.c: %.ppm font2c.pl
68 $(Q)perl font2c.pl < $*.ppm > $@
73 rm -rf $(objs) $(targets) $(elfs) font.c version.c