diff --git a/Makefile b/Makefile index df24277..bc32c18 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# This Makefile was generated using MakeGen v1.1.7 made by Tim HÃ¥kansson +# This Makefile was generated using MakeGen v1.1.8 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++ @@ -7,7 +7,7 @@ MKDIR_P=mkdir -p BIN=bin/ OBJPATH=$(BIN)intermediates INCLUDES= -OBJECTS=$(OBJPATH)/ConfigFile.o $(OBJPATH)/HFileGen.o $(OBJPATH)/IncludeDeps.o $(OBJPATH)/Makefile.o $(OBJPATH)/Utils.o $(OBJPATH)/main.o +OBJECTS=$(OBJPATH)/ConfigCLI.o $(OBJPATH)/ConfigFile.o $(OBJPATH)/HFileGen.o $(OBJPATH)/IncludeDeps.o $(OBJPATH)/Makefile.o $(OBJPATH)/Utils.o $(OBJPATH)/main.o CFLAGS=$(INCLUDES) -std=c++17 -c -w -g3 -D_DEBUG LIBDIR= LDFLAGS= @@ -33,21 +33,24 @@ $(OUTPUT): $(OBJECTS) install: all $(info Installing MakeGen to /usr/bin/) @cp $(OUTPUT) /usr/bin/makegen +$(OBJPATH)/ConfigCLI.o : src/ConfigCLI.cpp src/Common.h src/ConfigCLI.h src/ConfigFile.h + $(info -[14%]- $<) + $(CC) $(CFLAGS) -o $@ $< $(OBJPATH)/ConfigFile.o : src/ConfigFile.cpp src/ConfigFile.h src/FileUtils.h src/Common.h src/Utils.h - $(info -[16%]- $<) + $(info -[28%]- $<) $(CC) $(CFLAGS) -o $@ $< $(OBJPATH)/HFileGen.o : src/HFileGen.cpp src/FileUtils.h src/Common.h src/Utils.h src/ConfigFile.h src/HFileGen.h - $(info -[33%]- $<) + $(info -[42%]- $<) $(CC) $(CFLAGS) -o $@ $< $(OBJPATH)/IncludeDeps.o : src/IncludeDeps.cpp src/Common.h src/IncludeDeps.h src/ConfigFile.h src/FileUtils.h src/Utils.h - $(info -[50%]- $<) + $(info -[57%]- $<) $(CC) $(CFLAGS) -o $@ $< $(OBJPATH)/Makefile.o : src/Makefile.cpp src/IncludeDeps.h src/ConfigFile.h src/FileUtils.h src/Common.h src/Utils.h src/Makefile.h - $(info -[66%]- $<) + $(info -[71%]- $<) $(CC) $(CFLAGS) -o $@ $< $(OBJPATH)/Utils.o : src/Utils.cpp src/FileUtils.h src/Common.h src/Utils.h src/ConfigFile.h - $(info -[83%]- $<) + $(info -[85%]- $<) $(CC) $(CFLAGS) -o $@ $< -$(OBJPATH)/main.o : src/main.cpp src/Common.h src/ConfigFile.h src/FileUtils.h src/Utils.h src/HFileGen.h src/Makefile.h src/Timer.h +$(OBJPATH)/main.o : src/main.cpp src/Common.h src/ConfigCLI.h src/ConfigFile.h src/FileUtils.h src/Utils.h src/HFileGen.h src/Makefile.h src/Timer.h $(info -[100%]- $<) $(CC) $(CFLAGS) -o $@ $< diff --git a/README.md b/README.md index 05d245d..fc2715a 100644 --- a/README.md +++ b/README.md @@ -29,13 +29,20 @@ This will install MakeGen into `/usr/bin/makegen`. If you want it to be installed in another place just run `make` and copy the file to where you want it. ## Usage +### Config file In order to create a MakeGen configuration file use the following command: - makegen --conf + makegen conf gen prompt This will prompt you with all the needed configurations in order to create a Makefile which will compile your code. When this is done it will create a file called `makegen.conf` which contains all relevant data for MakeGen to create a Makefile. +If you want to change your config you can modify the makegen.conf file or use makegens config command line interface. +To see the possible changes you can do see the help file by entering: + + makegen conf + +### Compiling After that simply compile your code with: makegen @@ -52,4 +59,4 @@ If multiple options are given to MakeGen it will execute them in the following o clean all install run Since MakeGen generates include dependencies in your Makefile it can cause the Makefile to get very cluttered. -In order to make it less cluttered you can run `makegen --simple` which will generate (and run) a Makefile without header file dependencies. +In order to make it less cluttered you can run `makegen --simple` which will generate (and run) a Makefile without header file dependencies. \ No newline at end of file diff --git a/makegen.conf b/makegen.conf index 89366d7..e445d05 100644 --- a/makegen.conf +++ b/makegen.conf @@ -1,18 +1,19 @@ #libs #libdirs #includedirs -#srcdir -src #defines _DEBUG #compileflags +#dependencies +#srcdir +src/ #outputdir -bin +bin/ #projectname MakeGen #outputname makegen #executable true -#dependencies - +#generatehfile +false diff --git a/src/Common.h b/src/Common.h index cec2180..6b5af40 100755 --- a/src/Common.h +++ b/src/Common.h @@ -12,20 +12,20 @@ // Release , should be backwards compatible with any minor version #define MAKEGEN_VERSION_RELEASE 1 // Minor changes, should be compatible with any other minor version with same major and release. -#define MAKEGEN_VERSION_MINOR 7 +#define MAKEGEN_VERSION_MINOR 8 #define MAKEGEN_VERSION ("v" STR(MAKEGEN_VERSION_MAJOR) "." STR(MAKEGEN_VERSION_RELEASE) "." STR(MAKEGEN_VERSION_MINOR)) const static unsigned int FLAG_HELP = BIT(0); -const static unsigned int FLAG_GEN = BIT(1); -const static unsigned int FLAG_VERSION = BIT(2); -const static unsigned int FLAG_CLEAN = BIT(3); -const static unsigned int FLAG_MAKE = BIT(4); -const static unsigned int FLAG_RUN = BIT(5); -const static unsigned int FLAG_INSTALL = BIT(6); -const static unsigned int FLAG_REBUILD = BIT(7); -const static unsigned int FLAG_SINGLE_THREAD = BIT(8); -const static unsigned int FLAG_DEPENDENCY = BIT(9); -const static unsigned int FLAG_SIMPLE = BIT(10); +const static unsigned int FLAG_VERSION = BIT(1); +const static unsigned int FLAG_CLEAN = BIT(2); +const static unsigned int FLAG_MAKE = BIT(3); +const static unsigned int FLAG_RUN = BIT(4); +const static unsigned int FLAG_INSTALL = BIT(5); +const static unsigned int FLAG_REBUILD = BIT(6); +const static unsigned int FLAG_SINGLE_THREAD = BIT(7); +const static unsigned int FLAG_DEPENDENCY = BIT(8); +const static unsigned int FLAG_SIMPLE = BIT(9); +const static unsigned int FLAG_CONFIG = BIT(10); #define LOG_INFO(...) Log(__VA_ARGS__); std::cout << std::endl diff --git a/src/ConfigCLI.cpp b/src/ConfigCLI.cpp new file mode 100644 index 0000000..d8d8796 --- /dev/null +++ b/src/ConfigCLI.cpp @@ -0,0 +1,367 @@ +#include "ConfigCLI.h" + +#include "Common.h" +#include "ConfigFile.h" + +#include + +void ConfigCLI::DisplayCLIHelp() +{ + LOG_INFO("MakeGen conf is used to create, modify and query the makegen.conf file."); + LOG_INFO(""); + LOG_INFO("Usage: makegen conf [] [--help] "); + LOG_INFO(""); + LOG_INFO("Generating config files"); + LOG_INFO(" gen Prompt the user to enter information to create config"); + LOG_INFO(""); + + LOG_INFO("Modifying config settings"); + LOG_INFO(" add Add values to config settings which support multiple arguments"); + LOG_INFO(" remove Remove values to config settings which support multiple"); + LOG_INFO(" arguments"); + LOG_INFO(" set Set value to config settings which support only one argument"); + LOG_INFO(""); + + LOG_INFO("Querying config settings"); + LOG_INFO(" get Get value of the config setting"); +} + +void ConfigCLI::DisplayGenHelp() +{ + LOG_INFO("Generate a config file from prompts"); + LOG_INFO(""); + LOG_INFO("Usage: makegen conf gen