Subject: Re: [RFC] Enable compilation by Makefile for the MSVC toolchain

From: Marius Storm-Olsen <[email-masked]>
Date: Tue, 18 Aug 2009 19:36:44 +0200

Junio C Hamano said the following on 18.08.2009 18:51:
> Marius Storm-Olsen <[email-masked]> writes:
> 
> Marius Storm-Olsen <[email-masked]> writes:
> 
>> +ARFLAGS = rcs\ # whitespace intentional
>> +COMPFLAG = -c
>> +COBJFLAG = -o\ # whitespace intended
>> +LOBJFLAG = -o\ # whitespace intended
>> ...
>> +ifneq (,$(findstring Microsoft Visual Studio, $(INCLUDE)))
>> +	CC = cl 
>> +	COBJFLAG = -Fo
>> +	LOBJFLAG = -OUT:
>> +	CFLAGS =
>>  git.o: git.c common-cmds.h GIT-CFLAGS
>> ...
>> -		$(ALL_CFLAGS) -c $(filter %.c,$^)
>> +		$(ALL_CFLAGS) $(COMPFLAG) $(COBJFLAG)git.o $(filter %.c,$^)
> 
> Since use of make implies use of shell, this makes me wonder if it would
> make sense to go one step further by giving msvc users a thin shell
> wrapper mcvc-cc that turns bog-standard cc command line into whatever cl
> uses.

That, of course, is also a feasible option :)
However, there are still things you wouldn't want to pass on to this 
script, for example, we don't pass on all the CFLAGS to the linker on 
Windows.

The "whitespace intended" in the patch are quite nasty though..

--
.marius