diff options
Diffstat (limited to 'apps/plugins/chessbox/chessbox.make')
-rw-r--r-- | apps/plugins/chessbox/chessbox.make | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/apps/plugins/chessbox/chessbox.make b/apps/plugins/chessbox/chessbox.make new file mode 100644 index 0000000000..d42984c771 --- /dev/null +++ b/apps/plugins/chessbox/chessbox.make | |||
@@ -0,0 +1,58 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | CHESSBOX_SRCDIR = $(APPSDIR)/plugins/chessbox | ||
11 | CHESSBOX_OBJDIR = $(BUILDDIR)/apps/plugins/chessbox | ||
12 | |||
13 | CHESSBOX_SRC := $(call preprocess, $(CHESSBOX_SRCDIR)/SOURCES) | ||
14 | CHESSBOX_OBJ := $(call c2obj, $(CHESSBOX_SRC)) | ||
15 | |||
16 | OTHER_SRC += $(CHESSBOX_SRC) | ||
17 | |||
18 | ifndef SIMVER | ||
19 | ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET))))) | ||
20 | ## archos recorder targets | ||
21 | CHESSBOX_INLDS := $(CHESSBOX_SRCDIR)/archos.lds | ||
22 | ROCKS += $(CHESSBOX_OBJDIR)/chessbox.ovl | ||
23 | else | ||
24 | ### all other targets | ||
25 | CHESSBOX_INLDS := $(APPSDIR)/plugins/plugin.lds | ||
26 | ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock | ||
27 | endif | ||
28 | CHESSBOX_OVLFLAGS = -T$(CHESSBOX_OUTLDS) -Wl,--gc-sections -Wl,-Map,$*.map | ||
29 | CHESSBOX_OUTLDS = $(CHESSBOX_OBJDIR)/chessbox.lds | ||
30 | else | ||
31 | ### simulator | ||
32 | ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock | ||
33 | CHESSBOX_OVLFLAGS = $(SHARED_FLAG) # <-- from Makefile | ||
34 | endif | ||
35 | |||
36 | ifeq ($(CPU),sh) | ||
37 | # sh need to retain its' -Os | ||
38 | CHESSBOXFLAGS = $(PLUGINFLAGS) | ||
39 | else | ||
40 | CHESSBOXFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O2 | ||
41 | endif | ||
42 | |||
43 | $(CHESSBOX_OUTLDS): $(CHESSBOX_INLDS) $(CHESSBOX_OBJ) | ||
44 | $(call PRINTS,PP $(<F))$(call preprocess2file,$<,$@) | ||
45 | |||
46 | $(CHESSBOX_OBJDIR)/chessbox.rock: $(CHESSBOX_OBJ) $(CHESSBOX_OUTLDS) $(PLUGINBITMAPLIB) | ||
47 | |||
48 | $(CHESSBOX_OBJDIR)/chessbox.ovl: $(CHESSBOX_OBJ) $(CHESSBOX_OUTLDS) $(PLUGINBITMAPLIB) | ||
49 | $(SILENT)$(CC) $(PLUGINFLAGS) -o $(CHESSBOX_OBJDIR)/$*.elf \ | ||
50 | $(filter %.o, $^) \ | ||
51 | $(filter %.a, $^) \ | ||
52 | -lgcc $(CHESSBOX_OVLFLAGS) | ||
53 | $(call PRINTS,LD $(@F))$(OC) -O binary $(CHESSBOX_OBJDIR)/$*.elf $@ | ||
54 | |||
55 | # special pattern rule for compiling chessbox with extra flags | ||
56 | $(CHESSBOX_OBJDIR)/%.o: $(CHESSBOX_SRCDIR)/%.c $(PLUGINBITMAPLIB) $(CHESSBOX_SRCDIR)/chessbox.make | ||
57 | $(SILENT)mkdir -p $(dir $@) | ||
58 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(CHESSBOXFLAGS) -c $< -o $@ | ||