From b5177cf20056a292ef02d25574fd81926458f93c Mon Sep 17 00:00:00 2001 From: Dominik Wenger Date: Wed, 9 Jul 2008 21:39:45 +0000 Subject: modify Makefile so its possible to build a universal lib. Building is still complicated. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18002 a1c6a512-1295-4272-9138-f99709370657 --- tools/rbspeex/Makefile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'tools/rbspeex/Makefile') diff --git a/tools/rbspeex/Makefile b/tools/rbspeex/Makefile index 9b2feb196f..5ed8d67425 100644 --- a/tools/rbspeex/Makefile +++ b/tools/rbspeex/Makefile @@ -27,6 +27,11 @@ ifeq ($(findstring MINGW,$(shell uname)),MINGW) CC = gcc endif +ifeq ($(findstring Darwin,$(shell uname)),Darwin) +ARCH_CMD = -arch $(ARCH) +endif + + # This sets up 'SRC' based on the files mentioned in SOURCES SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#") @@ -53,7 +58,7 @@ $(DEPFILE): $(SOURCES) done > $(DEPFILE); \ echo "oo" > /dev/null ) -librbspeex.a: $(OBJS) $(DEPFILE) rbspeex.o +librbspeex$(ARCH_CMD).a: $(OBJS) $(DEPFILE) rbspeex.o @echo AR librbspeex.a $(SILENT)$(AR) ruv $@ $+ > /dev/null 2>&1 @@ -63,14 +68,17 @@ librbspeex.a: $(OBJS) $(DEPFILE) rbspeex.o ../rbspeexdec: $(OBJS) librbspeex.a rbspeexdec.o @echo Linking ../rbspeexdec - $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexdec rbspeexdec.o librbspeex.a -lm + $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexdec rbspeexdec.o librbspeex.a -lm %.o: @echo CC $< - $(SILENT)$(CC) $(CFLAGS) -c $< -o $@ + $(SILENT)$(CC) $(CFLAGS) -c $< -o $@ $(ARCH_CMD) +universal: librbspeexppc.a librbspeexi386.a + @echo lipo libusb.a + @(SILENT) lipo -create librbspeexppc.a librbspeexi386.a -output librbspeex.a clean: - rm -f $(OBJS) libspeex.a librbspeex.a rbspeexenc.o ../rbspeexenc dep-speex + rm -f $(OBJS) rbspeex.o libspeex.a librbspeex.a rbspeexenc.o ../rbspeexenc dep-speex -include $(DEPFILE) -- cgit v1.2.3