summaryrefslogtreecommitdiff
path: root/apps/plugins/chessbox/chessbox.make
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/chessbox/chessbox.make
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/chessbox/chessbox.make')
-rw-r--r--apps/plugins/chessbox/chessbox.make58
1 files changed, 58 insertions, 0 deletions
diff --git a/apps/plugins/chessbox/chessbox.make b/apps/plugins/chessbox/chessbox.make
new file mode 100644
index 0000000000..d42984c771
--- /dev/null
+++ b/apps/plugins/chessbox/chessbox.make
@@ -0,0 +1,58 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10CHESSBOX_SRCDIR = $(APPSDIR)/plugins/chessbox
11CHESSBOX_OBJDIR = $(BUILDDIR)/apps/plugins/chessbox
12
13CHESSBOX_SRC := $(call preprocess, $(CHESSBOX_SRCDIR)/SOURCES)
14CHESSBOX_OBJ := $(call c2obj, $(CHESSBOX_SRC))
15
16OTHER_SRC += $(CHESSBOX_SRC)
17
18ifndef SIMVER
19ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
20 ## archos recorder targets
21 CHESSBOX_INLDS := $(CHESSBOX_SRCDIR)/archos.lds
22 ROCKS += $(CHESSBOX_OBJDIR)/chessbox.ovl
23else
24 ### all other targets
25 CHESSBOX_INLDS := $(APPSDIR)/plugins/plugin.lds
26 ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock
27endif
28 CHESSBOX_OVLFLAGS = -T$(CHESSBOX_OUTLDS) -Wl,--gc-sections -Wl,-Map,$*.map
29 CHESSBOX_OUTLDS = $(CHESSBOX_OBJDIR)/chessbox.lds
30else
31 ### simulator
32 ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock
33 CHESSBOX_OVLFLAGS = $(SHARED_FLAG) # <-- from Makefile
34endif
35
36ifeq ($(CPU),sh)
37# sh need to retain its' -Os
38CHESSBOXFLAGS = $(PLUGINFLAGS)
39else
40CHESSBOXFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O2
41endif
42
43$(CHESSBOX_OUTLDS): $(CHESSBOX_INLDS) $(CHESSBOX_OBJ)
44 $(call PRINTS,PP $(<F))$(call preprocess2file,$<,$@)
45
46$(CHESSBOX_OBJDIR)/chessbox.rock: $(CHESSBOX_OBJ) $(CHESSBOX_OUTLDS) $(PLUGINBITMAPLIB)
47
48$(CHESSBOX_OBJDIR)/chessbox.ovl: $(CHESSBOX_OBJ) $(CHESSBOX_OUTLDS) $(PLUGINBITMAPLIB)
49 $(SILENT)$(CC) $(PLUGINFLAGS) -o $(CHESSBOX_OBJDIR)/$*.elf \
50 $(filter %.o, $^) \
51 $(filter %.a, $^) \
52 -lgcc $(CHESSBOX_OVLFLAGS)
53 $(call PRINTS,LD $(@F))$(OC) -O binary $(CHESSBOX_OBJDIR)/$*.elf $@
54
55# special pattern rule for compiling chessbox with extra flags
56$(CHESSBOX_OBJDIR)/%.o: $(CHESSBOX_SRCDIR)/%.c $(PLUGINBITMAPLIB) $(CHESSBOX_SRCDIR)/chessbox.make
57 $(SILENT)mkdir -p $(dir $@)
58 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(CHESSBOXFLAGS) -c $< -o $@