From 8d07fe37f7aa4e326c61f92beefb8b4c8096f746 Mon Sep 17 00:00:00 2001 From: Marc barbier <43183491+Marc-Pierre-Barbier@users.noreply.github.com> Date: Tue, 17 Aug 2021 12:35:39 +0200 Subject: [PATCH] Update makefile --- makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index 3e92522..58eca0c 100644 --- a/makefile +++ b/makefile @@ -1,8 +1,9 @@ +LIBS = COMPILER = g++ WINDOWS_COMPILE = x86_64-w64-mingw32-g++ -WINDOWS_LD_FLAG = --static +WINDOWS_LD_FLAG = -Wall -Wextra --static $(shell x86_64-w64-mingw32-pkg-config --static --libs $(LIBS)) COMPILE_FLAG = -c -LD_FLAG = -Wall -o +LD_FLAG = -Wall -Wextra $(shell pkg-config --static --libs $(LIBS)) OBJDIR=./objs/ SRC=./src/ SRCS=$(shell ls src/* | grep "\.c") @@ -13,7 +14,7 @@ windows : winswitch build winlink clean winswitch : echo "building" $(eval COMPILER = $(WINDOWS_COMPILE)) - $(eval LD_FLAG = $(WINDOWS_LD_FLAG) $(LD_FLAG) ) + $(eval LD_FLAG = $(WINDOWS_LD_FLAG) -o ) build : mkdir -p ${OBJDIR} @@ -23,7 +24,7 @@ build : @cd ${OBJDIR} && for src in ${SRCS}; do echo ${COMPILER} ${COMPILE_FLAG} ../$$src && ${COMPILER} ${COMPILE_FLAG} ../$$src; done; link: - ${COMPILER} ${OBJDIR}/* ${LD_FLAG} run + ${COMPILER} ${OBJDIR}/* ${LD_FLAG} -o run winlink: -rm run.exe