Add support of splitting parameter classes to ARCH, DEFS, LIB

in ARCH, there are all -m flags (will be expanded into ARCH_FLAGS in Makefile)
in DEFS, there are all -D flags (will be expanded into DEFS in Makefile)
in LIB, there are all -l flags (will be expanded into LIBNAME in Makefile)

If no MODE option specified, the generator behaves as in previous version.
This commit is contained in:
Frantisek Burian
2014-01-12 00:19:23 +01:00
parent a909b5ca9e
commit b7785100c8
2 changed files with 24 additions and 10 deletions

View File

@@ -23,6 +23,8 @@
BEGIN {
PAT = tolower(PAT);
if (length(MODE) == 0)
MODE = ".*";
}
!/^#/{
#remove cr on windows
@@ -39,10 +41,22 @@ BEGIN {
PAT=$2;
for (i = 3; i <= NF; i = i + 1) {
if ($i ~ /^-/)
printf "%s ",$i;
else
printf "-D_%s ",$i;
if ($i ~ /^-l/) {
if ("LIB" ~ MODE)
printf "%s ",$i;
}
else if ($i ~ /^-m/) {
if ("ARCH" ~ MODE)
printf "%s ",$i;
}
else if ($i ~ /^-D/) {
if ("DEFS" ~ MODE)
printf "%s ",$i;
}
else {
if ("DEFS" ~ MODE)
printf "-D_%s ",$i;
}
}
if (PAT=="END")