Move c/h files implementing/defining standard library stuff into a new libc directory...
[kugel-rb.git] / apps / plugins / rockboy / rockboy.make
blob81e9a1f798c2520ffc01752a4b8cfb4dc27d829f
1 # __________ __ ___.
2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 # \/ \/ \/ \/ \/
7 # $Id$
10 ROCKBOY_SRCDIR = $(APPSDIR)/plugins/rockboy
11 ROCKBOY_OBJDIR = $(BUILDDIR)/apps/plugins/rockboy
13 ROCKBOY_SRC := $(call preprocess, $(ROCKBOY_SRCDIR)/SOURCES)
14 ROCKBOY_SRC += $(ROOTDIR)/firmware/libc/sscanf.c
15 ROCKBOY_OBJ := $(call c2obj, $(ROCKBOY_SRC))
17 OTHER_SRC += $(ROCKBOY_SRC)
19 ifndef SIMVER
20 ifneq (,$(findstring RECORDER,$(TARGET)))
21 ## lowmem targets
22 ROCKS += $(ROCKBOY_OBJDIR)/rockboy.ovl
23 ROCKBOY_OUTLDS = $(ROCKBOY_OBJDIR)/rockboy.link
24 ROCKBOY_OVLFLAGS = -T$(ROCKBOY_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
25 else
26 ### all other targets
27 ROCKS += $(ROCKBOY_OBJDIR)/rockboy.rock
28 endif
29 else
30 ### simulator
31 ROCKS += $(ROCKBOY_OBJDIR)/rockboy.rock
32 endif
34 $(ROCKBOY_OBJDIR)/rockboy.rock: $(ROCKBOY_OBJ)
36 $(ROCKBOY_OBJDIR)/rockboy.refmap: $(ROCKBOY_OBJ)
38 $(ROCKBOY_OUTLDS): $(PLUGIN_LDS) $(ROCKBOY_OBJDIR)/rockboy.refmap
39 $(call PRINTS,PP $(@F))$(call preprocess2file,$<,$@,-DOVERLAY_OFFSET=$(shell \
40 $(TOOLSDIR)/ovl_offset.pl $(ROCKBOY_OBJDIR)/rockboy.refmap))
42 $(ROCKBOY_OBJDIR)/rockboy.ovl: $(ROCKBOY_OBJ) $(ROCKBOY_OUTLDS)
43 $(SILENT)$(CC) $(PLUGINFLAGS) -o $(basename $@).elf \
44 $(filter %.o, $^) \
45 $(filter %.a, $+) \
46 -lgcc $(ROCKBOY_OVLFLAGS)
47 $(call PRINTS,LD $(@F))$(OC) -O binary $(basename $@).elf $@