From 8ebff817a29d8e3fed2602f29fc649d2a3261ebc Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 6 Mar 2005 15:40:03 +0000 Subject: Use the new generic SRC build "macro" in tools/makesrc.inc to process the SOURCES file. Hopefully this now works better for Mac OS X people. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6152 a1c6a512-1295-4272-9138-f99709370657 --- apps/Makefile | 5 +++-- apps/codecs/Tremor/Makefile | 4 +++- apps/codecs/libFLAC/Makefile | 5 +++-- apps/codecs/liba52/Makefile | 4 +++- apps/codecs/libmad/Makefile | 4 +++- apps/codecs/libwavpack/Makefile | 4 +++- apps/plugins/Makefile | 20 ++++++++++++++------ apps/plugins/lib/Makefile | 4 +++- firmware/Makefile | 4 +++- 9 files changed, 38 insertions(+), 16 deletions(-) diff --git a/apps/Makefile b/apps/Makefile index d943d2a855..af73f90d3f 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -21,8 +21,9 @@ ifdef SOFTWARECODECS CODECS=build-codecs endif -SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \ -$(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) +# This sets up 'SRC' based on the files mentioned in SOURCES +include $(TOOLSDIR)/makesrc.inc + DIRS = . ifdef APPEXTRA diff --git a/apps/codecs/Tremor/Makefile b/apps/codecs/Tremor/Makefile index 14910b39ca..5e97c60534 100644 --- a/apps/codecs/Tremor/Makefile +++ b/apps/codecs/Tremor/Makefile @@ -17,7 +17,9 @@ endif TREMOROPTS = CFLAGS = $(GCCOPTS) $(TREMOROPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} -SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) +# This sets up 'SRC' based on the files mentioned in SOURCES +include $(TOOLSDIR)/makesrc.inc + SOURCES = $(SRC) OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) diff --git a/apps/codecs/libFLAC/Makefile b/apps/codecs/libFLAC/Makefile index ffc4880a17..1c8b0682a7 100644 --- a/apps/codecs/libFLAC/Makefile +++ b/apps/codecs/libFLAC/Makefile @@ -28,8 +28,9 @@ endif CFLAGS = $(GCCOPTS) $(FLACOPTS)\ $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} -SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \ -$(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) +# This sets up 'SRC' based on the files mentioned in SOURCES +include $(TOOLSDIR)/makesrc.inc + SOURCES = $(SRC) OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) diff --git a/apps/codecs/liba52/Makefile b/apps/codecs/liba52/Makefile index ee13ca18c1..7baa71feb0 100644 --- a/apps/codecs/liba52/Makefile +++ b/apps/codecs/liba52/Makefile @@ -17,7 +17,9 @@ endif A52OPTS = CFLAGS = $(GCCOPTS) $(A52OPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} -SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) +# This sets up 'SRC' based on the files mentioned in SOURCES +include $(TOOLSDIR)/makesrc.inc + SOURCES = $(SRC) OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) diff --git a/apps/codecs/libmad/Makefile b/apps/codecs/libmad/Makefile index 5cac2d052e..cef3adae11 100644 --- a/apps/codecs/libmad/Makefile +++ b/apps/codecs/libmad/Makefile @@ -18,7 +18,9 @@ MADOPTS = -DFPM_DEFAULT -DNDEBUG CFLAGS = $(GCCOPTS) $(MADOPTS)\ $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} -SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) +# This sets up 'SRC' based on the files mentioned in SOURCES +include $(TOOLSDIR)/makesrc.inc + SOURCES = $(SRC) OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) diff --git a/apps/codecs/libwavpack/Makefile b/apps/codecs/libwavpack/Makefile index 73cd9667e5..54d95be2c0 100644 --- a/apps/codecs/libwavpack/Makefile +++ b/apps/codecs/libwavpack/Makefile @@ -17,7 +17,9 @@ endif CFLAGS = $(GCCOPTS) \ $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} -SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) +# This sets up 'SRC' based on the files mentioned in SOURCES +include $(TOOLSDIR)/makesrc.inc + SOURCES = $(SRC) OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile index fdabc8cf22..c19843d979 100644 --- a/apps/plugins/Makefile +++ b/apps/plugins/Makefile @@ -24,8 +24,9 @@ LDS := plugin.lds LINKFILE := $(OBJDIR)/pluginlink.lds DEPFILE = $(OBJDIR)/dep-plugins -SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \ - $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) +# This sets up 'SRC' based on the files mentioned in SOURCES +include $(TOOLSDIR)/makesrc.inc + ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock) SOURCES = $(SRC) ELFS := $(SRC:%.c=$(OBJDIR)/%.elf) @@ -34,6 +35,8 @@ OBJS := $(SRC:%.c=$(OBJDIR)/%.o) DEFS := $(SRC:%.c=$(OBJDIR)/%.def) DIRS = . +ELFDEP = $(OBJDIR)/dep-elf + #for any recorder and iRiver model ifneq (,$(strip $(foreach tgt,RECORDER IRIVER,$(findstring $(tgt),$(TARGET))))) SUBDIRS += rockboy @@ -43,9 +46,14 @@ endif all: $(OBJDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE) ifndef SIMVER -$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(OBJDIR)/libplugin.a - @echo "LD $@" - @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(OBJDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map + +ELFIT=@echo "LD $@"; \ + $(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(OBJDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map + +$(ELFDEP): $(SOURCES) + perl elfdep.pl > $(ELFDEP) + +-include $(ELFDEP) $(OBJDIR)/%.rock : $(OBJDIR)/%.elf @echo "OBJCOPY $<" @@ -109,7 +117,7 @@ $(SUBDIRS): clean: @echo "cleaning plugins" @rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \ - $(OBJS) $(DEFS) + $(OBJS) $(DEFS) $(ELFDEP) @$(MAKE) -C lib clean @$(MAKE) -C rockboy clean diff --git a/apps/plugins/lib/Makefile b/apps/plugins/lib/Makefile index b492bb578f..fbd4cefbe0 100644 --- a/apps/plugins/lib/Makefile +++ b/apps/plugins/lib/Makefile @@ -20,7 +20,9 @@ endif CFLAGS = $(GCCOPTS) \ $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} -DPLUGIN -SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) +# This sets up 'SRC' based on the files mentioned in SOURCES +include $(TOOLSDIR)/makesrc.inc + SOURCES = $(SRC) OBJS := $(SRC:%.c=$(OBJDIR)/%.o) DEPFILE = $(OBJDIR)/dep-pluginlib diff --git a/firmware/Makefile b/firmware/Makefile index 618a7703ac..a858edfe7c 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -11,7 +11,9 @@ INCLUDES=-Iinclude -I$(FIRMDIR) -Iexport -Icommon -Idrivers CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} -SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) +# This sets up 'SRC' based on the files mentioned in SOURCES +include $(TOOLSDIR)/makesrc.inc + SOURCES = $(SRC) OBJS2 := $(patsubst %.c, $(OBJDIR)/%.o, $(SRC)) $(OBJDIR)/sysfont.o OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) -- cgit v1.2.3