mirror of
https://bitbucket.org/Mattrixwv/cipherstream.git
synced 2025-12-06 18:33:58 -05:00
89 lines
2.4 KiB
Makefile
89 lines
2.4 KiB
Makefile
#Macros that are corss platform
|
|
LIBFLAGS = -shared -std=c++11 -O3 -fPIC -Wall
|
|
EXEFLAGS = -std=c++11 -O3
|
|
TESTFLAGS = -std=c++11 -DTEST_VERSION
|
|
DEBUGFLAGS = $(TESTFLAGS) -g
|
|
LIBDIR = ./lib
|
|
CIPHERS = Caesar Playfair Vigenere Atbash Morse Autokey
|
|
LIBFILES = $(patsubst %,SourceFiles/%.cpp,$(CIPHERS))
|
|
|
|
#For Linux
|
|
allLinux: libsLinux Ciphers
|
|
testLinux: libsLinux CiphersTest
|
|
debugLinux: CiphersDBG
|
|
libsLinux: directory $(patsubst %, $(LIBDIR)/lib%.a,$(CIPHERS))
|
|
LINUXLIBS = $(patsubst %, -l%,$(CIPHERS))
|
|
|
|
#For Windows
|
|
allWindows: libsWindows Ciphers.exe
|
|
testWindows: libsWindows CiphersTest.exe
|
|
debugWindows: CipherDBG.exe
|
|
#Keeping the old one for now, until I can test it to make sure it works
|
|
#WindowsLibs: libCaesar.lib libPlayfair.lib libVigenere.lib libAtbash.lib
|
|
#WINDOWSLIBS = -llibCaesar -llibPlayfair -llibVigenere -llibAtbash
|
|
libsWindows: directory $(patsubst %, $(LIBDIR)/lib%.lib,$(CIPHERS))
|
|
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 testMain.hpp
|
|
$(CXX) $(TESTFLAGS) -o $@ $< -L $(LIBDIR) $(LINUXLIBS)
|
|
|
|
CiphersDBG: main.cpp testMain.hpp $(LIBFILES)
|
|
$(CXX) $(DEBUGFLAGS) -o $@ $< $(LIBFILES)
|
|
|
|
|
|
|
|
#Windows
|
|
#Building Libraries
|
|
#libCaesar.lib: SourceFiles/Caesar.cpp directory
|
|
# g++ $(LIBFLAGS) -o lib/$@ SourceFiles/Caesar.cpp
|
|
|
|
#libPlayfair.lib: SourceFiles/Playfair.cpp directory
|
|
# g++ -shared -std=c++11 -O3 -fPIC -o lib/$@ SourceFiles/Playfair.cpp
|
|
|
|
#libVigenere.lib: SourceFiles/Vigenere.cpp directory
|
|
# g++ -shared -std=c++11 -O3 -fPIC -o lib/$@ SourceFiles/Vigenere.cpp
|
|
|
|
#libAtbash.lib: SourceFiles/Atbash.cpp directory
|
|
# g++ -shared -std=c++11 -O3 -fPIC -o lib/$@ SourceFiles/Atbash.cpp
|
|
|
|
$(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 testMain.hpp
|
|
g++ $(TESTFLAGS) -o $@ $< -L $(LIBDIR) $(WINDOWSLIBS)
|
|
|
|
CiphersDBG.exe: main.cpp testMain.hpp $(LIBFILES)
|
|
g++ $(DEBUGFLAGS) -o $@ $< $(LIBFILES)
|
|
|
|
|
|
#Cleaning Shop
|
|
.PHONY: cleanLinux
|
|
.PHONY: cleanWindows
|
|
|
|
#Linux Remove
|
|
cleanLinux:
|
|
rm -f lib/*.a Ciphers*
|
|
|
|
#Windows Remove
|
|
cleanWindows:
|
|
rm -f lib/*.lib Ciphers*.exe
|