2017-12-13 15:13:54 +01:00
|
|
|
ifndef MSYSTEM
|
|
|
|
CPREFIX = x86_64-w64-mingw32-
|
|
|
|
endif
|
|
|
|
|
2017-05-17 14:57:15 +02:00
|
|
|
WINDIVERTHEADERS = ../../include
|
|
|
|
WINDIVERTLIBS = ../binary
|
|
|
|
|
2017-05-16 21:07:40 +02:00
|
|
|
TARGET = goodbyedpi.exe
|
2017-12-13 15:13:54 +01:00
|
|
|
LIBS = -L$(WINDIVERTLIBS) -lWinDivert -lws2_32
|
|
|
|
CC = $(CPREFIX)gcc
|
|
|
|
CCWINDRES = $(CPREFIX)windres
|
|
|
|
CFLAGS = -Wall -I$(WINDIVERTHEADERS) -L$(WINDIVERTLIBS) \
|
2017-09-07 16:35:57 +02:00
|
|
|
-O2 -pie -fPIE -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2
|
|
|
|
LDFLAGS = -pie
|
2017-05-16 21:07:40 +02:00
|
|
|
|
|
|
|
.PHONY: default all clean
|
|
|
|
|
|
|
|
default: manifest $(TARGET)
|
|
|
|
all: default
|
|
|
|
|
|
|
|
OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c)) goodbyedpi-rc.o
|
|
|
|
HEADERS = $(wildcard *.h)
|
|
|
|
|
|
|
|
%.o: %.c $(HEADERS)
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
manifest:
|
|
|
|
$(CCWINDRES) goodbyedpi-rc.rc goodbyedpi-rc.o
|
|
|
|
|
|
|
|
.PRECIOUS: $(TARGET) $(OBJECTS)
|
|
|
|
|
|
|
|
$(TARGET): $(OBJECTS)
|
|
|
|
$(CC) $(OBJECTS) -Wall $(LIBS) -s -o $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
-rm -f *.o
|
|
|
|
-rm -f $(TARGET)
|