mirror of
https://bitbucket.org/Mattrixwv/my-classes.git
synced 2025-12-06 18:23:57 -05:00
Created make file to make testing easier
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,7 @@
|
|||||||
#Ignore the Visual Studio Code settings
|
#Ignore the Visual Studio Code settings
|
||||||
.vscode/*
|
.vscode/*
|
||||||
#Ignore the executables
|
#Ignore the executables
|
||||||
|
bin/
|
||||||
*.exe
|
*.exe
|
||||||
|
#Ignore all build logs
|
||||||
|
logs/
|
||||||
|
|||||||
43
makefile
Normal file
43
makefile
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
NUMCORES = $(shell grep -c "^processor" /proc/cpuinfo)
|
||||||
|
NUMCORESWIN = ${NUMBER_OF_PROCESSORS}
|
||||||
|
TESTFLAGS = -O2 -std=c++20 -Wall -fcoroutines
|
||||||
|
LINKEDLIBS = -lgmp -lgmpxx
|
||||||
|
INCLUDE_DIR = ./headers/mee
|
||||||
|
TESTDIR = ./test/mee
|
||||||
|
BINDIR = ./bin
|
||||||
|
LOGDIR = ./logs
|
||||||
|
|
||||||
|
|
||||||
|
all: testMulti
|
||||||
|
test: directory testAlgorithms testStopwatch testDice
|
||||||
|
testAlgorithms: testNumberAlgorithms testStringAlgorithms testVectorAlgorithms
|
||||||
|
testMulti: directory
|
||||||
|
$(MAKE) testAlgorithms testStopwatch testDice -j $(NUMCORESWIN)
|
||||||
|
@echo 'All tests completed successfully'
|
||||||
|
|
||||||
|
|
||||||
|
#Non-build jobs
|
||||||
|
directory:
|
||||||
|
mkdir -p $(BINDIR) $(LOGDIR)
|
||||||
|
|
||||||
|
#Algorithms
|
||||||
|
test%Algorithms: $(TESTDIR)/test%Algorithms.cpp
|
||||||
|
$(CXX) $(TESTFLAGS) -o $(BINDIR)/$@.exe $< -I $(INCLUDE_DIR) $(LINKEDLIBS)
|
||||||
|
$(BINDIR)/$@.exe > $(LOGDIR)/$@.txt
|
||||||
|
|
||||||
|
#Stopwatch
|
||||||
|
testStopwatch: $(TESTDIR)/testStopwatch.cpp
|
||||||
|
$(CXX) $(TESTFLAGS) -o $(BINDIR)/$@.exe $< -I $(INCLUDE_DIR) $(LINKEDLIBS)
|
||||||
|
$(BINDIR)/$@.exe > $(LOGDIR)/$@.txt
|
||||||
|
|
||||||
|
#Dice
|
||||||
|
testDice: $(TESTDIR)/testDice.cpp
|
||||||
|
$(CXX) $(TESTFLAGS) -o $(BINDIR)/$@.exe $< -I $(INCLUDE_DIR) $(LINKEDLIBS)
|
||||||
|
$(BINDIR)/$@.exe > $(LOGDIR)/$@.txt
|
||||||
|
|
||||||
|
#Clean up/Remove all files and folders created
|
||||||
|
.PHONY: clean
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(BINDIR)/* $(LOGDIR)/*
|
||||||
|
rmdir $(BINDIR) $(LOGDIR)
|
||||||
Reference in New Issue
Block a user