From b4edd2a94f8573072e2c29684c7d33dd7d046f0a Mon Sep 17 00:00:00 2001 From: LiviaMedeiros Date: Fri, 20 Sep 2024 17:10:38 +0800 Subject: [PATCH 1/3] move build files to '/build/` --- src/Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Makefile b/src/Makefile index 015490ea..48d761e7 100644 --- a/src/Makefile +++ b/src/Makefile @@ -6,7 +6,7 @@ WINDIVERTHEADERS = ../../../include WINDIVERTLIBS = ../../binary MINGWLIB = /usr/x86_64-w64-mingw32/lib/ -TARGET = goodbyedpi.exe +TARGET = ../build/goodbyedpi.exe # Linking SSP does not work for some reason, the executable doesn't start. #LIBS = -L$(WINDIVERTLIBS) -Wl,-Bstatic -lssp -Wl,-Bdynamic -lWinDivert -lws2_32 LIBS = -L$(WINDIVERTLIBS) -lWinDivert -lws2_32 -l:libssp.a @@ -41,14 +41,16 @@ endif default: $(TARGET) all: default -OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c utils/*.c)) goodbyedpi-rc.o +OBJECTS = $(patsubst %.c, ../build/%.o, $(wildcard *.c utils/*.c)) ../build/goodbyedpi-rc.o HEADERS = $(wildcard *.h utils/*.h) -%.o: %.c $(HEADERS) +../build/%.o: %.c $(HEADERS) + @mkdir -p ../build/utils $(CC) $(CFLAGS) -c $< -o $@ -goodbyedpi-rc.o: - $(CCWINDRES) goodbyedpi-rc.rc goodbyedpi-rc.o +../build/goodbyedpi-rc.o: + @mkdir -p ../build/utils + $(CCWINDRES) goodbyedpi-rc.rc ../build/goodbyedpi-rc.o .PRECIOUS: $(TARGET) $(OBJECTS) @@ -56,5 +58,5 @@ $(TARGET): $(OBJECTS) $(CC) $(OBJECTS) $(LDFLAGS) $(LIBS) -s -o $@ clean: - -rm -f *.o utils/*.o + -rm -f ../build/*.o ../build/utils/*.o -rm -f $(TARGET) From 968e65111348c812d65b4e09a33ba751c167a279 Mon Sep 17 00:00:00 2001 From: LiviaMedeiros Date: Fri, 20 Sep 2024 17:14:13 +0800 Subject: [PATCH 2/3] use `/build/` in GitHub workflow --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e4f6da4..33eba401 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,7 +56,7 @@ jobs: - name: Prepare x86_64 directory run: | mkdir goodbyedpi_x86_64_${{ steps.vars.outputs.sha_short }} - cp src/goodbyedpi.exe ${{ env.WINDIVERT_BASENAME }}/x64/*.{dll,sys} goodbyedpi_x86_64_${{ steps.vars.outputs.sha_short }} + cp build/goodbyedpi.exe ${{ env.WINDIVERT_BASENAME }}/x64/*.{dll,sys} goodbyedpi_x86_64_${{ steps.vars.outputs.sha_short }} - name: Upload output file x86_64 uses: actions/upload-artifact@v4 @@ -72,7 +72,7 @@ jobs: - name: Prepare x86 directory run: | mkdir goodbyedpi_x86_${{ steps.vars.outputs.sha_short }} - cp src/goodbyedpi.exe ${{ env.WINDIVERT_BASENAME }}/x86/*.{dll,sys} goodbyedpi_x86_${{ steps.vars.outputs.sha_short }} + cp build/goodbyedpi.exe ${{ env.WINDIVERT_BASENAME }}/x86/*.{dll,sys} goodbyedpi_x86_${{ steps.vars.outputs.sha_short }} - name: Upload output file x86 uses: actions/upload-artifact@v4 From 9be056aa4d85e777ed722d79e5fcbe4b96f5244c Mon Sep 17 00:00:00 2001 From: LiviaMedeiros Date: Fri, 20 Sep 2024 17:16:00 +0800 Subject: [PATCH 3/3] add 'build' to `.gitignore` --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 25a7384d..be5de8c8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.o *.exe +/build