diff --git a/Makefile b/Makefile index 74e89c2..8928273 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -# This Makefile was generated using MakeGen made by Tim Håkansson and is -# licensed under MIT. Full source of the project can be found at +# This Makefile was generated using MakeGen v1.0.2 made by Tim Håkansson +# and is licensed under MIT. Full source of the project can be found at # https://github.com/Thraix/MakeGen CC=@g++ CO=@g++ -o @@ -21,15 +21,15 @@ $(OUTPUT): $(OBJECTS) install: all $(info Installing MakeGen to /usr/bin/) @cp $(OUTPUT) /usr/bin/makegen -$(OBJPATH)/ConfigFile.o : src/ConfigFile.cpp src/ConfigFile.h src/Logging.h +$(OBJPATH)/ConfigFile.o : src/ConfigFile.cpp src/Common.h src/ConfigFile.h $(info ---- $<) $(CC) $(CFLAGS) -o $@ $< $(OBJPATH)/IncludeDeps.o : src/IncludeDeps.cpp src/IncludeDeps.h $(info ---- $<) $(CC) $(CFLAGS) -o $@ $< -$(OBJPATH)/Makefile.o : src/Makefile.cpp src/IncludeDeps.h src/Logging.h src/Makefile.h src/ConfigFile.h +$(OBJPATH)/Makefile.o : src/Makefile.cpp src/Common.h src/IncludeDeps.h src/Makefile.h src/ConfigFile.h $(info ---- $<) $(CC) $(CFLAGS) -o $@ $< -$(OBJPATH)/main.o : src/main.cpp src/ConfigFile.h src/IncludeDeps.h src/Logging.h src/Makefile.h +$(OBJPATH)/main.o : src/main.cpp src/Common.h src/ConfigFile.h src/IncludeDeps.h src/Makefile.h $(info ---- $<) $(CC) $(CFLAGS) -o $@ $< diff --git a/src/Logging.h b/src/Common.h similarity index 52% rename from src/Logging.h rename to src/Common.h index 114a417..b50d283 100644 --- a/src/Logging.h +++ b/src/Common.h @@ -2,6 +2,21 @@ #include +#define BIT(x) (1< -#include "Logging.h" +#include "Common.h" #define FLAG_NONE 0 #define FLAG_VECTOR 1 diff --git a/src/Makefile.cpp b/src/Makefile.cpp index 27493a8..e79b852 100644 --- a/src/Makefile.cpp +++ b/src/Makefile.cpp @@ -4,8 +4,8 @@ #include #include #include -#include "Logging.h" #include "IncludeDeps.h" +#include "Common.h" void Makefile::GetAllFiles(const std::string& folder, std::vector& files) { @@ -40,8 +40,8 @@ void Makefile::Save(const ConfigFile& conf) PreSave(conf,hFiles,cppFiles); std::ofstream outputFile("Makefile"); - outputFile << "# This Makefile was generated using MakeGen made by Tim Håkansson and is" << std::endl; - outputFile << "# licensed under MIT. Full source of the project can be found at" << std::endl; + outputFile << "# This Makefile was generated using MakeGen "<< VERSION<< " made by Tim Håkansson" << std::endl; + outputFile << "# and is licensed under MIT. Full source of the project can be found at" << std::endl; outputFile << "# https://github.com/Thraix/MakeGen" << std::endl; outputFile << "CC=@g++" << std::endl; if(!conf.executable) diff --git a/src/main.cpp b/src/main.cpp index a61303b..131a598 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,23 +4,10 @@ #include #include #include +#include "Common.h" #include "IncludeDeps.h" #include "ConfigFile.h" #include "Makefile.h" -#include "Logging.h" - -#define BIT(x) (1< 1) @@ -52,11 +40,12 @@ void ReadFlags(int argc, char** argv) } } } + return flags; } int main(int argc, char** argv) { - ReadFlags(argc,argv); + unsigned int flags = ReadFlags(argc,argv); if(flags & FLAG_HELP) { LOG_INFO("Usage: makegen [options]"); @@ -65,7 +54,7 @@ int main(int argc, char** argv) LOG_INFO(" --conf\tGenerate a config file for the project"); LOG_INFO(" --version\tDisplays the version of this program"); LOG_INFO(" install\tGenerates a Makefile and runs make install"); - LOG_INFO(" clean\tGenerates a Makefile and runs make clean"); + LOG_INFO(" clean\t\tGenerates a Makefile and runs make clean"); LOG_INFO(" rebuild\tGenerates a Makefile and runs make rebuild"); LOG_INFO(" If no option is given it will generate a Makefile and run default make"); return 0;