GoodbyeDPI/Makefile

38 lines
834 B
Makefile
Raw Permalink Normal View History

ifndef MSYSTEM
CPREFIX = x86_64-w64-mingw32-
endif
2017-05-17 12:57:15 +00:00
WINDIVERTHEADERS = ../../include
WINDIVERTLIBS = ../binary
2017-05-16 19:07:40 +00:00
TARGET = goodbyedpi.exe
LIBS = -L$(WINDIVERTLIBS) -lWinDivert -lws2_32
CC = $(CPREFIX)gcc
CCWINDRES = $(CPREFIX)windres
2017-12-16 21:28:11 +00:00
CFLAGS = -Wall -Wextra -I$(WINDIVERTHEADERS) -L$(WINDIVERTLIBS) \
2017-09-07 14:35:57 +00:00
-O2 -pie -fPIE -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2
2017-12-16 21:28:11 +00:00
LDFLAGS = -Wl,-O1,--sort-common,--as-needed
2017-05-16 19:07:40 +00: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)
2017-12-16 21:28:11 +00:00
$(CC) $(OBJECTS) -Wall $(LDFLAGS) $(LIBS) -s -o $@
2017-05-16 19:07:40 +00:00
clean:
-rm -f *.o
-rm -f $(TARGET)