mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
puzzles: simplify makefile
Change-Id: I14b4bda7e706e73d2d4475c9d536fbef9e2b9577
This commit is contained in:
parent
115806f273
commit
4bc3bfe612
1 changed files with 16 additions and 57 deletions
|
|
@ -10,41 +10,24 @@
|
|||
PUZZLES_SRCDIR = $(APPSDIR)/plugins/puzzles
|
||||
PUZZLES_OBJDIR = $(BUILDDIR)/apps/plugins/puzzles
|
||||
|
||||
# define this as "yes" to do a monolithic build -- remember to also
|
||||
# uncomment the sgt-puzzles loader in apps/plugins/SOURCES
|
||||
PUZZLES_COMBINED =
|
||||
|
||||
ifdef PUZZLES_COMBINED
|
||||
PUZZLES_SRC := $(call preprocess, $(PUZZLES_SRCDIR)/SOURCES, -DCOMBINED)
|
||||
else
|
||||
PUZZLES_SRC := $(call preprocess, $(PUZZLES_SRCDIR)/SOURCES)
|
||||
endif
|
||||
|
||||
ifndef PUZZLES_COMBINED
|
||||
PUZZLES_SHARED_OBJ := $(call c2obj, $(PUZZLES_SRC))
|
||||
endif
|
||||
PUZZLES_SHARED_SRC := $(call preprocess, $(PUZZLES_SRCDIR)/SOURCES)
|
||||
PUZZLES_SHARED_OBJ := $(call c2obj, $(PUZZLES_SHARED_SRC))
|
||||
|
||||
PUZZLES_GAMES_SRC := $(call preprocess, $(PUZZLES_SRCDIR)/SOURCES.games)
|
||||
PUZZLES_SRC += $(PUZZLES_GAMES_SRC)
|
||||
PUZZLES_GAMES_OBJ := $(call c2obj, $(PUZZLES_GAMES_SRC))
|
||||
|
||||
PUZZLES_SRC := $(PUZZLES_GAMES_SRC) $(PUZZLES_SHARED_SRC)
|
||||
PUZZLES_OBJ := $(call c2obj, $(PUZZLES_SRC))
|
||||
OTHER_SRC += $(PUZZLES_SRC)
|
||||
|
||||
ifdef PUZZLES_COMBINED
|
||||
ifndef APP_TYPE
|
||||
ROCKS += $(PUZZLES_OBJDIR)/puzzles.ovl
|
||||
PUZZLES_OUTLDS = $(PUZZLES_OBJDIR)/puzzles.link
|
||||
PUZZLES_OVLFLAGS = -T$(PUZZLES_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
|
||||
else
|
||||
ROCKS += $(PUZZLES_OBJDIR)/puzzles.rock
|
||||
endif
|
||||
else
|
||||
PUZZLES_ROCKS := $(addprefix $(PUZZLES_OBJDIR)/sgt-, $(notdir $(PUZZLES_GAMES_SRC:.c=.rock)))
|
||||
ROCKS += $(PUZZLES_ROCKS)
|
||||
endif
|
||||
|
||||
PUZZLESOPTIMIZE := -O2
|
||||
OTHER_SRC += $(PUZZLES_SRC)
|
||||
ROCKS += $(PUZZLES_ROCKS)
|
||||
|
||||
PUZZLES_OPTIMIZE := -O2
|
||||
|
||||
ifeq ($(MODELNAME), sansac200v2)
|
||||
PUZZLESOPTIMIZE := -Os # tiny plugin buffer
|
||||
PUZZLES_OPTIMIZE := -Os # tiny plugin buffer
|
||||
endif
|
||||
|
||||
# we suppress all warnings
|
||||
|
|
@ -53,45 +36,21 @@ PUZZLESFLAGS = -I$(PUZZLES_SRCDIR)/dummy \
|
|||
-Wno-unused-parameter -Wno-sign-compare -Wno-strict-aliasing -w \
|
||||
-DFOR_REAL -I$(PUZZLES_SRCDIR)/src -I$(PUZZLES_SRCDIR) -include \
|
||||
$(PUZZLES_SRCDIR)/rbcompat.h
|
||||
ifdef PUZZLES_COMBINED
|
||||
PUZZLESFLAGS += -DCOMBINED
|
||||
endif
|
||||
|
||||
ifdef PUZZLES_COMBINED
|
||||
$(PUZZLES_OBJDIR)/puzzles.rock: $(PUZZLES_OBJ) $(TLSFLIB)
|
||||
|
||||
$(PUZZLES_OBJDIR)/puzzles.refmap: $(PUZZLES_OBJ) $(TLSFLIB)
|
||||
|
||||
$(PUZZLES_OUTLDS): $(PLUGIN_LDS) $(PUZZLES_OBJDIR)/puzzles.refmap
|
||||
$(call PRINTS,PP $(@F))$(call preprocess2file,$<,$@,-DOVERLAY_OFFSET=$(shell \
|
||||
$(TOOLSDIR)/ovl_offset.pl $(PUZZLES_OBJDIR)/puzzles.refmap))
|
||||
|
||||
$(PUZZLES_OBJDIR)/puzzles.ovl: $(PUZZLES_OBJ) $(PUZZLES_OUTLDS) $(TLSFLIB)
|
||||
$(SILENT)$(CC) $(PLUGINFLAGS) -o $(basename $@).elf \
|
||||
$(filter %.o, $^) \
|
||||
$(filter %.a, $+) \
|
||||
-lgcc $(PUZZLES_OVLFLAGS)
|
||||
$(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@)
|
||||
else
|
||||
$(PUZZLES_OBJDIR)/sgt-%.rock: $(PUZZLES_OBJDIR)/src/%.o $(PUZZLES_SHARED_OBJ) $(TLSFLIB)
|
||||
$(call PRINTS,LD $(@F))$(CC) $(PLUGINFLAGS) -o $(PUZZLES_OBJDIR)/$*.elf \
|
||||
$(filter %.o, $^) \
|
||||
$(filter %.a, $+) \
|
||||
-lgcc $(filter-out -Wl%.map, $(PLUGINLDFLAGS)) -Wl,-Map,$(PUZZLES_OBJDIR)/src/$*.map
|
||||
$(SILENT)$(call objcopy,$(PUZZLES_OBJDIR)/$*.elf,$@)
|
||||
endif
|
||||
|
||||
$(PUZZLES_SRCDIR)/rbcompat.h: $(APPSDIR)/plugin.h $(BUILDDIR)/sysfont.h $(PUZZLES_SRCDIR)/rbassert.h $(APPSDIR)/plugins/lib/pluginlib_exit.h $(TLSFLIB_DIR)/src/tlsf.h
|
||||
$(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
|
||||
|
||||
# special pattern rule for compiling puzzles with extra flags
|
||||
$(PUZZLES_OBJDIR)/%.o: $(PUZZLES_SRCDIR)/%.c $(PUZZLES_SRCDIR)/puzzles.make $(PUZZLES_SRCDIR)/rbcompat.h
|
||||
$(SILENT)mkdir -p $(dir $@)
|
||||
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PUZZLESFLAGS) -c $< -o $@
|
||||
|
||||
$(PUZZLES_OBJDIR)/src/%.o: $(PUZZLES_SRCDIR)/src/%.c $(PUZZLES_SRCDIR)/puzzles.make $(PUZZLES_SRCDIR)/rbcompat.h
|
||||
$(SILENT)mkdir -p $(dir $@)
|
||||
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PUZZLESFLAGS) -c $< -o $@
|
||||
|
||||
$(PUZZLES_OBJDIR)/src/unfinished/%.o: $(PUZZLES_SRCDIR)/src/unfinished/%.c $(PUZZLES_SRCDIR)/puzzles.make $(PUZZLES_SRCDIR)/rbcompat.h
|
||||
$(SILENT)mkdir -p $(dir $@)
|
||||
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PUZZLESFLAGS) -c $< -o $@
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue