From f9b7572c1bef5598f40cd4cebd309e50f85d5685 Mon Sep 17 00:00:00 2001 From: Andrew Mahone Date: Sun, 8 Feb 2009 16:59:06 +0000 Subject: [PATCH] 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 --- utils/MTP/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 @@ CFLAGS = -Wall LIBS = -lmtp OUTPUT = sendfirm +EXTRA_CFLAGS = $(shell echo -e \ + '\#include \nlibmtp version: LIBMTP_VERSION' | \ + gcc -E -P - -o - | grep -q '^libmtp version: 0\.2' && echo '-DOLDMTP') all: $(OUTPUT) $(OUTPUT): sendfirm.c - gcc $(CFLAGS) $(LIBS) -o $(OUTPUT) sendfirm.c || gcc $(CFLAGS) $(LIBS) -DOLDMTP -o $(OUTPUT) sendfirm.c + gcc $(EXTRA_CFLAGS) $(CFLAGS) $(LIBS) -o $(OUTPUT) sendfirm.c $(OUTPUT).exe: sendfirm_win.c mingw32-gcc $(CFLAGS) -o $(OUTPUT).exe sendfirm_win.c MTP_DLL.dll