From a841942741d8b631b121e49cde098ce3b8556096 Mon Sep 17 00:00:00 2001 From: Mattrixwv Date: Sat, 6 Jun 2020 18:16:55 -0400 Subject: [PATCH] Added an option to compile on windows with mingw-w64 --- makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index 764c955..7291f34 100644 --- a/makefile +++ b/makefile @@ -8,14 +8,25 @@ LIBS = $(patsubst %, -lProblem%,$(PROBLEM_NUMBERS)) all: libs ProjectEuler libs: directory $(patsubst %, $(LIBDIR)/libProblem%.so,$(PROBLEM_NUMBERS)) +windows: allWindows +allWindows: libsWindows ProjectEuler moveBin +libsWindows: directory $(patsubst %, $(LIBDIR)/libProblem%.a,$(PROBLEM_NUMBERS)) +#Non-build jobs directory: mkdir -p $(LIBDIR) +moveBin: + mv ProjectEuler.exe lib/ProjectEuler.exe + #Building the Libraries $(LIBDIR)/libProblem%.so: Source/Problem%.cpp $(CXX) $(LIBFLAGS) -o $@ $< $(LINKEDLIBS) +#Building the Libraries for Windows +$(LIBDIR)/libProblem%.a: Source/Problem%.cpp + $(CXX) $(LIBFLAGS) -o $@ $< $(LINKEDLIBS) + #Building the executable ProjectEuler: main.cpp $(CXX) $(EXEFLAGS) -o $@.exe $< -L $(LIBDIR) $(LIBS) $(LINKEDLIBS) @@ -25,5 +36,5 @@ ProjectEuler: main.cpp .PHONY: clean clean: - rm -f lib/*.so ProjectEuler.exe + rm -f lib/* ProjectEuler.exe rmdir lib