diff --git a/Makefile b/Makefile index 68ddcda..8fb6205 100644 --- a/Makefile +++ b/Makefile @@ -12,11 +12,21 @@ # LINUX version ifeq ($(UNAME), Linux) TARGETS := $(BUILD_DIR)/hello-linux-64 $(BUILD_DIR)/hello-win64.exe $(BUILD_DIR)/hello-macosx.bin +LINUX_CXX := x86_64-linux-gnu-g++ +WIN32_CXX := x86_64-w64-mingw32-g++ +MACOSX_CXX := x86_64-apple-darwin19-c++ endif # WINDOWS version ifeq ($(UNAME), MINGW64_NT-10.0) TARGETS := $(BUILD_DIR)/hello-win64.exe +WIN32_CXX := x86_64-w64-mingw32-g++ +endif + +# MACOSX version +ifeq ($(UNAME), Darwin) +TARGETS := $(BUILD_DIR)/hello-macosx.bin +MACOSX_CXX := x86_64-apple-darwin22-c++-13 endif all: $(TARGETS) @@ -37,15 +47,15 @@ $(BUILD_DIR)/hello-linux-64: Test.cpp $$(@D)/ @echo "Building Linux binary..." - @x86_64-linux-gnu-g++ $< -o $@ + @$(LINUX_CXX) $< -o $@ $(BUILD_DIR)/hello-win64.exe: Test.cpp $$(@D)/ @echo "Building Windows binary..." - @x86_64-w64-mingw32-g++ $< -o $@ + @$(WIN32_CXX) $< -o $@ $(BUILD_DIR)/hello-macosx.bin: Test.cpp $$(@D)/ @echo "Building MacOSX binary..." - @x86_64-apple-darwin19-c++ $< -o $@ + @$(MACOSX_CXX) $< -o $@ tidy: $(BUILD_DIR)/tidy.xml