Add patch #1956607 -MT support for changing the makefile target name
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10413 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
df6e396df4
commit
90179b787f
2 changed files with 29 additions and 1 deletions
|
|
@ -1,6 +1,17 @@
|
||||||
Version 1.3.36 (in progress)
|
Version 1.3.36 (in progress)
|
||||||
=============================
|
=============================
|
||||||
|
|
||||||
|
05/03/2008: wsfulton
|
||||||
|
Commit patch #1956607 to add -MT support from Richard Boulton.
|
||||||
|
This patch mirrors the gcc -MT option which allows one to change the default
|
||||||
|
Makefile target being generated when generating makefiles with the -M family
|
||||||
|
of options. For example:
|
||||||
|
|
||||||
|
$ swig -java -MM -MT overiddenname -c++ example.i
|
||||||
|
overiddenname: \
|
||||||
|
example.i \
|
||||||
|
example.h
|
||||||
|
|
||||||
04/30/2008: mgossage
|
04/30/2008: mgossage
|
||||||
[Lua] Removed generation of _wrap_delete_XXXXX (wrappered destructor)
|
[Lua] Removed generation of _wrap_delete_XXXXX (wrappered destructor)
|
||||||
which was unused and causing warning with g++ -Wall.
|
which was unused and causing warning with g++ -Wall.
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,7 @@ static const char *usage2 = (const char *) "\
|
||||||
-MM - List dependencies, but omit files in SWIG library\n\
|
-MM - List dependencies, but omit files in SWIG library\n\
|
||||||
-MMD - Like `-MD', but omit files in SWIG library\n\
|
-MMD - Like `-MD', but omit files in SWIG library\n\
|
||||||
-module <name> - Set module name to <name>\n\
|
-module <name> - Set module name to <name>\n\
|
||||||
|
-MT <target> - Set the target of the rule emitted by dependency generation\n\
|
||||||
-nocontract - Turn off contract checking\n\
|
-nocontract - Turn off contract checking\n\
|
||||||
-nocpperraswarn - Do not treat the preprocessor #error statement as #warning\n\
|
-nocpperraswarn - Do not treat the preprocessor #error statement as #warning\n\
|
||||||
-nodefault - Do not generate default constructors nor default destructors\n\
|
-nodefault - Do not generate default constructors nor default destructors\n\
|
||||||
|
|
@ -175,6 +176,7 @@ static DOH *libfiles = 0;
|
||||||
static DOH *cpps = 0;
|
static DOH *cpps = 0;
|
||||||
static String *dependencies_file = 0;
|
static String *dependencies_file = 0;
|
||||||
static File *f_dependencies_file = 0;
|
static File *f_dependencies_file = 0;
|
||||||
|
static String *dependencies_target = 0;
|
||||||
static int external_runtime = 0;
|
static int external_runtime = 0;
|
||||||
static String *external_runtime_name = 0;
|
static String *external_runtime_name = 0;
|
||||||
enum { STAGE1=1, STAGE2=2, STAGE3=4, STAGE4=8, STAGEOVERFLOW=16 };
|
enum { STAGE1=1, STAGE2=2, STAGE3=4, STAGE4=8, STAGEOVERFLOW=16 };
|
||||||
|
|
@ -667,6 +669,17 @@ void SWIG_getoptions(int argc, char *argv[]) {
|
||||||
} else if (strcmp(argv[i], "-MMD") == 0) {
|
} else if (strcmp(argv[i], "-MMD") == 0) {
|
||||||
depend = 2;
|
depend = 2;
|
||||||
Swig_mark_arg(i);
|
Swig_mark_arg(i);
|
||||||
|
} else if (strcmp(argv[i], "-MT") == 0) {
|
||||||
|
Swig_mark_arg(i);
|
||||||
|
if (argv[i + 1]) {
|
||||||
|
if (!dependencies_target)
|
||||||
|
dependencies_target = NewString(argv[i + 1]);
|
||||||
|
else
|
||||||
|
Printf(dependencies_target, " %s", argv[i + 1]);
|
||||||
|
Swig_mark_arg(i + 1);
|
||||||
|
} else {
|
||||||
|
Swig_arg_error();
|
||||||
|
}
|
||||||
} else if (strcmp(argv[i], "-outdir") == 0) {
|
} else if (strcmp(argv[i], "-outdir") == 0) {
|
||||||
Swig_mark_arg(i);
|
Swig_mark_arg(i);
|
||||||
if (argv[i + 1]) {
|
if (argv[i + 1]) {
|
||||||
|
|
@ -1020,7 +1033,11 @@ int SWIG_main(int argc, char *argv[], Language *l) {
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
f_dependencies_file = stdout;
|
f_dependencies_file = stdout;
|
||||||
Printf(f_dependencies_file, "%s: ", outfile);
|
if (dependencies_target) {
|
||||||
|
Printf(f_dependencies_file, "%s: ", dependencies_target);
|
||||||
|
} else {
|
||||||
|
Printf(f_dependencies_file, "%s: ", outfile);
|
||||||
|
}
|
||||||
List *files = Preprocessor_depend();
|
List *files = Preprocessor_depend();
|
||||||
for (int i = 0; i < Len(files); i++) {
|
for (int i = 0; i < Len(files); i++) {
|
||||||
if ((depend != 2) || ((depend == 2) && (Strncmp(Getitem(files, i), SwigLib, Len(SwigLib)) != 0))) {
|
if ((depend != 2) || ((depend == 2) && (Strncmp(Getitem(files, i), SwigLib, Len(SwigLib)) != 0))) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue