2016-11-20 20:16:41 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
|
|
|
|
PUZZLES_SRCDIR = $(APPSDIR)/plugins/puzzles
|
|
|
|
PUZZLES_OBJDIR = $(BUILDDIR)/apps/plugins/puzzles
|
|
|
|
|
2017-05-05 00:10:58 +00:00
|
|
|
PUZZLES_SHARED_SRC = $(call preprocess, $(PUZZLES_SRCDIR)/SOURCES)
|
|
|
|
PUZZLES_SHARED_OBJ = $(call c2obj, $(PUZZLES_SHARED_SRC))
|
2016-11-20 20:16:41 +00:00
|
|
|
|
2017-05-05 00:10:58 +00:00
|
|
|
PUZZLES_GAMES_SRC = $(call preprocess, $(PUZZLES_SRCDIR)/SOURCES.games)
|
|
|
|
PUZZLES_GAMES_OBJ = $(call c2obj, $(PUZZLES_GAMES_SRC))
|
2017-05-02 22:32:59 +00:00
|
|
|
|
2017-06-03 17:45:07 +00:00
|
|
|
PUZZLES_HELP_SRC = $(wildcard $(PUZZLES_SRCDIR)/help/*)
|
|
|
|
PUZZLES_HELP_OBJ = $(call c2obj, $(PUZZLES_HELP_OBJ))
|
|
|
|
|
|
|
|
PUZZLES_SRC = $(PUZZLES_GAMES_SRC) $(PUZZLES_SHARED_SRC) $(PUZZLES_HELP_SRC)
|
2017-05-05 00:10:58 +00:00
|
|
|
PUZZLES_OBJ = $(call c2obj, $(PUZZLES_SRC))
|
2016-11-20 20:16:41 +00:00
|
|
|
|
2017-05-05 00:10:58 +00:00
|
|
|
PUZZLES_ROCKS = $(addprefix $(PUZZLES_OBJDIR)/sgt-, $(notdir $(PUZZLES_GAMES_SRC:.c=.rock)))
|
2017-05-02 22:32:59 +00:00
|
|
|
|
|
|
|
OTHER_SRC += $(PUZZLES_SRC)
|
2016-11-20 20:16:41 +00:00
|
|
|
ROCKS += $(PUZZLES_ROCKS)
|
|
|
|
|
2017-05-05 00:10:58 +00:00
|
|
|
PUZZLES_OPTIMIZE = -O2
|
2017-05-02 22:32:59 +00:00
|
|
|
|
2017-01-15 19:07:18 +00:00
|
|
|
ifeq ($(MODELNAME), sansac200v2)
|
2017-05-05 00:10:58 +00:00
|
|
|
PUZZLES_OPTIMIZE = -Os # tiny plugin buffer
|
2017-01-15 19:07:18 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# we suppress all warnings
|
2017-04-30 20:32:57 +00:00
|
|
|
PUZZLESFLAGS = -I$(PUZZLES_SRCDIR)/dummy \
|
2017-05-05 00:10:58 +00:00
|
|
|
$(filter-out -O%,$(PLUGINFLAGS)) $(PUZZLES_OPTIMIZE) \
|
2017-04-30 17:56:34 +00:00
|
|
|
-Wno-unused-parameter -Wno-sign-compare -Wno-strict-aliasing -w \
|
2017-04-30 20:32:57 +00:00
|
|
|
-DFOR_REAL -I$(PUZZLES_SRCDIR)/src -I$(PUZZLES_SRCDIR) -include \
|
|
|
|
$(PUZZLES_SRCDIR)/rbcompat.h
|
2016-11-20 20:16:41 +00:00
|
|
|
|
2017-06-03 17:45:07 +00:00
|
|
|
$(PUZZLES_OBJDIR)/sgt-%.rock: $(PUZZLES_OBJDIR)/src/%.o $(PUZZLES_OBJDIR)/help/%.o $(PUZZLES_SHARED_OBJ) $(TLSFLIB)
|
2017-02-10 22:11:55 +00:00
|
|
|
$(call PRINTS,LD $(@F))$(CC) $(PLUGINFLAGS) -o $(PUZZLES_OBJDIR)/$*.elf \
|
2017-02-10 03:34:20 +00:00
|
|
|
$(filter %.o, $^) \
|
|
|
|
$(filter %.a, $+) \
|
2017-04-29 22:21:56 +00:00
|
|
|
-lgcc $(filter-out -Wl%.map, $(PLUGINLDFLAGS)) -Wl,-Map,$(PUZZLES_OBJDIR)/src/$*.map
|
2017-02-10 22:11:55 +00:00
|
|
|
$(SILENT)$(call objcopy,$(PUZZLES_OBJDIR)/$*.elf,$@)
|
2016-11-20 20:16:41 +00:00
|
|
|
|
2017-05-02 22:32:59 +00:00
|
|
|
$(PUZZLES_SRCDIR)/rbcompat.h: $(APPSDIR)/plugin.h \
|
|
|
|
$(APPSDIR)/plugins/lib/pluginlib_exit.h \
|
|
|
|
$(BUILDDIR)/sysfont.h \
|
|
|
|
$(PUZZLES_SRCDIR)/rbassert.h \
|
|
|
|
$(TLSFLIB_DIR)/src/tlsf.h
|
2017-04-30 21:37:06 +00:00
|
|
|
|
2016-11-20 20:16:41 +00:00
|
|
|
# special pattern rule for compiling puzzles with extra flags
|
2017-04-30 21:37:06 +00:00
|
|
|
$(PUZZLES_OBJDIR)/%.o: $(PUZZLES_SRCDIR)/%.c $(PUZZLES_SRCDIR)/puzzles.make $(PUZZLES_SRCDIR)/rbcompat.h
|
2016-11-20 20:16:41 +00:00
|
|
|
$(SILENT)mkdir -p $(dir $@)
|
|
|
|
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PUZZLESFLAGS) -c $< -o $@
|