Add arguments and prearguments to executable file
This commit is contained in:
+1
-1
@@ -8,9 +8,9 @@
|
|||||||
<srcdir>src/</srcdir>
|
<srcdir>src/</srcdir>
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration name="Debug">
|
<configuration name="Debug">
|
||||||
<define>_DEBUG</define>
|
|
||||||
<cflag>-g3</cflag>
|
<cflag>-g3</cflag>
|
||||||
<cflag>-w</cflag>
|
<cflag>-w</cflag>
|
||||||
|
<define>_DEBUG</define>
|
||||||
<generatehfile>false</generatehfile>
|
<generatehfile>false</generatehfile>
|
||||||
<outputdir>bin/</outputdir>
|
<outputdir>bin/</outputdir>
|
||||||
<outputname>makegen</outputname>
|
<outputname>makegen</outputname>
|
||||||
|
|||||||
+10
-2
@@ -55,7 +55,9 @@ Valid settings are:
|
|||||||
lflag g++ linking flag
|
lflag g++ linking flag
|
||||||
dependency Project which current project depends on
|
dependency Project which current project depends on
|
||||||
excludesource Exclude source file from compiling
|
excludesource Exclude source file from compiling
|
||||||
excludeheader Exclude header file from project h-file)");
|
excludeheader Exclude header file from project h-file
|
||||||
|
argument Command line argument for the executable
|
||||||
|
preargument Command line argument before the executabe, e.g. gdb)");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigCLI::DisplayRemoveHelp()
|
void ConfigCLI::DisplayRemoveHelp()
|
||||||
@@ -74,7 +76,9 @@ Valid settings are
|
|||||||
lflag g++ linking flag
|
lflag g++ linking flag
|
||||||
dependency Project which current project depends on
|
dependency Project which current project depends on
|
||||||
excludesource Exclude source file from compiling
|
excludesource Exclude source file from compiling
|
||||||
excludeheader Exclude header file from project h-file)");
|
excludeheader Exclude header file from project h-file
|
||||||
|
argument Command line argument for the executable
|
||||||
|
preargument Command line argument before the executabe, e.g. gdb)");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigCLI::DisplaySetHelp()
|
void ConfigCLI::DisplaySetHelp()
|
||||||
@@ -115,6 +119,8 @@ Valid settings are:
|
|||||||
dependency Project which current project depends on
|
dependency Project which current project depends on
|
||||||
excludesource Exclude source file from compiling
|
excludesource Exclude source file from compiling
|
||||||
excludeheader Exclude header file from project h-file
|
excludeheader Exclude header file from project h-file
|
||||||
|
argument Command line argument for the executable
|
||||||
|
preargument Command line argument before the executabe, e.g. gdb
|
||||||
outputdir Directory of the compiled output
|
outputdir Directory of the compiled output
|
||||||
outputname Name of the output executable/library
|
outputname Name of the output executable/library
|
||||||
outputtype Type of the output, valid values are executable, sharedlibrary
|
outputtype Type of the output, valid values are executable, sharedlibrary
|
||||||
@@ -142,6 +148,8 @@ ConfigSetting ConfigCLI::CLIStringToSetting(const std::string& s)
|
|||||||
{"lflag", ConfigSetting::LFlag},
|
{"lflag", ConfigSetting::LFlag},
|
||||||
{"excludesource", ConfigSetting::ExcludeSource},
|
{"excludesource", ConfigSetting::ExcludeSource},
|
||||||
{"excludeheader", ConfigSetting::ExcludeHeader},
|
{"excludeheader", ConfigSetting::ExcludeHeader},
|
||||||
|
{"preargument", ConfigSetting::ExecPreArgument},
|
||||||
|
{"argument", ConfigSetting::ExecArgument},
|
||||||
{"dependency", ConfigSetting::Dependency},
|
{"dependency", ConfigSetting::Dependency},
|
||||||
{"genhfile", ConfigSetting::GenerateHFile},
|
{"genhfile", ConfigSetting::GenerateHFile},
|
||||||
};
|
};
|
||||||
|
|||||||
+16
-4
@@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "FileUtils.h"
|
#include "FileUtils.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
@@ -18,13 +18,13 @@ struct ConfigCache
|
|||||||
enum class ConfigSetting
|
enum class ConfigSetting
|
||||||
{
|
{
|
||||||
// vectors
|
// vectors
|
||||||
Library = 0, LibraryDir = 1, IncludeDir = 2, Define = 3, Dependency = 4, CFlag = 5, LFlag = 6, ExcludeSource = 7, ExcludeHeader = 8,
|
Library = 0, LibraryDir = 1, IncludeDir = 2, Define = 3, Dependency = 4, CFlag = 5, LFlag = 6, ExcludeSource = 7, ExcludeHeader = 8, ExecPreArgument = 9, ExecArgument = 10,
|
||||||
// Strings
|
// Strings
|
||||||
SourceDir = 32, OutputDir = 33, OutputName = 34, OutputType = 35, ProjectName = 36, HFileName = 37,
|
SourceDir = 32, OutputDir = 33, OutputName = 34, OutputType = 35, ProjectName = 36, HFileName = 37,
|
||||||
// Bools
|
// Bools
|
||||||
GenerateHFile = 64,
|
GenerateHFile = 64,
|
||||||
// Other
|
// Other
|
||||||
Invalid = 1024
|
Invalid = 1024
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ConfigUtils
|
struct ConfigUtils
|
||||||
@@ -63,6 +63,10 @@ struct ConfigUtils
|
|||||||
return "excludesource";
|
return "excludesource";
|
||||||
case ConfigSetting::ExcludeHeader:
|
case ConfigSetting::ExcludeHeader:
|
||||||
return "excludeheader";
|
return "excludeheader";
|
||||||
|
case ConfigSetting::ExecPreArgument:
|
||||||
|
return "preargument";
|
||||||
|
case ConfigSetting::ExecArgument:
|
||||||
|
return "argument";
|
||||||
case ConfigSetting::GenerateHFile:
|
case ConfigSetting::GenerateHFile:
|
||||||
return "generatehfile";
|
return "generatehfile";
|
||||||
case ConfigSetting::Invalid:
|
case ConfigSetting::Invalid:
|
||||||
@@ -90,6 +94,8 @@ struct ConfigUtils
|
|||||||
case ConfigSetting::LFlag:
|
case ConfigSetting::LFlag:
|
||||||
case ConfigSetting::ExcludeSource:
|
case ConfigSetting::ExcludeSource:
|
||||||
case ConfigSetting::ExcludeHeader:
|
case ConfigSetting::ExcludeHeader:
|
||||||
|
case ConfigSetting::ExecPreArgument:
|
||||||
|
case ConfigSetting::ExecArgument:
|
||||||
case ConfigSetting::GenerateHFile:
|
case ConfigSetting::GenerateHFile:
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
@@ -118,6 +124,8 @@ struct ConfigUtils
|
|||||||
case ConfigSetting::LFlag:
|
case ConfigSetting::LFlag:
|
||||||
case ConfigSetting::ExcludeHeader:
|
case ConfigSetting::ExcludeHeader:
|
||||||
case ConfigSetting::ExcludeSource:
|
case ConfigSetting::ExcludeSource:
|
||||||
|
case ConfigSetting::ExecPreArgument:
|
||||||
|
case ConfigSetting::ExecArgument:
|
||||||
case ConfigSetting::GenerateHFile:
|
case ConfigSetting::GenerateHFile:
|
||||||
case ConfigSetting::Invalid:
|
case ConfigSetting::Invalid:
|
||||||
return false;
|
return false;
|
||||||
@@ -137,6 +145,8 @@ struct ConfigUtils
|
|||||||
case ConfigSetting::LFlag:
|
case ConfigSetting::LFlag:
|
||||||
case ConfigSetting::ExcludeHeader:
|
case ConfigSetting::ExcludeHeader:
|
||||||
case ConfigSetting::ExcludeSource:
|
case ConfigSetting::ExcludeSource:
|
||||||
|
case ConfigSetting::ExecPreArgument:
|
||||||
|
case ConfigSetting::ExecArgument:
|
||||||
return true;
|
return true;
|
||||||
case ConfigSetting::SourceDir:
|
case ConfigSetting::SourceDir:
|
||||||
case ConfigSetting::OutputDir:
|
case ConfigSetting::OutputDir:
|
||||||
@@ -170,6 +180,8 @@ struct ConfigUtils
|
|||||||
case ConfigSetting::LFlag:
|
case ConfigSetting::LFlag:
|
||||||
case ConfigSetting::ExcludeHeader:
|
case ConfigSetting::ExcludeHeader:
|
||||||
case ConfigSetting::ExcludeSource:
|
case ConfigSetting::ExcludeSource:
|
||||||
|
case ConfigSetting::ExecPreArgument:
|
||||||
|
case ConfigSetting::ExecArgument:
|
||||||
case ConfigSetting::Invalid:
|
case ConfigSetting::Invalid:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-1
@@ -128,7 +128,16 @@ void Makefile::Save(ConfigFile& conf, unsigned int flags)
|
|||||||
outputFile << "run: all" << std::endl;
|
outputFile << "run: all" << std::endl;
|
||||||
if(outputtype == "executable")
|
if(outputtype == "executable")
|
||||||
{
|
{
|
||||||
outputFile << "\t@./$(OUTPUT)" << std::endl;
|
std::vector<std::string>& prearguments = conf.GetSettingVectorString(ConfigSetting::ExecPreArgument);
|
||||||
|
std::vector<std::string>& arguments = conf.GetSettingVectorString(ConfigSetting::ExecArgument);
|
||||||
|
|
||||||
|
outputFile << "\t@";
|
||||||
|
for(auto&& preargument : prearguments)
|
||||||
|
outputFile << preargument << " ";
|
||||||
|
outputFile << "./$(OUTPUT)";
|
||||||
|
for(auto&& argument : arguments)
|
||||||
|
outputFile << " " << argument;
|
||||||
|
outputFile << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rebuild
|
// Rebuild
|
||||||
|
|||||||
+1
-1
@@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
void PrintHelp()
|
void PrintHelp()
|
||||||
{
|
{
|
||||||
|
LOG_INFO("MakeGen ", MAKEGEN_VERSION);
|
||||||
LOG_INFO(1+(char*)R"(
|
LOG_INFO(1+(char*)R"(
|
||||||
MakeGen ", MAKEGEN_VERSIO
|
|
||||||
|
|
||||||
MakeGen is a utility tool to generate and run Makefiles in a simple manner.
|
MakeGen is a utility tool to generate and run Makefiles in a simple manner.
|
||||||
By default it always compiles code with parallell jobs.
|
By default it always compiles code with parallell jobs.
|
||||||
|
|||||||
Reference in New Issue
Block a user