mirror of
https://bitbucket.org/Mattrixwv/projecteulercpp.git
synced 2025-12-06 17:13:59 -05:00
Inital commit with existing files
This commit is contained in:
29
makefile
Normal file
29
makefile
Normal file
@@ -0,0 +1,29 @@
|
||||
LIBFLAGS = -shared -std=c++11 -O3 -fPIC -Wall
|
||||
EXEFLAGS = -Wall -std=c++11 -O3 -Wl,-rpath,'$$ORIGIN/lib'
|
||||
LINKEDLIBS = -lgmp -lgmpxx
|
||||
PROBLEM_NUMBERS = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 67
|
||||
PROBLEM_FILES = $(patsubst %,Source/libProblem%.cpp,$(PROBLEM_NUMBERS))
|
||||
LIBDIR = ./lib
|
||||
LIBS = $(patsubst %, -lProblem%,$(PROBLEM_NUMBERS))
|
||||
|
||||
all: libs ProjectEuler
|
||||
libs: directory $(patsubst %, $(LIBDIR)/libProblem%.so,$(PROBLEM_NUMBERS))
|
||||
|
||||
directory:
|
||||
mkdir -p $(LIBDIR)
|
||||
|
||||
#Building the Libraries
|
||||
$(LIBDIR)/libProblem%.so: Source/Problem%.cpp
|
||||
$(CXX) $(LIBFLAGS) -o $@ $< $(LINKEDLIBS)
|
||||
|
||||
#Building the executable
|
||||
ProjectEuler: main.cpp
|
||||
$(CXX) $(EXEFLAGS) -o $@.exe $< -L $(LIBDIR) $(LIBS) $(LINKEDLIBS)
|
||||
|
||||
|
||||
#Clean up/Remove all files and folders created
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
rm -f lib/*.so ProjectEuler.exe
|
||||
rmdir lib
|
||||
Reference in New Issue
Block a user