summaryrefslogtreecommitdiff
path: root/apps/plugins/Makefile
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-02-18 13:47:17 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-02-18 13:47:17 +0000
commitcdde25b597eb4047e9db27bb8bbcf938e4a43cfe (patch)
treed25f47817cc8515228c8ea0eb33ab71bfc2159d4 /apps/plugins/Makefile
parentf436476f9f0eeae4640197866ea5b5fa068df7e9 (diff)
downloadrockbox-cdde25b597eb4047e9db27bb8bbcf938e4a43cfe.tar.gz
rockbox-cdde25b597eb4047e9db27bb8bbcf938e4a43cfe.zip
Unified build system to use SOURCES for sim builds too, a single Makefile-look
made by configure and various related adjustments. This has not yet been tested on cygwin. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6001 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/Makefile')
-rw-r--r--apps/plugins/Makefile41
1 files changed, 38 insertions, 3 deletions
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile
index 0c90bde9b1..6af39327bc 100644
--- a/apps/plugins/Makefile
+++ b/apps/plugins/Makefile
@@ -24,16 +24,19 @@ LDS := plugin.lds
24LINKFILE := $(OBJDIR)/pluginlink.lds 24LINKFILE := $(OBJDIR)/pluginlink.lds
25DEPFILE = $(OBJDIR)/dep-plugins 25DEPFILE = $(OBJDIR)/dep-plugins
26 26
27SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) \ 27SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
28 $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - ) 28 $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - )
29ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock) 29ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock)
30SOURCES = $(SRC) 30SOURCES = $(SRC)
31ELFS := $(SRC:%.c=$(OBJDIR)/%.elf) 31ELFS := $(SRC:%.c=$(OBJDIR)/%.elf)
32OBJS := $(SRC:%.c=$(OBJDIR)/%.o) 32OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
33# as created by the cross-compiler for win32:
34DEFS := $(SRC:%.c=$(OBJDIR)/%.def)
33DIRS = . 35DIRS = .
34 36
35all: $(OBJDIR)/libplugin.a $(ROCKS) $(DEPFILE) 37all: $(OBJDIR)/libplugin.a $(ROCKS) $(DEPFILE)
36 38
39ifndef SIMVER
37$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(OBJDIR)/libplugin.a 40$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(OBJDIR)/libplugin.a
38 @echo "LD $@" 41 @echo "LD $@"
39 @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(OBJDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map 42 @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(OBJDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map
@@ -41,6 +44,37 @@ $(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(OBJDIR)/libplugin.a
41$(OBJDIR)/%.rock : $(OBJDIR)/%.elf 44$(OBJDIR)/%.rock : $(OBJDIR)/%.elf
42 @echo "OBJCOPY $<" 45 @echo "OBJCOPY $<"
43 @$(OC) -O binary $< $@ 46 @$(OC) -O binary $< $@
47else
48
49ifeq ($(SIMVER), x11)
50###################################################
51# This is the X11 simulator version
52
53$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(APPSDIR)/plugin.h
54 @echo "LD $@"
55 @$(CC) $(APPCFLAGS) -DPLUGIN -shared $< -L$(OBJDIR) -lplugin -o $@
56ifeq ($(UNAME),CYGWIN)
57# 'x' must be kept or you'll have "Win32 error 5"
58# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
59# #define ERROR_ACCESS_DENIED 5L
60else
61 @chmod -x $@
62endif
63
64else # end of x11-simulator
65###################################################
66# This is the win32 simulator version
67DLLTOOLFLAGS = --export-all
68DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
69
70$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(APPSDIR)/plugin.h
71 @echo "DLL $@"
72 @$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $<
73 @$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $< $(OBJDIR)/libplugin.a -o $@
74 @chmod -x $@
75endif # end of win32-simulator
76
77endif # end of simulator section
44 78
45include $(TOOLSDIR)/make.inc 79include $(TOOLSDIR)/make.inc
46 80
@@ -56,7 +90,8 @@ $(LINKFILE): $(LDS)
56 90
57clean: 91clean:
58 @echo "cleaning plugins" 92 @echo "cleaning plugins"
59 @rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) $(OBJS) 93 @rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \
94 $(OBJS) $(DEFS)
60 @$(MAKE) -C lib clean 95 @$(MAKE) -C lib clean
61 96
62-include $(DEPFILE) 97-include $(DEPFILE)