aboutsummaryrefslogtreecommitdiff
path: root/libtcc.h
Commit message (Collapse)AuthorAgeFilesLines
* tcc: Draft suppoprt for -MD/-MF optionsKirill Smelkov2010-06-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In build systems, this is used to automatically collect target dependencies, e.g. ---- 8< (hello.c) ---- #include "hello.h" #include <stdio.h> int main() { printf("Hello World!\n"); return 0; } $ tcc -MD -c hello.c # -> hello.o, hello.d $ cat hello.d hello.o : \ hello.c \ hello.h \ /usr/include/stdio.h \ /usr/include/features.h \ /usr/include/bits/predefs.h \ /usr/include/sys/cdefs.h \ /usr/include/bits/wordsize.h \ /usr/include/gnu/stubs.h \ /usr/include/bits/wordsize.h \ /usr/include/gnu/stubs-32.h \ /home/kirr/local/tcc/lib/tcc/include/stddef.h \ /usr/include/bits/types.h \ /usr/include/bits/wordsize.h \ /usr/include/bits/typesizes.h \ /usr/include/libio.h \ /usr/include/_G_config.h \ /usr/include/wchar.h \ /home/kirr/local/tcc/lib/tcc/include/stdarg.h \ /usr/include/bits/stdio_lim.h \ /usr/include/bits/sys_errlist.h \ NOTE: gcc supports -MD only for .c -> .o, but in tcc, we generate dependencies for whatever action is being taken. E.g. for .c -> exe, the result will be: $ tcc -MD -o hello hello.c # -> hello, hello.d hello: \ /usr/lib/crt1.o \ /usr/lib/crti.o \ hello.c \ hello.h \ /usr/include/stdio.h \ /usr/include/features.h \ /usr/include/bits/predefs.h \ /usr/include/sys/cdefs.h \ /usr/include/bits/wordsize.h \ /usr/include/gnu/stubs.h \ /usr/include/bits/wordsize.h \ /usr/include/gnu/stubs-32.h \ /home/kirr/local/tcc/lib/tcc/include/stddef.h \ /usr/include/bits/types.h \ /usr/include/bits/wordsize.h \ /usr/include/bits/typesizes.h \ /usr/include/libio.h \ /usr/include/_G_config.h \ /usr/include/wchar.h \ /home/kirr/local/tcc/lib/tcc/include/stdarg.h \ /usr/include/bits/stdio_lim.h \ /usr/include/bits/sys_errlist.h \ /usr/lib/libc.so \ /lib/libc.so.6 \ /usr/lib/ld-linux.so.2 \ /lib/ld-linux.so.2 \ /usr/lib/libc_nonshared.a \ /lib/libc.so.6 \ /usr/lib/libc_nonshared.a \ /home/kirr/local/tcc/lib/tcc/libtcc1.a \ /usr/lib/crtn.o \ So tcc dependency generator is a bit more clever than one used in gcc :) Also, I've updated TODO and Changelog (in not-yet-released section). v2: (Taking inputs from grischka and me myself) - put code to generate deps file into a function. - used tcc_fileextension() instead of open-coding - generate deps only when compilation/preprocessing was successful v3: - use pstrcpy instead of snprintf(buf, sizeof(buf), "%s", ...)
* Add input files/libs and reloc_output switch to TCCStateKirill Smelkov2010-06-201-0/+7
| | | | | | | | | | | | | | | | | files[0], and reloc_outpu will be needed for (upcoming in the next patch) "compute default outfile name" refactored into libtcc function. Also, since for symmetry and from libification point of view, it makes some sense to also put all information about what was given as input to compilation into TCCState, let's not only put files[0], but all files and all libraries given explicitely by user. One point: I've used bitfield for reloc_output & trimmed down output_type to 8 bits so that TCCState stays the same in size, and also access to output_type is (hopefully) is not slower. By the way -- as of today, sizeof(TCCState) on i686-pc-linux-gnu is 2884 bytes...
* libtcc: Detect (but ignore) -init and -fini for -WlDetlef Riekenberg2010-04-051-1/+1
| | | | | -- By by ... Detlef
* libtcc: Allow multiple options for -Wl separated with ','Detlef Riekenberg2010-04-051-0/+3
| | | | | | | I moved the code to libtcc to prepare for a later tiny_ld -- By by ... Detlef
* x86-64: use uplong for symbol valuesgrischka2010-01-141-1/+1
|
* tcc_relocate: revert to 0.9.24 behaviorgrischka2009-12-191-4/+3
|
* libtcc: add support to be build as DLLgrischka2009-04-181-20/+26
|
* libtcc: new api tcc_set_lib_pathgrischka2009-04-181-0/+3
|
* change tcc_add/get_symbol to use void*grischka2009-04-181-3/+3
|
* alternative int tcc_relocate(TCCState *s1, void *ptr);grischka2009-04-181-3/+4
|
* initial implementation of -E optionbellard2006-10-161-0/+1
|
* output format supportbellard2004-10-231-0/+4
|
* changed tcc_get_symbol() prototypebellard2003-07-201-2/+2
|
* added tcc_set_warning() - c++ include supportbellard2003-04-261-0/+11
|
* added better error supportbellard2002-11-021-9/+13
|
* added tcc_relocate() and tcc_get_symbol()bellard2002-09-081-1/+7
|
* added tcc_add_sysinclude_path()bellard2002-08-181-1/+4
|
* api changebellard2002-07-241-11/+20
|
* added libtccbellard2002-05-131-0/+60