mirror of
https://bitbucket.org/Mattrixwv/projecteulercpp.git
synced 2025-12-06 17:13:59 -05:00
Added ability for compiling libraries simultaniously
This commit is contained in:
9
makefile
9
makefile
@@ -1,3 +1,4 @@
|
||||
NUMCORES = ${NUMBER_OF_PROCESSORS}
|
||||
LIBFLAGS = -shared -std=c++11 -O3 -fPIC -Wall
|
||||
EXEFLAGS = -Wall -std=c++11 -O3 -Wl,-rpath,'$$ORIGIN/lib'
|
||||
LINKEDLIBS = -lgmp -lgmpxx
|
||||
@@ -6,10 +7,10 @@ PROBLEM_FILES = $(patsubst %,Source/libProblem%.cpp,$(PROBLEM_NUMBERS))
|
||||
LIBDIR = ./lib
|
||||
LIBS = $(patsubst %, -lProblem%,$(PROBLEM_NUMBERS))
|
||||
|
||||
all: libs ProjectEuler
|
||||
all: libsMulti ProjectEuler
|
||||
libs: directory $(patsubst %, $(LIBDIR)/libProblem%.so,$(PROBLEM_NUMBERS))
|
||||
windows: allWindows
|
||||
allWindows: libsWindows ProjectEuler moveBin
|
||||
allWindows: libsWindowsMulti ProjectEuler moveBin
|
||||
libsWindows: directory $(patsubst %, $(LIBDIR)/libProblem%.a,$(PROBLEM_NUMBERS))
|
||||
|
||||
#Non-build jobs
|
||||
@@ -22,10 +23,14 @@ moveBin:
|
||||
#Building the Libraries
|
||||
$(LIBDIR)/libProblem%.so: Source/Problem%.cpp
|
||||
$(CXX) $(LIBFLAGS) -o $@ $< $(LINKEDLIBS)
|
||||
libsMulti:
|
||||
$(MAKE) libs -j $(NUMCORES)
|
||||
|
||||
#Building the Libraries for Windows
|
||||
$(LIBDIR)/libProblem%.a: Source/Problem%.cpp
|
||||
$(CXX) $(LIBFLAGS) -o $@ $< $(LINKEDLIBS)
|
||||
libsWindowsMulti:
|
||||
$(MAKE) libsWindows -j $(NUMCORES)
|
||||
|
||||
#Building the executable
|
||||
ProjectEuler: main.cpp
|
||||
|
||||
Reference in New Issue
Block a user