From edf280df63b4b88e71c7d5b5be8e336106d81991 Mon Sep 17 00:00:00 2001 From: Jussi Kivilinna Date: Sun, 13 Oct 2024 13:07:03 +0300 Subject: [PATCH] Makefile: use g++ for C++ source files and gcc for C source files Signed-off-by: Jussi Kivilinna --- .github/workflows/ccpp.yml | 2 +- Makefile | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 0537985..bfefcd0 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -12,7 +12,7 @@ jobs: - name: Update package list for i386 run: sudo dpkg --add-architecture i386 && sudo apt-get -y update - name: Install packages - run: sudo apt-get -y install build-essential g++-multilib gcc-mingw-w64 + run: sudo apt-get -y install build-essential g++-multilib gcc-mingw-w64 g++-mingw-w64 - name: make run: make - name: cleanup 1 diff --git a/Makefile b/Makefile index 04c3fac..8008a3d 100644 --- a/Makefile +++ b/Makefile @@ -5,14 +5,16 @@ ## ifeq ($(OSTYPE),win32) - CPP = i686-w64-mingw32-gcc -m32 + CPP = i686-w64-mingw32-g++ -m32 + CC = i686-w64-mingw32-gcc -m32 AR = i686-w64-mingw32-ar rc RANLIB = i686-w64-mingw32-ranlib LINKFLAGS = -mdll -lm -lwsock32 -lws2_32 -Xlinker --add-stdcall-alias -s DLLEND = .dll ZLIB_OSFLAGS = else - CPP = gcc -m32 + CPP = g++ -m32 + CC = gcc -m32 AR = ar rc RANLIB = ranlib ARCHFLAG = -fPIC @@ -65,11 +67,11 @@ SRC = bot.cpp \ OBJ = $(SRC:%.cpp=%.o) ${TARGET}${DLLEND}: zlib/libz.a ${OBJ} - ${CPP} -o $@ ${OBJ} zlib/libz.a ${LINKFLAGS} + ${CC} -o $@ ${OBJ} zlib/libz.a ${LINKFLAGS} cp $@ addons/jk_botti/dlls/ zlib/libz.a: - (cd zlib; AR="${AR}" RANLIB="${RANLIB}" CC="${CPP} ${OPTFLAGS} ${ARCHFLAG} ${ZLIB_OSFLAGS} -DASMV" ./configure; $(MAKE) OBJA=match.o; cd ..) + (cd zlib; AR="${AR}" RANLIB="${RANLIB}" CC="${CC} ${OPTFLAGS} ${ARCHFLAG} ${ZLIB_OSFLAGS} -DASMV" ./configure; $(MAKE) OBJA=match.o; cd ..) clean: rm -f *.o ${TARGET}${DLLEND} Rules.depend zlib/*.exe