summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Mahone <andrew.mahone@gmail.com>2009-02-08 16:59:06 +0000
committerAndrew Mahone <andrew.mahone@gmail.com>2009-02-08 16:59:06 +0000
commitf9b7572c1bef5598f40cd4cebd309e50f85d5685 (patch)
treeecfc5ba18d49e7e10b63bbfff009e13294de6e11
parent040bb7a8f5b08b62dc4fef8c4736a43e9e088fef (diff)
downloadrockbox-f9b7572c1bef5598f40cd4cebd309e50f85d5685.tar.gz
rockbox-f9b7572c1bef5598f40cd4cebd309e50f85d5685.zip
extract LIBMTP_VERSION from header, and use that to set -DOLDMTP when building sendfirm, rather than trying to build each way
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19945 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--utils/MTP/Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/MTP/Makefile b/utils/MTP/Makefile
index 6c709ec152..8439f8b72a 100644
--- a/utils/MTP/Makefile
+++ b/utils/MTP/Makefile
@@ -1,11 +1,14 @@
1CFLAGS = -Wall 1CFLAGS = -Wall
2LIBS = -lmtp 2LIBS = -lmtp
3OUTPUT = sendfirm 3OUTPUT = sendfirm
4EXTRA_CFLAGS = $(shell echo -e \
5 '\#include <libmtp.h>\nlibmtp version: LIBMTP_VERSION' | \
6 gcc -E -P - -o - | grep -q '^libmtp version: 0\.2' && echo '-DOLDMTP')
4 7
5all: $(OUTPUT) 8all: $(OUTPUT)
6 9
7$(OUTPUT): sendfirm.c 10$(OUTPUT): sendfirm.c
8 gcc $(CFLAGS) $(LIBS) -o $(OUTPUT) sendfirm.c || gcc $(CFLAGS) $(LIBS) -DOLDMTP -o $(OUTPUT) sendfirm.c 11 gcc $(EXTRA_CFLAGS) $(CFLAGS) $(LIBS) -o $(OUTPUT) sendfirm.c
9 12
10$(OUTPUT).exe: sendfirm_win.c 13$(OUTPUT).exe: sendfirm_win.c
11 mingw32-gcc $(CFLAGS) -o $(OUTPUT).exe sendfirm_win.c MTP_DLL.dll 14 mingw32-gcc $(CFLAGS) -o $(OUTPUT).exe sendfirm_win.c MTP_DLL.dll