summaryrefslogtreecommitdiff
path: root/apps/plugins/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/Makefile')
-rw-r--r--apps/plugins/Makefile45
1 files changed, 45 insertions, 0 deletions
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile
new file mode 100644
index 0000000000..4c02207016
--- /dev/null
+++ b/apps/plugins/Makefile
@@ -0,0 +1,45 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10CC = sh-elf-gcc
11OC = sh-elf-objcopy
12
13FIRMWARE = ../../firmware
14
15INCLUDES = -I$(FIRMWARE)/include -I$(FIRMWARE)/export -I$(FIRMWARE)/common -I$(FIRMWARE)/drivers -I..
16CFLAGS = -O -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes $(INCLUDES) $(TARGET) $(EXTRA_DEFINES)
17
18LINKFILE = plugin.lds
19
20SRC := $(wildcard *.c)
21ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock)
22
23ifndef OBJDIR
24no_configure:
25 @echo "Don't run make here. Run the tools/configure script from your own build"
26 @echo "directory, then run make there."
27 @echo
28 @echo "More help on how to build rockbox can be found here:"
29 @echo "http://rockbox.haxx.se/docs/how_to_compile.html"
30endif
31
32$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE)
33 $(CC) -O -nostdlib -o $@ $< -lgcc -T$(LINKFILE) -Wl,-Map,$*.map
34
35$(OBJDIR)/%.rock : $(OBJDIR)/%.elf
36 $(OC) -O binary $< $@
37
38$(OBJDIR)/%.o: %.c ../plugin.h Makefile
39 $(CC) $(CFLAGS) -c $< -o $@
40
41all: $(ROCKS)
42 @echo done
43
44clean:
45 -rm -f $(ROCKS)