Did you consider pushing the feature(s) on the tinycc mob branch?
Some suggestions:
+/* compute default outfile name */
+{
+char *ext;
+
Put that into a function.
+/* dump collected dependencies */
+if (gen_deps) {
+ ...
Put that into a function.
+ext = strrchr(buf, '.');
+ext = ext ? ext : strchr(buf, 0);
Use tcc_fileextension().
--- grischka
Kirill Smelkov wrote:
This affectes where `tcc -E -MD file.c` will place generated dependency
information -- previously, for `tcc -E` output_default was a.out, and so
deps were put into a.d .
Avoid this behaviour, by treating `tcc -E` as `tcc -c` with respect to
output_default computation.
This will not hurt anything else (preprocessor outputs to either stdout,
or to explicitely given (-o file) destination, so no default filename
is used here), and on the other hand `tcc -E -MD file.c` now puts
dependencies into file.d (the same behaviour as for gcc -E).
---
tcc.c |4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/tcc.c b/tcc.c
index a4b610d..2526d9d 100644
--- a/tcc.c
+++ b/tcc.c
@@ -467,7 +467,9 @@ int main(int argc, char **argv)
strcpy(ext, .exe);
else
#endif
-if (output_type == TCC_OUTPUT_OBJ !reloc_output *ext)
+if ((output_type == TCC_OUTPUT_OBJ ||
+ output_type == TCC_OUTPUT_PREPROCESS)
+ !reloc_output *ext)
strcpy(ext, .o);
else
pstrcpy(outfile_default, sizeof(outfile_default), a.out);
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/tinycc-devel