diff --git a/apps/codecs/codecs.make b/apps/codecs/codecs.make index 30fea9969e..be1a0e0f00 100644 --- a/apps/codecs/codecs.make +++ b/apps/codecs/codecs.make @@ -109,7 +109,7 @@ $(CODECDIR)/%.o: $(ROOTDIR)/apps/codecs/%.c $(CODECDIR)/%.o: $(ROOTDIR)/apps/codecs/%.S $(SILENT)mkdir -p $(dir $@) $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \ - -I$(dir $<) $(CODECFLAGS) -c $< -o $@ + -I$(dir $<) $(CODECFLAGS) $(ASMFLAGS) -c $< -o $@ ifdef APP_TYPE CODECLDFLAGS = $(SHARED_FLAG) # <-- from Makefile diff --git a/apps/codecs/demac/libdemac/predictor-cf.S b/apps/codecs/demac/libdemac/predictor-cf.S index 1617f9aa9c..fc1d901a59 100644 --- a/apps/codecs/demac/libdemac/predictor-cf.S +++ b/apps/codecs/demac/libdemac/predictor-cf.S @@ -24,11 +24,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA */ -/* workaround gcc 3.4.6 -std=gnu99 */ -#ifndef __ASSEMBLER__ -#define __ASSEMBLER__ -#endif - #include "demac_config.h" /* NOTE: The following need to be kept in sync with parser.h */ diff --git a/apps/codecs/libmad/libmad.make b/apps/codecs/libmad/libmad.make index 58d2dc84e6..f8423b88fe 100644 --- a/apps/codecs/libmad/libmad.make +++ b/apps/codecs/libmad/libmad.make @@ -53,7 +53,7 @@ $(CODECDIR)/libmad-mpeg/%.o : $(ROOTDIR)/apps/codecs/libmad/%.c $(CODECDIR)/libmad-mpeg/%.o : $(ROOTDIR)/apps/codecs/libmad/%.S $(SILENT)mkdir -p $(dir $@) $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<)) \ - $(CC) $(MPEGMADFLAGS) -c $< -o $@ + $(CC) $(MPEGMADFLAGS) $(ASMFLAGS) -c $< -o $@ $(CODECDIR)/libmad/%.o: $(ROOTDIR)/apps/codecs/libmad/%.c $(SILENT)mkdir -p $(dir $@) @@ -63,4 +63,4 @@ $(CODECDIR)/libmad/%.o: $(ROOTDIR)/apps/codecs/libmad/%.c $(CODECDIR)/libmad/%.o: $(ROOTDIR)/apps/codecs/libmad/%.S $(SILENT)mkdir -p $(dir $@) $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<)) \ - $(CC) $(MADFLAGS) -c $< -o $@ + $(CC) $(MADFLAGS) $(ASMFLAGS) -c $< -o $@ diff --git a/apps/codecs/libspeex/libspeex.make b/apps/codecs/libspeex/libspeex.make index e25ea646c5..ee93e7113d 100644 --- a/apps/codecs/libspeex/libspeex.make +++ b/apps/codecs/libspeex/libspeex.make @@ -52,7 +52,7 @@ $(CODECDIR)/libspeex-voice/%.o : $(ROOTDIR)/apps/codecs/libspeex/%.c $(CODECDIR)/libspeex-voice/%.o : $(ROOTDIR)/apps/codecs/libspeex/%.S $(SILENT)mkdir -p $(dir $@) - $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(VOICESPEEXFLAGS) -c $< -o $@ + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(VOICESPEEXFLAGS) $(ASMFLAGS) -c $< -o $@ $(CODECDIR)/libspeex/%.o: $(ROOTDIR)/apps/codecs/libspeex/%.c $(SILENT)mkdir -p $(dir $@) @@ -60,4 +60,4 @@ $(CODECDIR)/libspeex/%.o: $(ROOTDIR)/apps/codecs/libspeex/%.c $(CODECDIR)/libspeex/%.o: $(ROOTDIR)/apps/codecs/libspeex/%.S $(SILENT)mkdir -p $(dir $@) - $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SPEEXFLAGS) -c $< -o $@ + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SPEEXFLAGS) $(ASMFLAGS) -c $< -o $@ diff --git a/apps/codecs/libtta/libtta.make b/apps/codecs/libtta/libtta.make index b18d013cbf..d458ab78bc 100644 --- a/apps/codecs/libtta/libtta.make +++ b/apps/codecs/libtta/libtta.make @@ -31,4 +31,4 @@ $(CODECDIR)/libtta/%.o: $(ROOTDIR)/apps/codecs/libtta/%.c $(CODECDIR)/libtta/%.o: $(ROOTDIR)/apps/codecs/libtta/%.S $(SILENT)mkdir -p $(dir $@) - $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(TTAFLAGS) -c $< -o $@ + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(TTAFLAGS) $(ASMFLAGS) -c $< -o $@ diff --git a/firmware/test/kernel/Makefile b/firmware/test/kernel/Makefile index be82abfcb9..94171767c6 100644 --- a/firmware/test/kernel/Makefile +++ b/firmware/test/kernel/Makefile @@ -19,7 +19,7 @@ OBJS= ../../crt0.o ../../system.o main.o ../../panic.o ../../drivers/lcd.o \ ../../debug.o ../../common/sprintf.o %.o: %.S - $(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) -c $< + $(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) $(ASMFLAGS) -c $< all : archos.mod diff --git a/tools/make.inc b/tools/make.inc index 5521612f62..d03898b2e1 100644 --- a/tools/make.inc +++ b/tools/make.inc @@ -11,7 +11,7 @@ $(OBJDIR)/%.o: %.c $(OBJDIR)/%.o: %.S $(SILENT)mkdir -p $(dir $@) - $(call PRINTS,CC $<)$(CC) $(CFLAGS) -c $< -o $@ + $(call PRINTS,CC $<)$(CC) $(CFLAGS) $(ASMFLAGS) -c $< -o $@ # The echo stuff last in the dep update shell magic is to prevent any compiler # errors/warnings to cause an error code to get returned and thus stop the diff --git a/tools/root.make b/tools/root.make index 401599aeb5..885a80d2c6 100644 --- a/tools/root.make +++ b/tools/root.make @@ -16,6 +16,7 @@ INCLUDES = -I$(BUILDDIR) -I$(BUILDDIR)/lang $(TARGET_INC) CFLAGS = $(INCLUDES) $(DEFINES) $(GCCOPTS) PPCFLAGS = $(filter-out -g -Dmain=SDL_main,$(CFLAGS)) # cygwin sdl-config fix +ASMFLAGS = -D__ASSEMBLER__ # work around gcc 3.4.x bug with -std=gnu99, only meant for .S files TOOLS = $(TOOLSDIR)/rdf2binary $(TOOLSDIR)/convbdf \ $(TOOLSDIR)/codepages $(TOOLSDIR)/scramble $(TOOLSDIR)/bmp2rb \ @@ -343,7 +344,7 @@ $(BUILDDIR)/%.o: $(ROOTDIR)/%.c $(BUILDDIR)/%.o: $(ROOTDIR)/%.S $(SILENT)mkdir -p $(dir $@) - $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) -c $< -o $@ + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) $(ASMFLAGS) -c $< -o $@ # generated definitions for use in .S files $(BUILDDIR)/%_asmdefs.h: $(ROOTDIR)/%_asmdefs.c @@ -358,7 +359,7 @@ $(BUILDDIR)/%_asmdefs.h: $(ROOTDIR)/%_asmdefs.c %.o: %.S $(SILENT)mkdir -p $(dir $@) - $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) -c $< -o $@ + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(CFLAGS) $(ASMFLAGS) -c $< -o $@ Makefile: $(TOOLSDIR)/configure ifneq (reconf,$(MAKECMDGOALS))