password manager with aes encryption
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.8KB

  1. .PHONY: cryptomain.ex crypt.ex decrypt.ex doxygenconf
  2. GCXX_DEBUG=-ggdb
  3. CFLAGS=-Wall -Wextra --std=c++14 $(GCXX_DEBUG)
  4. LDFLAGS=$(shell pkg-config --libs libcrypto jsoncpp)
  5. CXX=g++
  6. BIN_PATH=./bin
  7. LIB_PATH=./lib
  8. OBJ_PATH=./obj
  9. EXEC=$(BIN_PATH)/cryptomain.ex
  10. SRC=main.cpp
  11. BASE64_O=$(OBJ_PATH)/base64.o
  12. cryptomain.ex: $(EXEC)
  13. # merge crypt and decrypt binary into cryptomain
  14. $(EXEC): $(SRC) *.hpp $(BASE64_O)
  15. @echo "compilation de aes"
  16. @$(CXX) $(CFLAGS) $(LDFLAGS) -o $(EXEC) $(SRC) $(BASE64_O)
  17. SOURCES_BASE64=$(wildcard $(LIB_PATH)/base64/base64.*)
  18. $(BASE64_O): $(SOURCES_BASE64)
  19. @echo "compilation de base64"
  20. @$(CXX) $(CFLAGS) -c $(LIB_PATH)/base64/base64.cpp -o $(BASE64_O)
  21. run: $(EXEC)
  22. @./$(EXEC) data/cryptomain/file
  23. # separate crypt and decrypt binary
  24. EXEC_DECRYPT=$(BIN_PATH)/decrypt.ex
  25. EXEC_CRYPT=$(BIN_PATH)/crypt.ex
  26. SRC_CRYPT=mainCrypt.cpp
  27. SRC_DECRYPT=mainDecrypt.cpp
  28. crypt.ex: $(EXEC_CRYPT)
  29. decrypt.ex: $(EXEC_DECRYPT)
  30. $(EXEC_CRYPT): $(SRC_CRYPT) *.hpp $(BASE64_O)
  31. @echo "compilation de crypt.ex"
  32. @$(CXX) $(CFLAGS) $(LDFLAGS) -o $(EXEC_CRYPT) $(SRC_CRYPT) $(BASE64_O)
  33. $(EXEC_DECRYPT): $(SRC_DECRYPT) *.hpp $(BASE64_O)
  34. @echo "compilation de decrypt.ex"
  35. @$(CXX) $(CFLAGS) $(LDFLAGS) -o $(EXEC_DECRYPT) $(SRC_DECRYPT) $(BASE64_O)
  36. run2: $(EXEC_CRYPT) $(EXEC_DECRYPT)
  37. @./$(EXEC_CRYPT) data/crypt_decrypt/file && ./$(EXEC_DECRYPT) data/crypt_decrypt/file.enc data/crypt_decrypt/file.key
  38. # debug target
  39. valgrind:
  40. @valgrind --leak-check=full --track-origins=yes ./$(EXEC) file
  41. # clean target
  42. clean: cleanO cleanB
  43. cleanO:
  44. @rm -rf $(OBJ_PATH)/*.o
  45. cleanB:
  46. @rm -rf $(BIN_PATH)/*.ex
  47. cleanD:
  48. @rm -f data/*.enc
  49. @rm -f data/*.dec
  50. @rm -f data/*.key
  51. markdown:
  52. @pandoc --defaults=pandocConfig.yaml
  53. doxygenconf:
  54. @doxygen -g doxygen.conf
  55. doc: doxygen.conf
  56. @doxygen doxygen.conf