mirror of
https://bitbucket.org/Mattrixwv/projecteulercpp.git
synced 2025-12-06 17:13:59 -05:00
Added an option to compile on windows with mingw-w64
This commit is contained in:
13
makefile
13
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
|
||||
|
||||
Reference in New Issue
Block a user