summaryrefslogtreecommitdiff
path: root/apps/plugins/reversi
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2008-11-20 11:27:31 +0000
committerBjörn Stenberg <bjorn@haxx.se>2008-11-20 11:27:31 +0000
commitc6b3d38a156dd624760a8eb1bb374affd43b4f2a (patch)
tree493eba929e2396d86cf4f077709aa09fe172cd35 /apps/plugins/reversi
parentf66c30346783a400a029bedcd60ab67c81c34a07 (diff)
downloadrockbox-c6b3d38a156dd624760a8eb1bb374affd43b4f2a.tar.gz
rockbox-c6b3d38a156dd624760a8eb1bb374affd43b4f2a.zip
New makefile solution: A single invocation of 'make' to build the entire tree. Fully controlled dependencies give faster and more correct recompiles.
Many #include lines adjusted to conform to the new standards. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19146 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/reversi')
-rw-r--r--apps/plugins/reversi/Makefile111
-rw-r--r--apps/plugins/reversi/reversi-gui.c2
-rw-r--r--apps/plugins/reversi/reversi.make28
3 files changed, 29 insertions, 112 deletions
diff --git a/apps/plugins/reversi/Makefile b/apps/plugins/reversi/Makefile
deleted file mode 100644
index 97a042e0f7..0000000000
--- a/apps/plugins/reversi/Makefile
+++ /dev/null
@@ -1,111 +0,0 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $$Id: $$
8#
9
10INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) \
12 -I$(BUILDDIR)/pluginbitmaps
13CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
14 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
15
16ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
18endif
19
20LINKFILE := $(OBJDIR)/link.lds
21DEPFILE = $(OBJDIR)/dep-reversi
22
23# This sets up 'SRC' based on the files mentioned in SOURCES
24include $(TOOLSDIR)/makesrc.inc
25
26SOURCES = $(SRC)
27OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
28DIRS = .
29
30ifndef SIMVER
31 LDS := ../plugin.lds
32 OUTPUT = $(OUTDIR)/reversi.rock
33else ## simulators
34 OUTPUT = $(OUTDIR)/reversi.rock
35endif
36
37all: $(OUTPUT)
38
39ifndef SIMVER
40$(OBJDIR)/reversi.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
41 $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
42 $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/reversi.map
43
44$(OUTPUT): $(OBJDIR)/reversi.elf
45 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
46else
47
48ifeq ($(SIMVER), x11)
49###################################################
50# This is the X11 simulator version
51
52$(OUTPUT): $(OBJS)
53 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
54ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
55# 'x' must be kept or you'll have "Win32 error 5"
56# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
57# #define ERROR_ACCESS_DENIED 5L
58else
59 @chmod -x $@
60endif
61
62else # end of x11-simulator
63ifeq ($(SIMVER), sdl)
64###################################################
65# This is the SDL simulator version
66
67$(OUTPUT): $(OBJS)
68 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
69ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
70# 'x' must be kept or you'll have "Win32 error 5"
71# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
72# #define ERROR_ACCESS_DENIED 5L
73else
74 @chmod -x $@
75endif
76
77else # end of sdl-simulator
78###################################################
79# This is the win32 simulator version
80DLLTOOLFLAGS = --export-all
81DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
82
83$(OUTPUT): $(OBJS)
84 $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
85 $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
86 $(BUILDDIR)/libplugin.a $(BITMAPLIBS) -o $@
87ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
88# 'x' must be kept or you'll have "Win32 error 5"
89# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
90# #define ERROR_ACCESS_DENIED 5L
91else
92 @chmod -x $@
93endif
94endif # end of win32-simulator
95endif
96endif # end of simulator section
97
98
99include $(TOOLSDIR)/make.inc
100
101# MEMORYSIZE should be passed on to this makefile with the chosen memory size
102# given in number of MB
103$(LINKFILE): $(LDS)
104 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
105 $(DEFINES) -E -P - >$@
106
107clean:
108 $(call PRINTS,cleaning reversi)rm -rf $(OBJDIR)/reversi
109 $(SILENT)rm -f $(OBJDIR)/reversi.* $(DEPFILE)
110
111-include $(DEPFILE)
diff --git a/apps/plugins/reversi/reversi-gui.c b/apps/plugins/reversi/reversi-gui.c
index d91f24b3d9..1c1cf56168 100644
--- a/apps/plugins/reversi/reversi-gui.c
+++ b/apps/plugins/reversi/reversi-gui.c
@@ -47,7 +47,7 @@ further options:
47#include "reversi-strategy.h" 47#include "reversi-strategy.h"
48#include "reversi-gui.h" 48#include "reversi-gui.h"
49 49
50#include "../lib/oldmenuapi.h" 50#include "lib/oldmenuapi.h"
51 51
52PLUGIN_HEADER 52PLUGIN_HEADER
53 53
diff --git a/apps/plugins/reversi/reversi.make b/apps/plugins/reversi/reversi.make
new file mode 100644
index 0000000000..be7369423e
--- /dev/null
+++ b/apps/plugins/reversi/reversi.make
@@ -0,0 +1,28 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10REVERSISRCDIR := $(APPSDIR)/plugins/reversi
11REVERSIBUILDDIR := $(BUILDDIR)/apps/plugins/reversi
12
13ROCKS += $(REVERSIBUILDDIR)/reversi.rock
14
15REVERSI_SRC := $(call preprocess, $(REVERSISRCDIR)/SOURCES)
16REVERSI_OBJ := $(call c2obj, $(REVERSI_SRC))
17
18# add source files to OTHER_SRC to get automatic dependencies
19OTHER_SRC += $(REVERSI_SRC)
20
21$(REVERSIBUILDDIR)/reversi.rock: $(REVERSI_OBJ)
22# for some reason, this doesn't match the implicit rule in plugins.make,
23# so we have to duplicate the link command here
24 $(SILENT)$(CC) $(PLUGINFLAGS) -o $*.elf \
25 $(filter %.o, $^) \
26 $(filter %.a, $^) \
27 -lgcc $(PLUGINLDFLAGS)
28 $(call PRINTS,LD $(@F))$(OC) -O binary $*.elf $@