Files
CipherStream/makefile

50 lines
1.2 KiB
Makefile

#CipherStream/makefile
#Matthew Ellison
# Created: 4-25-18
#Modified: 9-19-18
#A list of the ciphers that can be used
#This is used to create the libraries and for cpp files in the test version
CIPHERS = Caesar Playfair Vigenere Atbash Morse Autokey
#Other usefull macros
LIBFLAGS = -shared -std=c++11 -O3 -fPIC -Wall
EXEFLAGS = -std=c++11 -O3
TESTFLAGS = -std=c++11 -DTEST_VERSION
DEBUGFLAGS = $(TESTFLAGS) -g
LIBDIR = ./lib
LIBFILES = $(patsubst %,SourceFiles/%.cpp,$(CIPHERS))
#Different portions to compile
#Using the simplest make command compiles all
all: libs CipherStream
test: libs CiphersTest
debug: CiphersDBG
libs: directory $(patsubst %, $(LIBDIR)/lib%.a,$(CIPHERS))
LIBS = $(patsubst %, -l%,$(CIPHERS))
directory:
mkdir -p $(LIBDIR)
#Building Libraries
$(LIBDIR)/lib%.a: SourceFiles/%.cpp
$(CXX) $(LIBFLAGS) -o $@ $<
#Building Executables
CipherStream: main.cpp helperFunctions.hpp
$(CXX) $(EXEFLAGS) -o $@ main.cpp -L $(LIBDIR) $(LIBS)
CiphersTest: main.cpp testMain.hpp
$(CXX) $(TESTFLAGS) -o $@ $< -L $(LIBDIR) $(LIBS)
CiphersDBG: main.cpp testMain.hpp $(LIBFILES)
$(CXX) $(DEBUGFLAGS) -o $@ $< $(LIBFILES)
#Cleaning Shop
.PHONY: clean
#Linux Remove
clean:
rm -f lib/*.a Cipher*