summaryrefslogtreecommitdiff
path: root/flash/bootloader/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'flash/bootloader/Makefile')
-rw-r--r--flash/bootloader/Makefile81
1 files changed, 0 insertions, 81 deletions
diff --git a/flash/bootloader/Makefile b/flash/bootloader/Makefile
deleted file mode 100644
index edc32113c6..0000000000
--- a/flash/bootloader/Makefile
+++ /dev/null
@@ -1,81 +0,0 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10CC = sh-elf-gcc
11LD = sh-elf-ld
12AR = sh-elf-ar
13AS = sh-elf-as
14OC = sh-elf-objcopy
15
16FIRMWARE := ../../firmware
17TOOLSDIR=../../tools
18
19TARGET = bootloader
20LDS := $(TARGET).lds
21
22
23ifndef PLATFORM
24not_configured:
25 @echo "No platform given."
26 @echo "Use make PLATFORM=PLAYER|RECORDER|FM|ONDIO {NO_ROM=1}"
27##else
28##configured:
29## @echo "Building bootloader for platform "$(PLATFORM)
30endif
31
32
33INCLUDES= -I$(FIRMWARE)/export -I. -I$(OBJDIR)
34DEFINES= -DPLATFORM_$(PLATFORM)
35
36OBJDIR := .
37
38CFLAGS = -Os -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) $(DEFINES)
39AFLAGS += -small -relax
40
41
42ifdef DEBUG
43 DEFINES := -DDEBUG
44 CFLAGS += -g
45endif
46
47SRC := $(wildcard *.c)
48
49OBJS := $(SRC:%.c=$(OBJDIR)/%.o) $(OBJDIR)/sh_nrv2e_d8.o
50
51ifdef NO_ROM
52LINKFILE = $(OBJDIR)/no_rom.lds
53ORIGIN = 0
54DEFINES += -DNO_ROM
55else
56LINKFILE = $(OBJDIR)/$(TARGET).lds
57ORIGIN = FFFF500
58endif
59
60$(OBJDIR)/$(TARGET).bin : $(OBJDIR)/$(TARGET).elf
61 $(OC) -O binary $(OBJDIR)/$(TARGET).elf $(OBJDIR)/$(TARGET).bin
62 $(TOOLSDIR)/sh2d $(OBJDIR)/$(TARGET).bin -o $(ORIGIN) > $(OBJDIR)/$(TARGET).asm
63ifndef NO_ROM
64 $(TOOLSDIR)/scramble $(OBJDIR)/$(TARGET).bin $(OBJDIR)/$(TARGET).ajz
65endif
66
67$(OBJDIR)/$(TARGET).elf : $(OBJS)
68 $(CC) -Os -nostdlib -o $@ $(OBJS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$(TARGET).map
69
70# cross-reference, saves code duplication
71$(OBJDIR)/sh_nrv2e_d8.o : ../../firmware/decompressor/sh_nrv2e_d8.S
72 $(CC) $(CFLAGS) -c $< -o $@
73
74clean:
75 -rm -f \
76 $(OBJS) \
77 $(OBJDIR)/$(TARGET).asm \
78 $(OBJDIR)/$(TARGET).bin \
79 $(OBJDIR)/$(TARGET).ajz \
80 $(OBJDIR)/$(TARGET).elf \
81 $(OBJDIR)/$(TARGET).map