diff options
Diffstat (limited to 'apps/plugins/Makefile')
-rw-r--r-- | apps/plugins/Makefile | 45 |
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 | |||
10 | CC = sh-elf-gcc | ||
11 | OC = sh-elf-objcopy | ||
12 | |||
13 | FIRMWARE = ../../firmware | ||
14 | |||
15 | INCLUDES = -I$(FIRMWARE)/include -I$(FIRMWARE)/export -I$(FIRMWARE)/common -I$(FIRMWARE)/drivers -I.. | ||
16 | CFLAGS = -O -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) | ||
17 | |||
18 | LINKFILE = plugin.lds | ||
19 | |||
20 | SRC := $(wildcard *.c) | ||
21 | ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock) | ||
22 | |||
23 | ifndef OBJDIR | ||
24 | no_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" | ||
30 | endif | ||
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 | |||
41 | all: $(ROCKS) | ||
42 | @echo done | ||
43 | |||
44 | clean: | ||
45 | -rm -f $(ROCKS) | ||