From 30bb1a665a86d4db89b1ae0cd44834c449853217 Mon Sep 17 00:00:00 2001 From: R4SAS Date: Wed, 13 Dec 2017 17:13:54 +0300 Subject: [PATCH] make it more usable with MSYS and linux MinGW both (#48) * make it more usable * update README --- Makefile | 13 ++++++++----- README.md | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index a2e896d..83dc2b2 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,15 @@ -CPREFIX = x86_64-w64-mingw32 +ifndef MSYSTEM + CPREFIX = x86_64-w64-mingw32- +endif + WINDIVERTHEADERS = ../../include WINDIVERTLIBS = ../binary TARGET = goodbyedpi.exe -LIBS = -L $(WINDIVERTLIBS) -lWinDivert -lws2_32 -CC = $(CPREFIX)-gcc -CCWINDRES = $(CPREFIX)-windres -CFLAGS = -Wall -I $(WINDIVERTHEADERS) -L $(WINDIVERTLIBS) \ +LIBS = -L$(WINDIVERTLIBS) -lWinDivert -lws2_32 +CC = $(CPREFIX)gcc +CCWINDRES = $(CPREFIX)windres +CFLAGS = -Wall -I$(WINDIVERTHEADERS) -L$(WINDIVERTLIBS) \ -O2 -pie -fPIE -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 LDFLAGS = -pie diff --git a/README.md b/README.md index 6cae2b7..4110dba 100644 --- a/README.md +++ b/README.md @@ -65,11 +65,11 @@ This project can be build using **GNU Make** and [**mingw**](https://mingw-w64.o To build x86 exe run: -`make CPREFIX=i686-w64-mingw32 WINDIVERTHEADERS=/path/to/windivert/include WINDIVERTLIBS=/path/to/windivert/x86` +`make CPREFIX=i686-w64-mingw32- WINDIVERTHEADERS=/path/to/windivert/include WINDIVERTLIBS=/path/to/windivert/x86` And for x86_64: -`make CPREFIX=x86_64-w64-mingw32 WINDIVERTHEADERS=/path/to/windivert/include WINDIVERTLIBS=/path/to/windivert/amd64` +`make CPREFIX=x86_64-w64-mingw32- WINDIVERTHEADERS=/path/to/windivert/include WINDIVERTLIBS=/path/to/windivert/amd64` # How to install as Windows Service