[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] [PATCH 08/11] tcc -E: Let output_default be <file>.o inst
From: |
Kirill Smelkov |
Subject: |
[Tinycc-devel] [PATCH 08/11] tcc -E: Let output_default be <file>.o instead of a.out |
Date: |
Mon, 21 Jun 2010 18:31:27 +0400 |
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).
v2:
- restructured condition a bit to make it more clear
---
libtcc.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/libtcc.c b/libtcc.c
index 1df16a3..d3200ef 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -1583,7 +1583,9 @@ LIBTCCAPI const char *tcc_default_target(TCCState *s)
strcpy(ext, ".exe");
else
#endif
- if (s->output_type == TCC_OUTPUT_OBJ && !s->reloc_output && *ext)
+ if (( (s->output_type == TCC_OUTPUT_OBJ && !s->reloc_output) ||
+ (s->output_type == TCC_OUTPUT_PREPROCESS) )
+ && *ext)
strcpy(ext, ".o");
else
pstrcpy(outfile_default, sizeof(outfile_default), "a.out");
--
1.7.1.427.g9562c
- [Tinycc-devel] [PATCH 00/11] Teach tcc -MD/-MF (take 2), Kirill Smelkov, 2010/06/21
- [Tinycc-devel] [PATCH 02/11] .gitignore += *.o *.a, Kirill Smelkov, 2010/06/21
- [Tinycc-devel] [PATCH 01/11] .cvsignore -> .gitignore, Kirill Smelkov, 2010/06/21
- [Tinycc-devel] [PATCH 04/11] tcc: Fix typo in error (it's '%s', not '%s), Kirill Smelkov, 2010/06/21
- [Tinycc-devel] [PATCH 05/11] Add input files/libs and reloc_output switch to TCCState, Kirill Smelkov, 2010/06/21
- [Tinycc-devel] [PATCH 06/11] tcc: Refactor "compute default outfile name" into libtcc function, Kirill Smelkov, 2010/06/21
- [Tinycc-devel] [PATCH 08/11] tcc -E: Let output_default be <file>.o instead of a.out,
Kirill Smelkov <=
- [Tinycc-devel] [PATCH 10/11] tcc: Explicitly require -l<lib> for libraries, Kirill Smelkov, 2010/06/21
- [Tinycc-devel] [PATCH 11/11] .gitignore += tags, Kirill Smelkov, 2010/06/21
- [Tinycc-devel] [PATCH 09/11] Document what tcc_fileextension does, Kirill Smelkov, 2010/06/21
- [Tinycc-devel] [PATCH 03/11] chmod a-x i386-gen.c, Kirill Smelkov, 2010/06/21
- [Tinycc-devel] [PATCH 07/11] tcc: Draft suppoprt for -MD/-MF options, Kirill Smelkov, 2010/06/21