summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/win32.mak60
1 files changed, 45 insertions, 15 deletions
diff --git a/apps/win32.mak b/apps/win32.mak
index ce48e95928..f2f52947e2 100644
--- a/apps/win32.mak
+++ b/apps/win32.mak
@@ -6,6 +6,20 @@
6# \/ \/ \/ \/ \/ 6# \/ \/ \/ \/ \/
7# $Id$ 7# $Id$
8# 8#
9# Win32 GNUSH makefile by Felix Arends
10#
11
12#
13# USAGE OF THIS MAKEFILE
14#
15# call this makefile from commandline: make -f win32.mak
16#
17# to create a recorder target: make -f win32.mak RECORDER=1
18# to cerate a recorder target with propfonts: make -f win32.mak RECORDER=1 PROPFONTS=1
19# to create a recorder target without games: make -f win32.mak RECORDER=1 DISABLE_GAMES=1
20# to create a player target: make -f win32.mak PLAYER=1
21# to create an old player target: make -f win32.mak PLAYER_OLD=1
22#
9 23
10CC = sh-elf-gcc 24CC = sh-elf-gcc
11LD = sh-elf-ld 25LD = sh-elf-ld
@@ -15,41 +29,56 @@ OC = sh-elf-objcopy
15 29
16FIRMWARE := ../firmware 30FIRMWARE := ../firmware
17 31
18INCLUDES= -I$(FIRMWARE)/include -I$(FIRMWARE) -I$(FIRMWARE)/common -I$(FIRMWARE)/drivers -I$(FIRMWARE)/malloc -I./recorder -I. 32INCLUDES= -I$(FIRMWARE)/include -I$(FIRMWARE) -I$(FIRMWARE)/common -I$(FIRMWARE)/drivers -I$(FIRMWARE)/malloc -I.
19 33
20# Pick a target to build for 34# Pick a target to build for
21#TARGET = -DARCHOS_PLAYER=1 35TARGET = -DARCHOS_RECORDER=1 # standard setting
22#TARGET = -DARCHOS_PLAYER_OLD=1 36ifdef RECORDER
23TARGET = -DARCHOS_RECORDER=1 37 TARGET=-DARCHOS_RECORDER=1
38else
39 ifdef PLAYER
40 TARGET=-DARCHOS_PLAYER=1
41 else
42 ifdef PLAYER_OLD
43 TARGET=-DARCHOS_PLAYER_OLD=1
44 endif
45 endif
46endif
24 47
25# store output files in this directory: 48# store output files in this directory:
26OBJDIR = . 49OBJDIR = .
27DEFINES = -DLCD_PROPFONTS -DAPPSVERSION=\"CVS\" 50DEFINES = -DAPPSVERSION=\"CVS\"
51
52ifdef DISABLE_GAMES
53 DEFINES += -DDISABLE_GAMES
54endif
55
56ifdef PROPFONTS
57 DEFINES += -DLCD_PROPFONTS
58endif
28 59
29CFLAGS = -O -W -Wall -m1 -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) $(TARGET) $(DEFINES) 60CFLAGS = -O -W -Wall -m1 -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) $(TARGET) $(DEFINES)
30AFLAGS += -small -relax 61AFLAGS += -small -relax
31 62
32ifdef DEBUG 63ifdef DEBUG
33 DEFINES := -DDEBUG 64 DEFINES += -DDEBUG
34 CFLAGS += -g 65 CFLAGS += -g
35 LDS := $(FIRMWARE)/gdb.lds 66 LDS := $(FIRMWARE)/gdb.lds
36else 67else
37#ifeq ($(TARGET),-DARCHOS_RECORDER)
38 LDS := $(FIRMWARE)/app.lds 68 LDS := $(FIRMWARE)/app.lds
39#else
40# LDS := $(FIRMWARE)/player.lds
41#endif
42endif 69endif
43 70
44SRC := $(wildcard *.c) 71SRC := $(wildcard *.c)
45 72
46#ifeq ($(TARGET),-DARCHOS_RECORDER) 73ifeq ($(TARGET),-DARCHOS_RECORDER=1)
47 SRC += $(wildcard recorder/*.c) 74 SRC += $(wildcard recorder/*.c)
48 CFLAGS += -Irecorder 75 CFLAGS += -Irecorder
49 OUTNAME = ajbrec.ajz 76 OUTNAME = ajbrec.ajz
50#else 77else
51# OUTNAME = archos.mod 78 SRC += $(wildcard player/*.c)
52#endif 79 CFLAGS += -Iplayer
80 OUTNAME = archos.mod
81endif
53 82
54OBJS := $(SRC:%.c=$(OBJDIR)/%.o) 83OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
55 84
@@ -71,7 +100,7 @@ $(OBJDIR)/$(OUTNAME) : $(OBJDIR)/archos.bin
71 scramble $(OBJDIR)/archos.bin $(OBJDIR)/$(OUTNAME) 100 scramble $(OBJDIR)/archos.bin $(OBJDIR)/$(OUTNAME)
72 101
73$(OBJDIR)/%.o: %.c 102$(OBJDIR)/%.o: %.c
74 $(CC) $(CFLAGS) -c $< -o $@ 103 $(CC) $(CFLAGS) $(TARGET) -c $< -o $@
75 104
76dist: 105dist:
77 tar czvf dist.tar.gz Makefile main.c start.s app.lds 106 tar czvf dist.tar.gz Makefile main.c start.s app.lds
@@ -80,6 +109,7 @@ clean:
80 -rm -f $(OBJS) $(OBJDIR)/$(OUTNAME) $(OBJDIR)/archos.asm \ 109 -rm -f $(OBJS) $(OBJDIR)/$(OUTNAME) $(OBJDIR)/archos.asm \
81 $(OBJDIR)/archos.bin $(OBJDIR)/archos.elf $(OBJDIR)/archos.map 110 $(OBJDIR)/archos.bin $(OBJDIR)/archos.elf $(OBJDIR)/archos.map
82 -$(RM) -r $(OBJDIR)/$(DEPS) 111 -$(RM) -r $(OBJDIR)/$(DEPS)
112 make -f ../firmware/win32.mak clean
83 113
84DEPS:=.deps 114DEPS:=.deps
85DEPDIRS:=$(DEPS) $(DEPS)/recorder 115DEPDIRS:=$(DEPS) $(DEPS)/recorder