summaryrefslogtreecommitdiff
path: root/apps/plugins/pacbox
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/pacbox
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/pacbox')
-rw-r--r--apps/plugins/pacbox/Makefile108
-rw-r--r--apps/plugins/pacbox/pacbox.make27
2 files changed, 27 insertions, 108 deletions
diff --git a/apps/plugins/pacbox/Makefile b/apps/plugins/pacbox/Makefile
deleted file mode 100644
index e1b998a7aa..0000000000
--- a/apps/plugins/pacbox/Makefile
+++ /dev/null
@@ -1,108 +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)
12CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
14
15ifdef APPEXTRA
16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
17endif
18
19LINKFILE := $(OBJDIR)/link.lds
20DEPFILE = $(OBJDIR)/dep-pacbox
21
22# This sets up 'SRC' based on the files mentioned in SOURCES
23include $(TOOLSDIR)/makesrc.inc
24
25SOURCES = $(SRC)
26OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
27OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
28DIRS = .
29
30LDS := ../plugin.lds
31OUTPUT = $(OUTDIR)/pacbox.rock
32
33all: $(OUTPUT)
34
35ifndef SIMVER
36$(OBJDIR)/pacbox.elf: $(OBJS) $(LINKFILE)
37 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
38 -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/pacbox.map
39
40$(OUTPUT): $(OBJDIR)/pacbox.elf
41 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
42else
43
44ifeq ($(SIMVER), x11)
45###################################################
46# This is the X11 simulator version
47
48$(OUTPUT): $(OBJS)
49 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
50ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
51# 'x' must be kept or you'll have "Win32 error 5"
52# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
53# #define ERROR_ACCESS_DENIED 5L
54else
55 @chmod -x $@
56endif
57
58else # end of x11-simulator
59ifeq ($(SIMVER), sdl)
60###################################################
61# This is the SDL simulator version
62
63$(OUTPUT): $(OBJS)
64 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
65ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
66# 'x' must be kept or you'll have "Win32 error 5"
67# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
68# #define ERROR_ACCESS_DENIED 5L
69else
70 @chmod -x $@
71endif
72
73else # end of sdl-simulator
74###################################################
75# This is the win32 simulator version
76DLLTOOLFLAGS = --export-all
77DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
78
79$(OUTPUT): $(OBJS)
80 $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
81 $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
82 $(BUILDDIR)/libplugin.a -o $@
83ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
84# 'x' must be kept or you'll have "Win32 error 5"
85# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
86# #define ERROR_ACCESS_DENIED 5L
87else
88 @chmod -x $@
89endif
90endif # end of win32-simulator
91endif
92endif # end of simulator section
93
94
95include $(TOOLSDIR)/make.inc
96
97# MEMORYSIZE should be passed on to this makefile with the chosen memory size
98# given in number of MB
99$(LINKFILE): $(LDS)
100 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
101 $(DEFINES) -E -P - >$@
102
103clean:
104 $(call PRINTS,cleaning pacbox)rm -rf $(OBJDIR)/pacbox
105 $(SILENT)rm -f $(OBJDIR)/pacbox.* $(DEPFILE)
106
107-include $(DEPFILE)
108
diff --git a/apps/plugins/pacbox/pacbox.make b/apps/plugins/pacbox/pacbox.make
new file mode 100644
index 0000000000..75a599d602
--- /dev/null
+++ b/apps/plugins/pacbox/pacbox.make
@@ -0,0 +1,27 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10PACBOXSRCDIR := $(APPSDIR)/plugins/pacbox
11PACBOXBUILDDIR := $(BUILDDIR)/apps/plugins/pacbox
12
13ROCKS += $(PACBOXBUILDDIR)/pacbox.rock
14
15PACBOX_SRC := $(call preprocess, $(PACBOXSRCDIR)/SOURCES)
16PACBOX_OBJ := $(call c2obj, $(PACBOX_SRC))
17
18# add source files to OTHER_SRC to get automatic dependencies
19OTHER_SRC += $(PACBOX_SRC)
20
21PACBOXFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O2
22
23$(PACBOXBUILDDIR)/pacbox.rock: $(PACBOX_OBJ)
24
25$(PACBOXBUILDDIR)/%.o: $(PACBOXSRCDIR)/%.c $(PLUGINBITMAPLIB) $(PACBOXSRCDIR)/pacbox.make
26 $(SILENT)mkdir -p $(dir $@)
27 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PACBOXFLAGS) -c $< -o $@