2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
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_SRC
+= $(ROOTDIR
)/firmware
/common
/sscanf.c
17 DOOM_OBJ
:= $(call c2obj
, $(DOOM_SRC
))
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
28 ifeq ($(TARGET
), IRIVER_H100
)
29 DOOMCCFLAGS
+= -mstructure-size-boundary
=8
36 $(DOOMBUILDDIR
)/doom.rock
: $(DOOM_OBJ
)
37 # for some reason, this doesn't match the implicit rule in plugins.make,
38 # so we have to duplicate the link command here
39 $(call PRINTS
,LD
$(@F
))
40 $(SILENT
)$(CC
) $(PLUGINFLAGS
) -o
$*.elf \
43 -lgcc
$(PLUGINLDFLAGS
)
47 $(SILENT
)$(OC
) -O binary
$*.elf
$@
50 # new rule needed to use extra compile flags
51 $(DOOMBUILDDIR
)/%.o
: $(DOOMSRCDIR
)/%.c
52 $(SILENT
)mkdir
-p
$(dir $@
)
53 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<))$(CC
) $(DOOMCFLAGS
) -c
$< -o
$@