tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Add wine support


From: Michael Matz
Subject: Re: [Tinycc-devel] Add wine support
Date: Fri, 25 Oct 2019 13:21:32 +0000 (UTC)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)

Hi,

On Fri, 25 Oct 2019, Herman ten Brugge via Tinycc-devel wrote:

> Ok. I will remove it. I find it a bit silly because with this Makefile 
> you can now do ALL code development under linux and do not need windows.

But the question is why there should be any extra makefile involved at 
all?  In an ideal world one would simply do:

% ./configure --config-wine32
% make; make test

(Not to mention that the wine makefile is not really a makefile (no deps 
or such) but more like seven glorious shellscripts)

I.e. integrate the functionality that you need into the normal process, 
and probably everybody is fine with that then.

To demonstrate what I mean, take for instance the libs target, and 
specifically the lib/libtcc1-32.a subtarget: why should it even exist?  
lib/Makefile can perfectly well build libtcc1.a itself, and that with 
proper dependencies.  Why not reuse that (possibly with adjustments in 
lib/Makefile), but instead list all commands explicitely?  Or the pre 
target: it copies files around.  Why is that?  The files can just as well 
be found in their original place.  It also generates config.h and 
config.mak by hand, when they should be generated from configure (when 
called with the proper options).


Ciao,
Michael.
> 
> With patch below you can now also run all window tests on linux.
> 
>     Herman
> 
> 
> 
> --- a/Makefile  2019-10-24 22:10:39.126565846 +0200
> +++ b/Makefile  2019-10-25 07:32:36.811116683 +0200
> @@ -41,6 +41,7 @@ pre:
>         @echo TARGETOS=Windows  1>> ../config.mak
>         @echo CONFIG_WIN32=yes 1>> ../config.mak
>         @echo TOPSRC=$$\(TOP\) 1>> ../config.mak
> +       @echo EXESUF=.exe 1>> ../config.mak
>         @echo "#define TCC_VERSION \"$(VERSION)\"" 1>../config.h
>         @echo "#ifdef TCC_TARGET_X86_64" 1>>../config.h
>         @echo "#define TCC_LIBTCC1 \"libtcc1-64.a\"" 1>>../config.h
> @@ -73,7 +74,7 @@ bootstrap:
> 
>  PHONY += bootstrap
> 
> -TCC = wine ./tcc.exe
> +TCC = WINEDEBUG=fixme-all wine ./tcc.exe
> 
>  lib/libtcc1-32.a:
>         @echo Building $*.a with tcc -m32
> @@ -111,7 +112,7 @@ PHONY += libs
> 
>  rebuild:
>         @echo Rebuild using tcc itself - default $(TARGET)bits
> -       @wine ./$(TARCH)-win32-tcc.exe -O2 -B. $(TFLAGS) -DTCC_TARGET_PE -o
> tcc.exe ../tcc.c
> +       @WINEDEBUG=fixme-all wine ./$(TARCH)-win32-tcc.exe -O2 -B. $(TFLAGS)
> -DTCC_TARGET_PE -o tcc.exe ../tcc.c
>         @$(TCC) -O2 -B. $(TFLAGS) -DTCC_TARGET_PE -DLIBTCC_AS_DLL -o
> libtcc.dll -shared ../libtcc.c
>         @$(TCC) -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -o tmp-tcc.exe
> ../tcc.c && mv tmp-tcc.exe i386-win32-tcc.exe
>         @$(TCC) -O2 -B. -m$(TARGET) -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -o
> tmp-tcc.exe ../tcc.c && mv tmp-tcc.exe x86_64-win32-tcc.exe
> @@ -119,11 +120,11 @@ rebuild:
>  PHONY += rebuild
> 
>  test:
> -       @(cd ../tests; $(MAKE) -k TCC=$(PWD)/tcc hello-exe hello-run)
> -       @(cd ../tests; $(MAKE) -k TCC=$(PWD)/tcc vla_test-run tests2-dir
> pp-dir)
> +       @(cd ../tests; WINEDEBUG=fixme-all $(MAKE) -k TCC="wine
> $(PWD)/tcc.exe" hello-run)
> +       @(cd ../tests; WINEDEBUG=fixme-all $(MAKE) -k TCC="wine
> $(PWD)/tcc.exe" vla_test-run tests2-dir pp-dir)
>  ifeq ($(CPU), 64)
> -       @(cd ../tests; $(MAKE) -k TCC=$(PWD)/i386-win32-tcc hello-exe
> hello-run)
> -       @(cd ../tests; $(MAKE) -k TCC=$(PWD)/i386-win32-tcc vla_test-run
> tests2-dir pp-dir)
> +       @(cd ../tests; WINEDEBUG=fixme-all $(MAKE) -k TCC="wine
> $(PWD)/i386-win32-tcc.exe" hello-run)
> +       @(cd ../tests; WINEDEBUG=fixme-all $(MAKE) -k TCC="wine
> $(PWD)/i386-win32-tcc.exe" vla_test-run tests2-dir pp-dir)
>  endif
> 
>  PHONY += test
> 
> 
> On 2019-10-25 07:27, Christian Jullien wrote:
> > Hello Herman,
> >
> > Before I made wintcc project, I dropped my Makefile in tinycc official win32
> > project as I think it is useful.
> > For yet an unclear reason, Grischka asked me to remove it as there is
> > others, yet much more complex, ways to build native tcc. (see
> > https://lists.nongnu.org/archive/html/tinycc-devel/2017-07/msg00053.html)
> >
> > I copied your Makefile in https://sourceforge.net/projects/wintcc/ to share
> > your contribution. Unless Grischka changes its mind about Windows support,
> > can you please remove wine from tinycc.
> >
> > On my side, I'll try to see if I can have a single Makefile for Cygwin and
> > wine. Currently, it resides in wine/Makefile
> >
> > Christian.
> >
> > P.S. I share your frustration
> >
> > -----Original Message-----
> > From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=address@hidden]
> > On Behalf Of Herman ten Brugge via Tinycc-devel
> > Sent: Thursday, October 24, 2019 22:14
> > To: Herman ten Brugge via Tinycc-devel
> > Cc: Herman ten Brugge
> > Subject: [Tinycc-devel] Add wine support
> >
> > I wanted to test how windows generated some code. I never use windows so
> > I wanted to use wine.
> >
> > I copied the Makefile from 'https://sourceforge.net/projects/wintcc/'
> > and adjusted it a little bit.
> >
> > Now I can use the windows version on linux with wine.
> >
> >
> >
> > _______________________________________________
> > Tinycc-devel mailing list
> > address@hidden
> > https://lists.nongnu.org/mailman/listinfo/tinycc-devel
> >
> 
> 
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
> 

reply via email to

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