Skip to content

Commit

Permalink
Update Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
SashaXser committed Aug 13, 2024
1 parent 84fa19b commit f07ff66
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@ MINGWLIB = /usr/$(CPREFIX)/lib/
MINGWINCLUDE = /usr/$(CPREFIX)/include/

TARGET = goodbyedpi.exe
LIBS = -L$(WINDIVERTLIBS) -lWinDivert -lws2_32 -l:libssp.a
CC = clang --target=$(CPREFIX) --sysroot=/usr/$(CPREFIX)
LIBS = -L$(WINDIVERTLIBS) -lWinDivert -lws2_32
CC = $(CPREFIX)gcc

CCWINDRES = llvm-windres --target=$(CPREFIX)
ifeq (, $(shell which $(CPREFIX)llvm-windres))
CCWINDRES = llvm-windres
CCWINDRES = $(CPREFIX)windres
ifeq (, $(shell which $(CPREFIX)windres))
CCWINDRES = windres
endif

CFLAGS = -std=c99 -fPIE -pipe -I$(WINDIVERTHEADERS) -I$(MINGWINCLUDE) -I/usr/$(CPREFIX)/include -L$(WINDIVERTLIBS) \
# Обновленные флаги компиляции
CFLAGS = -std=c99 -fPIE -pipe -I$(WINDIVERTHEADERS) -I$(MINGWINCLUDE) -L$(WINDIVERTLIBS) \
-O3 -march=x86-64-v3 -D_FORTIFY_SOURCE=2 -fstack-protector \
-Wall -Wextra -Wpedantic -Wformat=2 -Wshadow -Wstrict-aliasing=1 \
-Wnull-dereference -Wcast-align -Wsign-conversion

LDFLAGS = -fstack-protector -Wl,-O1,-pie,--dynamicbase,--nxcompat,--sort-common,--as-needed \
-Wl,--disable-auto-image-base -L$(MINGWLIB)
LDFLAGS = -fstack-protector -Wl,-O3,-pie,--dynamicbase,--nxcompat,--sort-common,--as-needed \
-Wl,--disable-auto-image-base

ifdef BIT64
LDFLAGS += -Wl,--high-entropy-va -Wl,--pic-executable,-e,mainCRTStartup
Expand All @@ -48,7 +49,8 @@ goodbyedpi-rc.o:
.PRECIOUS: $(TARGET) $(OBJECTS)

$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) $(LDFLAGS) $(LIBS) -s -o $@

clean:
-rm -f *.o utils/*.o
-rm -f $(TARGET)
-rm -f $(TARGET)

0 comments on commit f07ff66

Please sign in to comment.