Allowing additional LDFLAGS at linking time per target for type binary
This commit is contained in:
parent
6b6b6f7bfc
commit
7510cea6b3
@ -303,6 +303,7 @@ static void _obj_print(FILE * fp, char * obj)
|
|||||||
static void _target_link(FILE * fp, Config * config, char * target)
|
static void _target_link(FILE * fp, Config * config, char * target)
|
||||||
{
|
{
|
||||||
char * type;
|
char * type;
|
||||||
|
char * p;
|
||||||
|
|
||||||
if((type = config_get(config, target, "type")) == NULL)
|
if((type = config_get(config, target, "type")) == NULL)
|
||||||
{
|
{
|
||||||
@ -311,9 +312,14 @@ static void _target_link(FILE * fp, Config * config, char * target)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(strcmp("binary", type) == 0)
|
if(strcmp("binary", type) == 0)
|
||||||
fprintf(fp, "%s%s%s%s%s%s%s%s%s%s", target, ": $(", target,
|
{
|
||||||
"_OBJS)\n", "\t$(CC) $(LDFLAGSF) $(LDFLAGS) ",
|
fprintf(fp, "%s%s%s%s%s", target, ": $(", target,
|
||||||
"-o ", target, " $(", target, "_OBJS)\n\n");
|
"_OBJS)\n", "\t$(CC) $(LDFLAGSF) $(LDFLAGS) ");
|
||||||
|
if((p = config_get(config, target, "ldflags")) != NULL)
|
||||||
|
fprintf(fp, "%s%s", p, " ");
|
||||||
|
fprintf(fp, "%s%s%s%s%s", "-o ", target,
|
||||||
|
" $(", target, "_OBJS)\n\n");
|
||||||
|
}
|
||||||
else if(strcmp("library", type) == 0)
|
else if(strcmp("library", type) == 0)
|
||||||
fprintf(fp, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
|
fprintf(fp, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
|
||||||
target, ": ", target, ".a ", target, ".so\n",
|
target, ": ", target, ".a ", target, ".so\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user