.PHONY: cryptomain.ex crypt.ex decrypt.ex BIN_PATH=./bin LIB_PATH=./lib OBJ_PATH=./obj EXEC=$(BIN_PATH)/cryptomain.ex SRC=main.cpp JSON_CPP=$(OBJ_PATH)/jsoncpp.o cryptomain.ex: $(EXEC) # merge crypt and decrypt binary into cryptomain $(EXEC): $(SRC) $(JSON_CPP) @echo "compilation de aes" @g++ -Wall -Wextra -ggdb -o $(EXEC) $(SRC) $(JSON_CPP) -lcrypto --std=c++14 $(JSON_CPP): $(LIB_PATH)/jsoncpp.cpp $(LIB_PATH)/json/json.h $(LIB_PATH)/json/json-forwards.h @echo "compilation de jsoncpp" @g++ -I ../lib/jsoncpp-master/include/ -Wall -Wextra -std=c++11 -c -ggdb $(LIB_PATH)/jsoncpp.cpp -o $(JSON_CPP) run: $(EXEC) @./$(EXEC) data/cryptomain/file # separate crypt and decrypt binary EXEC_DECRYPT=$(BIN_PATH)/decrypt.ex EXEC_CRYPT=$(BIN_PATH)/crypt.ex SRC_CRYPT=mainCrypt.cpp SRC_DECRYPT=mainDecrypt.cpp crypt.ex: $(EXEC_CRYPT) decrypt.ex: $(EXEC_DECRYPT) $(EXEC_CRYPT): $(SRC_CRYPT) $(JSON_CPP) aes.hpp @echo "compilation de crypt.ex" @g++ -Wall -Wextra -ggdb -o $(EXEC_CRYPT) $(SRC_CRYPT) $(JSON_CPP) -lcrypto --std=c++14 $(EXEC_DECRYPT): $(SRC_DECRYPT) $(JSON_CPP) aes.hpp @echo "compilation de decrypt.ex" @g++ -Wall -Wextra -ggdb -o $(EXEC_DECRYPT) $(SRC_DECRYPT) $(JSON_CPP) -lcrypto --std=c++14 run2: $(EXEC_CRYPT) $(EXEC_DECRYPT) @./$(EXEC_CRYPT) data/crypt_decrypt/file && ./$(EXEC_DECRYPT) data/crypt_decrypt/file.enc data/crypt_decrypt/file.key # debug target valgrind: @valgrind --leak-check=full --track-origins=yes ./$(EXEC) file # clean target clean: cleanO cleanB cleanO: @rm -rf $(OBJ_PATH)/*.o cleanB: @rm -rf $(BIN_PATH)/*.ex cleanD: @rm -f data/*.enc @rm -f data/*.dec @rm -f data/*.key doc: @pandoc -s -f markdown+emoji -t html \ --shift-heading-level-by=2 \ --wrap=preserve \ --toc \ --toc-depth=2 \ --highlight-style=tango \ -o readme.html readme.md