diff options
author | Felix Arends <edx@rockbox.org> | 2002-08-16 14:08:50 +0000 |
---|---|---|
committer | Felix Arends <edx@rockbox.org> | 2002-08-16 14:08:50 +0000 |
commit | 9ed9765bfe01b73f4ce64dd5ccb1ce448d951a03 (patch) | |
tree | 897cb485404dac52c2e0ec55cc4d16e2e03bf596 | |
parent | afc9b57c20bce7062e03bab6ecc9e21f22bc67f9 (diff) | |
download | rockbox-9ed9765bfe01b73f4ce64dd5ccb1ce448d951a03.tar.gz rockbox-9ed9765bfe01b73f4ce64dd5ccb1ce448d951a03.zip |
windows makefile for firmware
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1784 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/main.c | 2 | ||||
-rw-r--r-- | apps/win32.mak | 87 |
2 files changed, 88 insertions, 1 deletions
diff --git a/apps/main.c b/apps/main.c index 22fd8f6051..4d408836f4 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -50,7 +50,7 @@ | |||
50 | #endif | 50 | #endif |
51 | 51 | ||
52 | 52 | ||
53 | char appsversion[]=APPSVERSION; | 53 | char appsversion[]="WIN32"; |
54 | 54 | ||
55 | void init(void); | 55 | void init(void); |
56 | 56 | ||
diff --git a/apps/win32.mak b/apps/win32.mak new file mode 100644 index 0000000000..1f7a1f44fc --- /dev/null +++ b/apps/win32.mak | |||
@@ -0,0 +1,87 @@ | |||
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 | |||
18 | INCLUDES= -I$(FIRMWARE)/include -I$(FIRMWARE) -I$(FIRMWARE)/common -I$(FIRMWARE)/drivers -I$(FIRMWARE)/malloc -I./recorder | ||
19 | |||
20 | # Pick a target to build for | ||
21 | #TARGET = -DARCHOS_PLAYER=1 | ||
22 | #TARGET = -DARCHOS_PLAYER_OLD=1 | ||
23 | TARGET = -DARCHOS_RECORDER=1 | ||
24 | |||
25 | # store output files in this directory: | ||
26 | OBJDIR = . | ||
27 | DEFINES = -DLCD_PROPFONTS | ||
28 | |||
29 | CFLAGS = -O -W -Wall -m1 -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) $(TARGET) $(DEFINES) | ||
30 | AFLAGS += -small -relax | ||
31 | |||
32 | ifdef DEBUG | ||
33 | DEFINES := -DDEBUG | ||
34 | CFLAGS += -g | ||
35 | LDS := $(FIRMWARE)/gdb.lds | ||
36 | else | ||
37 | #ifeq ($(TARGET),-DARCHOS_RECORDER) | ||
38 | LDS := $(FIRMWARE)/app.lds | ||
39 | #else | ||
40 | # LDS := $(FIRMWARE)/player.lds | ||
41 | #endif | ||
42 | endif | ||
43 | |||
44 | SRC := $(wildcard *.c) | ||
45 | |||
46 | #ifeq ($(TARGET),-DARCHOS_RECORDER) | ||
47 | SRC += $(wildcard recorder/*.c) | ||
48 | CFLAGS += -Irecorder | ||
49 | OUTNAME = ajbrec.ajz | ||
50 | #else | ||
51 | # OUTNAME = archos.mod | ||
52 | #endif | ||
53 | |||
54 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
55 | |||
56 | all : $(OBJDIR)/$(OUTNAME) | ||
57 | |||
58 | $(OBJDIR)/librockbox.a: | ||
59 | make -C $(FIRMWARE) -f win32.mak TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR) | ||
60 | |||
61 | $(OBJDIR)/archos.elf : $(OBJS) $(LDS) $(OBJDIR)/librockbox.a | ||
62 | $(CC) -Os -nostdlib -o $(OBJDIR)/archos.elf $(OBJS) -L$(OBJDIR) -lrockbox -lgcc -L$(FIRMWARE) -T$(LDS) -Wl,-Map,$(OBJDIR)/archos.map | ||
63 | |||
64 | $(OBJDIR)/archos.bin : $(OBJDIR)/archos.elf | ||
65 | $(OC) -O binary $(OBJDIR)/archos.elf $(OBJDIR)/archos.bin | ||
66 | |||
67 | $(OBJDIR)/archos.asm: $(OBJDIR)/archos.bin | ||
68 | ../tools/sh2d -sh1 $(OBJDIR)/archos.bin > $(OBJDIR)/archos.asm | ||
69 | |||
70 | $(OBJDIR)/$(OUTNAME) : $(OBJDIR)/archos.bin | ||
71 | scramble $(OBJDIR)/archos.bin $(OBJDIR)/$(OUTNAME) | ||
72 | |||
73 | $(OBJDIR)/%.o: %.c | ||
74 | $(CC) $(CFLAGS) -c $< -o $@ | ||
75 | |||
76 | dist: | ||
77 | tar czvf dist.tar.gz Makefile main.c start.s app.lds | ||
78 | |||
79 | clean: | ||
80 | -rm -f $(OBJS) $(OBJDIR)/$(OUTNAME) $(OBJDIR)/archos.asm \ | ||
81 | $(OBJDIR)/archos.bin $(OBJDIR)/archos.elf $(OBJDIR)/archos.map | ||
82 | -$(RM) -r $(OBJDIR)/$(DEPS) | ||
83 | |||
84 | DEPS:=.deps | ||
85 | DEPDIRS:=$(DEPS) $(DEPS)/recorder | ||
86 | |||
87 | -include $(SRC:%.c=$(OBJDIR)/$(DEPS)/%.d) | ||