diff options
-rw-r--r-- | utils/MTP/Makefile | 5 |
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 @@ | |||
1 | CFLAGS = -Wall | 1 | CFLAGS = -Wall |
2 | LIBS = -lmtp | 2 | LIBS = -lmtp |
3 | OUTPUT = sendfirm | 3 | OUTPUT = sendfirm |
4 | EXTRA_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 | ||
5 | all: $(OUTPUT) | 8 | all: $(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 |