From 219a49e4596016e67543760069c62fd6d8a3eb6e Mon Sep 17 00:00:00 2001 From: Matthew Ellison Date: Tue, 1 May 2018 23:36:39 -0400 Subject: [PATCH] Updated documentation and macros --- makefile | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/makefile b/makefile index 79ce048..8ed9b66 100644 --- a/makefile +++ b/makefile @@ -1,10 +1,10 @@ #Macros that are corss platform LIBFLAGS = -shared -std=c++11 -O3 -fPIC EXEFLAGS = -std=c++11 -O3 -TESTFLAGS = $(EXEFLAGS) -DTEST_VERSION +TESTFLAGS = -std=c++11 -DTEST_VERSION DEBUGFLAGS = $(TESTFLAGS) -g LIBDIR = ./lib -CIPHERS = Caesar Playfair Vigenere Atbash +CIPHERS = Caesar Playfair Vigenere Atbash Morse LIBFILES = $(patsubst %,SourceFiles/%.cpp,$(CIPHERS)) #For Linux @@ -28,23 +28,27 @@ WINDOWSLIBS = $(patsubst %, -llib%,$(CIPHERS)) directory: mkdir -p $(LIBDIR) + #Linux +#Building Libraries $(LIBDIR)/lib%.a: SourceFiles/%.cpp $(CXX) $(LIBFLAGS) -o $@ $< +#Building Executables Ciphers: main.cpp helperFunctions.hpp $(CXX) $(EXEFLAGS) -o $@ main.cpp -L $(LIBDIR) $(LINUXLIBS) -CiphersTest: main.cpp - $(CXX) $(TESTFLAGS) -o Ciphers $< -L $(LIBDIR) $(LINUXLIBS) +CiphersTest: main.cpp testMain.hpp + $(CXX) $(TESTFLAGS) -o $@ $< -L $(LIBDIR) $(LINUXLIBS) + +CiphersDBG: main.cpp testMain.hpp $(LIBFILES) + $(CXX) $(DEBUGFLAGS) -o $@ $< $(LIBFILES) -CiphersDBG: main.cpp $(LIBFILES) - $(CXX) $(DEBUGFLAGS) -o $@ $< #Windows - +#Building Libraries #libCaesar.lib: SourceFiles/Caesar.cpp directory # g++ $(LIBFLAGS) -o lib/$@ SourceFiles/Caesar.cpp @@ -60,14 +64,15 @@ CiphersDBG: main.cpp $(LIBFILES) $(LIBDIR)/lib%.lib: SourceFiles/%.cpp g++ $(LIBFLAGS) -o $@ $< +#Building Executables Ciphers.exe: main.cpp helperFunctions.hpp g++ $(EXEFLAGS) -o $@ main.cpp -L $(LIBDIR) $(WINDOWSLIBS) -CiphersTest.exe: main.cpp - g++ $(TESTFLAGS) -o Ciphers.exe $< -L $(LIBDIR) $(WINDOWSLIBS) +CiphersTest.exe: main.cpp testMain.hpp + g++ $(TESTFLAGS) -o $@ $< -L $(LIBDIR) $(WINDOWSLIBS) -CiphersDBG.exe: main.cpp $(LIBFILES) - g++ $(DEBUGFLAGS) -o $@ $< +CiphersDBG.exe: main.cpp testMain.hpp $(LIBFILES) + g++ $(DEBUGFLAGS) -o $@ $< $(LIBFILES) #Cleaning Shop @@ -76,8 +81,8 @@ CiphersDBG.exe: main.cpp $(LIBFILES) #Linux Remove cleanLinux: - rm -f lib/*.a Ciphers CiphersDBG + rm -f lib/*.a Ciphers* #Windows Remove cleanWindows: - rm -f lib/*.lib Ciphers.exe CiphersDBG.exe + rm -f lib/*.lib Ciphers*.exe