tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re[2]: [Tinycc-devel] conditional compilation?gcc or tcc compile wit


From: bj
Subject: Re: Re[2]: [Tinycc-devel] conditional compilation?gcc or tcc compile without change in source code
Date: Tue, 03 Oct 2006 19:15:07 +0800
User-agent: Opera Mail/9.01 (Win32)

absolutely!!;-)
it works, thanks Filip Navara. anyway Ivo i'll still make good use of yor code someday.

On Tue, 03 Oct 2006 18:46:05 +0800, Filip Navara <address@hidden> wrote:

I guess using "#ifdef __TINYC__" in the sources is a tad bit easier
;-)

Filip

On Tuesday 03 October 2006 12:21, bj wrote:
hey does anyone know how to make a c source code conditionally compile in
MinGW or tcc?
that is.
if i compile the C source code with tcc, it will declare some variables.
and if i compile the C source code with MinGW, it won't declare those
variables.
thanks in advance

You can probably do something like this in a Makefile:

.c.o:
        if test -z "`sed -e '/COMPILE_ME_WITH_GCC/!d' $<`" ; then \
                gcc -c -o $@ $< ; \
        else \
                tcc -c -o $@ $< ; \
        fi

And then put /* COMPILE_ME_WITH_GCC */ in those files you want to compile
with gcc. The others will be compiled with tcc This is untested, I might
have missed a ; somewhere, but this is the general idea.

--Ivo




_______________________________________________
Tinycc-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/tinycc-devel



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]