Don't objcopy simulator plugins.
[kugel-rb.git] / apps / plugins / doom / doom.make
blob3e95026c3cb3f5739af5dcb36d0222bc9fd50807
1 # __________ __ ___.
2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 # \/ \/ \/ \/ \/
7 # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
10 DOOMSRCDIR := $(APPSDIR)/plugins/doom
11 DOOMBUILDDIR := $(BUILDDIR)/apps/plugins/doom
13 ROCKS += $(DOOMBUILDDIR)/doom.rock
15 DOOM_SRC := $(call preprocess, $(DOOMSRCDIR)/SOURCES)
16 DOOM_OBJ := $(call c2obj, $(DOOM_SRC))
17 DOOM_OBJ += $(DOOMBUILDDIR)/sscanf.o
19 # add source files to OTHER_SRC to get automatic dependencies
20 OTHER_SRC += $(DOOM_SRC)
22 DOOMCFLAGS = $(PLUGINFLAGS) -Wno-strict-prototypes
24 # The arm code compiles too large for the plugin buffer when set to optimize for speed
25 ifeq ($(CPU), arm)
26 DOOMCFLAGS += -Os
27 ifndef SIMVER
28 ifeq ($(TARGET), IRIVER_H100)
29 DOOMCCFLAGS += -mstructure-size-boundary=8
30 endif
31 endif
32 else
33 DOOMCFLAGS += -O2
34 endif
36 $(DOOMBUILDDIR)/sscanf.c: $(FIRMDIR)/common/sscanf.c
37 $(SILENT)mkdir -p $(dir $@)
38 $(call PRINTS,CP $<)cp $< $@
40 $(DOOMBUILDDIR)/sscanf.o: $(DOOMBUILDDIR)/sscanf.c
42 $(DOOMBUILDDIR)/doom.rock: $(DOOM_OBJ)
43 # for some reason, this doesn't match the implicit rule in plugins.make,
44 # so we have to duplicate the link command here
45 $(call PRINTS,LD $(@F))
46 $(SILENT)$(CC) $(PLUGINFLAGS) -o $*.elf \
47 $(filter %.o, $^) \
48 $(filter %.a, $^) \
49 -lgcc $(PLUGINLDFLAGS)
50 ifdef SIMVER
51 $(SILENT)cp $*.elf $@
52 else
53 $(SILENT)$(OC) -O binary $*.elf $@
54 endif
56 # new rule needed to use extra compile flags
57 $(DOOMBUILDDIR)/%.o: $(DOOMSRCDIR)/%.c
58 $(SILENT)mkdir -p $(dir $@)
59 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(DOOMCFLAGS) -c $< -o $@