diff options
Diffstat (limited to 'flash/bootloader/Makefile')
-rw-r--r-- | flash/bootloader/Makefile | 81 |
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 | |||
10 | CC = sh-elf-gcc | ||
11 | LD = sh-elf-ld | ||
12 | AR = sh-elf-ar | ||
13 | AS = sh-elf-as | ||
14 | OC = sh-elf-objcopy | ||
15 | |||
16 | FIRMWARE := ../../firmware | ||
17 | TOOLSDIR=../../tools | ||
18 | |||
19 | TARGET = bootloader | ||
20 | LDS := $(TARGET).lds | ||
21 | |||
22 | |||
23 | ifndef PLATFORM | ||
24 | not_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) | ||
30 | endif | ||
31 | |||
32 | |||
33 | INCLUDES= -I$(FIRMWARE)/export -I. -I$(OBJDIR) | ||
34 | DEFINES= -DPLATFORM_$(PLATFORM) | ||
35 | |||
36 | OBJDIR := . | ||
37 | |||
38 | CFLAGS = -Os -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) $(DEFINES) | ||
39 | AFLAGS += -small -relax | ||
40 | |||
41 | |||
42 | ifdef DEBUG | ||
43 | DEFINES := -DDEBUG | ||
44 | CFLAGS += -g | ||
45 | endif | ||
46 | |||
47 | SRC := $(wildcard *.c) | ||
48 | |||
49 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) $(OBJDIR)/sh_nrv2e_d8.o | ||
50 | |||
51 | ifdef NO_ROM | ||
52 | LINKFILE = $(OBJDIR)/no_rom.lds | ||
53 | ORIGIN = 0 | ||
54 | DEFINES += -DNO_ROM | ||
55 | else | ||
56 | LINKFILE = $(OBJDIR)/$(TARGET).lds | ||
57 | ORIGIN = FFFF500 | ||
58 | endif | ||
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 | ||
63 | ifndef NO_ROM | ||
64 | $(TOOLSDIR)/scramble $(OBJDIR)/$(TARGET).bin $(OBJDIR)/$(TARGET).ajz | ||
65 | endif | ||
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 | |||
74 | clean: | ||
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 | ||