summaryrefslogtreecommitdiffstats
path: root/tools/rbspeex/Makefile
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2008-07-09 21:39:45 +0000
committerDominik Wenger <domonoky@googlemail.com>2008-07-09 21:39:45 +0000
commitb5177cf20056a292ef02d25574fd81926458f93c (patch)
tree538d9f68046f38d6be158a4166643bc278000d60 /tools/rbspeex/Makefile
parentdf7d6d0e6eb6d0eedae49ef5f9d159f5991a8eae (diff)
downloadrockbox-b5177cf20056a292ef02d25574fd81926458f93c.tar.gz
rockbox-b5177cf20056a292ef02d25574fd81926458f93c.tar.bz2
rockbox-b5177cf20056a292ef02d25574fd81926458f93c.zip
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
Diffstat (limited to 'tools/rbspeex/Makefile')
-rw-r--r--tools/rbspeex/Makefile16
1 files changed, 12 insertions, 4 deletions
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)