diff options
author | Dominik Wenger <domonoky@googlemail.com> | 2008-07-09 21:39:45 +0000 |
---|---|---|
committer | Dominik Wenger <domonoky@googlemail.com> | 2008-07-09 21:39:45 +0000 |
commit | b5177cf20056a292ef02d25574fd81926458f93c (patch) | |
tree | 538d9f68046f38d6be158a4166643bc278000d60 /tools/rbspeex/Makefile | |
parent | df7d6d0e6eb6d0eedae49ef5f9d159f5991a8eae (diff) | |
download | rockbox-b5177cf20056a292ef02d25574fd81926458f93c.tar.gz 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/Makefile | 16 |
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) | |||
27 | CC = gcc | 27 | CC = gcc |
28 | endif | 28 | endif |
29 | 29 | ||
30 | ifeq ($(findstring Darwin,$(shell uname)),Darwin) | ||
31 | ARCH_CMD = -arch $(ARCH) | ||
32 | endif | ||
33 | |||
34 | |||
30 | # This sets up 'SRC' based on the files mentioned in SOURCES | 35 | # This sets up 'SRC' based on the files mentioned in SOURCES |
31 | SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#") | 36 | SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#") |
32 | 37 | ||
@@ -53,7 +58,7 @@ $(DEPFILE): $(SOURCES) | |||
53 | done > $(DEPFILE); \ | 58 | done > $(DEPFILE); \ |
54 | echo "oo" > /dev/null ) | 59 | echo "oo" > /dev/null ) |
55 | 60 | ||
56 | librbspeex.a: $(OBJS) $(DEPFILE) rbspeex.o | 61 | librbspeex$(ARCH_CMD).a: $(OBJS) $(DEPFILE) rbspeex.o |
57 | @echo AR librbspeex.a | 62 | @echo AR librbspeex.a |
58 | $(SILENT)$(AR) ruv $@ $+ > /dev/null 2>&1 | 63 | $(SILENT)$(AR) ruv $@ $+ > /dev/null 2>&1 |
59 | 64 | ||
@@ -63,14 +68,17 @@ librbspeex.a: $(OBJS) $(DEPFILE) rbspeex.o | |||
63 | 68 | ||
64 | ../rbspeexdec: $(OBJS) librbspeex.a rbspeexdec.o | 69 | ../rbspeexdec: $(OBJS) librbspeex.a rbspeexdec.o |
65 | @echo Linking ../rbspeexdec | 70 | @echo Linking ../rbspeexdec |
66 | $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexdec rbspeexdec.o librbspeex.a -lm | 71 | $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexdec rbspeexdec.o librbspeex.a -lm |
67 | 72 | ||
68 | %.o: | 73 | %.o: |
69 | @echo CC $< | 74 | @echo CC $< |
70 | $(SILENT)$(CC) $(CFLAGS) -c $< -o $@ | 75 | $(SILENT)$(CC) $(CFLAGS) -c $< -o $@ $(ARCH_CMD) |
71 | 76 | ||
77 | universal: librbspeexppc.a librbspeexi386.a | ||
78 | @echo lipo libusb.a | ||
79 | @(SILENT) lipo -create librbspeexppc.a librbspeexi386.a -output librbspeex.a | ||
72 | 80 | ||
73 | clean: | 81 | clean: |
74 | rm -f $(OBJS) libspeex.a librbspeex.a rbspeexenc.o ../rbspeexenc dep-speex | 82 | rm -f $(OBJS) rbspeex.o libspeex.a librbspeex.a rbspeexenc.o ../rbspeexenc dep-speex |
75 | 83 | ||
76 | -include $(DEPFILE) | 84 | -include $(DEPFILE) |