[hackers] [scc] [libc] Do it like gcc. Fix -M output. || Quentin Rameau
commit c9f6169eaf6b7dfaf8f4186602268d1026a90e4c
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Wed Feb 15 18:35:23 2017 +0100
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Fri Feb 17 10:51:26 2017 +0100
[libc] Do it like gcc. Fix -M output.
Change the format from:
filename.ext: dependencies
to:
filename.o: filename.ext dependencies
diff --git a/cc1/lex.c b/cc1/lex.c
index 7e9e459..a582fcb 100644
--- a/cc1/lex.c
+++ b/cc1/lex.c
_AT_@ -90,7 +90,9 @@ int
addinput(char *fname, Symbol *hide, char *buffer)
{
FILE *fp;
+ char *extp;
unsigned flags;
+ size_t infileln;
Input *newip, *curip = input;
if (hide) {
_AT_@ -105,8 +107,13 @@ addinput(char *fname, Symbol *hide, char *buffer)
if ((fp = fopen(fname, "r")) == NULL)
return 0;
flags = IFILE;
- if (curip && onlyheader)
- printf("%s: %s\n", infile, fname);
+ if (curip && onlyheader) {
+ infileln = strlen(infile);
+ if (extp = strrchr(infile, '.'))
+ infileln -= strlen(extp);
+ printf("%.*s.o: %s %s\n",
+ infileln, infile, infile, fname);
+ }
} else {
/* reading from stdin */
fp = stdin;
Received on Fri Feb 17 2017 - 10:52:56 CET
This archive was generated by hypermail 2.3.0
: Fri Feb 17 2017 - 11:00:26 CET