I want to port make on Windows using tcc compiler

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

I want to port make on Windows using tcc compiler

Christian Jullien-3

Hi make maintainers,

 

First, many thanks for your time maintaining and polishing this tool.

 

On my side, I modestly contribute to tcc (TinyC) compiler which is an ultra-fast C compiler (see https://repo.or.cz/w/tinycc.git).

Among others, I ensure that it allows to build a standalone native compiler version on Windows both 32/64.

To provide a complete working C toolchain, it lacks a ‘make’ utility as with other unix like systems.

I can of course compile make on Windows with cl or MingW but it is intellectually more interesting to build make with tcc.

For that I just added tcc support in build_w32.bat and also added src/config.h.TCC which can probably be merged in config.h.W32

 

It then make works ROOTB from make 4.3 (no changes in source code) using:

 

build_w32.bat tcc

 

I hope it interests you and you’ll add this support in official repository. I’m of course candidate to maintain this part.

 

Tia

 

C. Jullien


_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

tcc-patch-for-4.3.tar.gz (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: *** SPAM *** I want to port make on Windows using tcc compiler

Christian Jullien-3

The latest files are there: https://sourceforge.net/p/wintcc/svn/HEAD/tree/

Now, only the modified build_w32.bat and src/config.h.W32 are needed.

The both should still work with cl and gcc.

 

C.

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=[hidden email]] On Behalf Of Christian Jullien
Sent: Wednesday, January 22, 2020 14:38
To: [hidden email]
Cc: [hidden email]
Subject: *** SPAM *** [Tinycc-devel] I want to port make on Windows using tcc compiler

 

Hi make maintainers,

 

First, many thanks for your time maintaining and polishing this tool.

 

On my side, I modestly contribute to tcc (TinyC) compiler which is an ultra-fast C compiler (see https://repo.or.cz/w/tinycc.git).

Among others, I ensure that it allows to build a standalone native compiler version on Windows both 32/64.

To provide a complete working C toolchain, it lacks a ‘make’ utility as with other unix like systems.

I can of course compile make on Windows with cl or MingW but it is intellectually more interesting to build make with tcc.

For that I just added tcc support in build_w32.bat and also added src/config.h.TCC which can probably be merged in config.h.W32

 

It then make works ROOTB from make 4.3 (no changes in source code) using:

 

build_w32.bat tcc

 

I hope it interests you and you’ll add this support in official repository. I’m of course candidate to maintain this part.

 

Tia

 

C. Jullien


_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Reply | Threaded
Open this post in threaded view
|

Re: *** SPAM *** I want to port make on Windows using tcc compiler

Eli Zaretskii
> From: "Christian Jullien" <[hidden email]>
> Date: Wed, 22 Jan 2020 17:08:32 +0100
>
> The latest files are there:
> <https://sourceforge.net/p/wintcc/svn/HEAD/tree/>
> https://sourceforge.net/p/wintcc/svn/HEAD/tree/
>
> Now, only the modified build_w32.bat and src/config.h.W32 are needed.

config.h.W32 is a generated file, the original is in
src/config.h.W32.template.  And it's better to send patches instead of
the whole files.

Btw, the right place to discuss this is on [hidden email], not here.

_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Reply | Threaded
Open this post in threaded view
|

Re: I want to port make on Windows using tcc compiler

Christian Jullien-3
In reply to this post by Christian Jullien-3
Thank you Eli, your help is really appreciated.

From the latest https://ftp.gnu.org/gnu/make/make-4.3.tar.gz I don't see the
src/config.h.W32.template you're referring to.

tar tvzf make-4.3.tar.gz | grep -i templ
-rw-r--r--  0 1000   1000     1015 Jan 03 08:11
make-4.3/tests/scripts/test_template  <= not the one I'm looking for

This distrib however contains src/config.h.W32 which is used "as is" by
build_w32.bat which is the only command I can execute with native tcc.exe
and cmd.exe (no autoconf nor automake in this very reduced env.)

Also the README.W32 tells me: 1. Edit config.h.W32 to your liking
(especially the few shell-related ...

Am I missing something?

FYI, until my two patches exist in standard make distrib, I boostrap
gnumake.exe with Cygwin using:

WINTCC  = https://sourceforge.net/p/wintcc/svn/HEAD/tree
MAKEREPO  = https://ftp.gnu.org/gnu/make
MAKEVER = make-4.3

gnumake.exe:
        @echo Building Windows native version of $@ from sources.
        # apply some patches
        @wget --quiet -O $(MAKEVER).tar.gz $(MAKEREPO)/$(MAKEVER).tar.gz
        @tar xzf $(MAKEVER).tar.gz
        @wget --quiet -O $(MAKEVER)/build_w32.bat
$(WINTCC)/make/build_w32.bat?format=raw
        @chmod a+w $(MAKEVER)/src/config.h.W32
        @wget --quiet -O $(MAKEVER)/src/config.h.W32
$(WINTCC)/make/config.h.W32?format=raw
        # Real build starts here with tcc used as C compiler.
        @(cd $(MAKEVER); cmd /C "set PATH=..;%PATH% && build_w32.bat tcc >
:nul")
        @mv $(MAKEVER)/TccRel/$@ .
        @rm -r -f $(MAKEVER).tar.gz $(MAKEVER)
        @chmod a-x $@
        @dir $@

Because gnumake.exe will be part of tcc standard binary distrib, I must be
able to give users a way to rebuild gnumake.exe from (GPL) source code and
"build_w32.bat tcc" would just do.

-----Original Message-----
From: Eli Zaretskii [mailto:[hidden email]]
Sent: Wednesday, January 22, 2020 18:12
To: [hidden email]
Cc: [hidden email]; [hidden email]
Subject: Re: *** SPAM *** [Tinycc-devel] I want to port make on Windows
using tcc compiler

> From: "Christian Jullien" <[hidden email]>
> Date: Wed, 22 Jan 2020 17:08:32 +0100
>
> The latest files are there:
> <https://sourceforge.net/p/wintcc/svn/HEAD/tree/>
> https://sourceforge.net/p/wintcc/svn/HEAD/tree/
>
> Now, only the modified build_w32.bat and src/config.h.W32 are needed.

config.h.W32 is a generated file, the original is in
src/config.h.W32.template.  And it's better to send patches instead of
the whole files.

Btw, the right place to discuss this is on [hidden email], not here.


_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Reply | Threaded
Open this post in threaded view
|

Re: I want to port make on Windows using tcc compiler

Kaz Kylheku (gmake)
In reply to this post by Christian Jullien-3
On 2020-01-22 05:38, Christian Jullien wrote:
> To provide a complete working C toolchain, it lacks a 'make' utility as
> with
> other unix like systems.

Don't forget that make recipes are written in shell (by default; there
is a SHELL variable).

So if you compile make successfully, but haven't provided a shell, you
still can't process the usual shell-based makefiles.

[Not sure it's such a great idea to cross-post between tinycc-devel and
help-make, but I'm preserving the Cc: line.]




_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Reply | Threaded
Open this post in threaded view
|

Re: I want to port make on Windows using tcc compiler

Eli Zaretskii
In reply to this post by Christian Jullien-3
> From: "Christian Jullien" <[hidden email]>
> Date: Wed, 22 Jan 2020 18:44:25 +0100
> Cc: [hidden email]
>
> Thank you Eli, your help is really appreciated.
>
> >From the latest https://ftp.gnu.org/gnu/make/make-4.3.tar.gz I don't see the
> src/config.h.W32.template you're referring to.

The template file is not in the tarball, it is in the GNU Make Git
repository.  See https://savannah.gnu.org/git/?group=make.

_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel