diff options
| author | Kirill Smelkov <kirr@mns.spb.ru> | 2010-06-20 20:42:16 +0400 |
|---|---|---|
| committer | Kirill Smelkov <kirr@mns.spb.ru> | 2010-06-21 20:49:46 +0400 |
| commit | 120334830231763bd3cb84fe6fb671142161f6de (patch) | |
| tree | cb14706e29fe5b5cac6a6b92eb2ef0f770c64734 /libtcc.c | |
| parent | 0c928da96d5fb8fe8f929db40b2d807053113f35 (diff) | |
| download | tinycc-120334830231763bd3cb84fe6fb671142161f6de.tar.gz tinycc-120334830231763bd3cb84fe6fb671142161f6de.tar.bz2 | |
tcc -E: Let output_default be <file>.o instead of a.out
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
Diffstat (limited to 'libtcc.c')
| -rw-r--r-- | libtcc.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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"); |
