diff --git a/Module.o b/Module.o deleted file mode 100644 index 879a955..0000000 Binary files a/Module.o and /dev/null differ diff --git a/Services.o b/Services.o deleted file mode 100644 index 81abd88..0000000 Binary files a/Services.o and /dev/null differ diff --git a/bin/deployer b/bin/deployer new file mode 100755 index 0000000..4804c9d Binary files /dev/null and b/bin/deployer differ diff --git a/deployer b/deployer deleted file mode 100755 index 76c604a..0000000 Binary files a/deployer and /dev/null differ diff --git a/main.o b/main.o deleted file mode 100644 index 47c8858..0000000 Binary files a/main.o and /dev/null differ diff --git a/Specifications.md b/notes/Specifications.md similarity index 100% rename from Specifications.md rename to notes/Specifications.md diff --git a/docker.md b/notes/docker.md similarity index 100% rename from docker.md rename to notes/docker.md diff --git a/letsencrypt.md b/notes/letsencrypt.md similarity index 100% rename from letsencrypt.md rename to notes/letsencrypt.md diff --git a/main_deploy_service.md b/notes/main_deploy_service.md similarity index 100% rename from main_deploy_service.md rename to notes/main_deploy_service.md diff --git a/main_preparation_deploy_all.md b/notes/main_preparation_deploy_all.md similarity index 100% rename from main_preparation_deploy_all.md rename to notes/main_preparation_deploy_all.md diff --git a/nginx_library.md b/notes/nginx_library.md similarity index 100% rename from nginx_library.md rename to notes/nginx_library.md diff --git a/wireguard.md b/notes/wireguard.md similarity index 100% rename from wireguard.md rename to notes/wireguard.md diff --git a/Makefile b/src/Makefile similarity index 64% rename from Makefile rename to src/Makefile index 8ea7e95..3eb2561 100644 --- a/Makefile +++ b/src/Makefile @@ -1,17 +1,20 @@ ECHO = @echo GCC = g++ RM = @rm -f -CCFLAGS = -c -g -std=c++11 -pedantic -Wall #optimization? +CCFLAGS = -c -O3 -g -std=c++11 -pedantic -Wall OBJETS = $(SRC:.cpp=.o) SRC = $(wildcard *.cpp) EXE = deployer +BIN = ../bin +OBJETS_DIR = $(OBJETS:%=$(BIN)/%) +EXE_DIR = $(EXE:%=$(BIN)/%) LIBRARIES = -$(EXE) : $(OBJETS) +$(EXE_DIR) : $(OBJETS_DIR) $(ECHO) "-Linking $(EXE)-" $(GCC) -o $@ $^ $(LIBRARIES) -%.o:%.cpp +$(BIN)/%.o:%.cpp $(ECHO) "-Compilation $<- " $(GCC) $(CCFLAGS) -o $@ $< diff --git a/Module.cpp b/src/Module.cpp similarity index 100% rename from Module.cpp rename to src/Module.cpp diff --git a/Module.h b/src/Module.h similarity index 100% rename from Module.h rename to src/Module.h diff --git a/Services.cpp b/src/Services.cpp similarity index 89% rename from Services.cpp rename to src/Services.cpp index 78a5221..dc2b86b 100644 --- a/Services.cpp +++ b/src/Services.cpp @@ -9,14 +9,14 @@ #include #include "Services.h" -Services::Services(const char *ServicesCSV) +Services::Services(string ServicesCSV) { services=readServicesFromCSV(ServicesCSV); } Services::~Services(){} -vector Services::readServicesFromCSV (const char *CSV) const +vector Services::readServicesFromCSV (string CSV) const { //this method extracts the list of uid|username|servers from the services.csv file //and returns them in a vector , with serviceData a structure defined in the header @@ -26,8 +26,8 @@ vector Services::readServicesFromCSV (const char *CSV) const cout << "Invalid services.csv file." << endl; }else{ string line; + string tmpUserID; //used before converting to int int userID; - string tmpUserID; string username; string serveur; list serveurs; diff --git a/Services.h b/src/Services.h similarity index 80% rename from Services.h rename to src/Services.h index 793a52d..cff7efd 100644 --- a/Services.h +++ b/src/Services.h @@ -22,10 +22,10 @@ class Services //extracts the list of uid|username|service from the services.csv file { public: - Services(const char * servicesCSV="services.csv"); + Services(string servicesCSV="../src/services.csv"); ~Services(); private: - vector readServicesFromCSV (const char *CSV) const; + vector readServicesFromCSV (string CSV) const; vector services; }; diff --git a/main.cpp b/src/main.cpp similarity index 93% rename from main.cpp rename to src/main.cpp index 046ea29..821aa4c 100644 --- a/main.cpp +++ b/src/main.cpp @@ -36,8 +36,7 @@ int main(int argc, char *argv[]) cout << "Invalid argument. \n" << endl; exit(1); } - - Services myServices=Services("services.csv"); + Services myServices=Services("../src/services.csv"); } return 0; diff --git a/services.csv b/src/services.csv similarity index 100% rename from services.csv rename to src/services.csv