2

I am trying to make a simple makefile (GNU Make 3.81) work under windows, using cygwin installed with the git-for-windows "distro".

Everything seems to work, but the SHELL. It always shows "sh" being used. The manual has some notes about SHELL on windows, but it mentions COMSPEC, which points to the actual windows shell (cmd.exe) which does not play any role here. Also $(COMSPEC) on the Makefile results in a blank string, while $(SHELL) is always the path to sh.exe, which is the one being used that I am trying to replace with bash.exe

This is the minimum Makefile to reproduce:

$ cat Makefile
SHELL="C:/Program Files/Git/usr/bin/bash.exe"

info:
        $(info SHELL is "$(SHELL)")
$ make info
SHELL is "C:/Program Files/Git/usr/bin/sh.exe"
make: `info' is up to date.

Anyone already figured out how to use bash in this setup?

4
  • copy bash.exe sh.exe ?
    – Hannu
    Commented Sep 21, 2020 at 5:33
  • thanks @Hannu That is one workaround. But I am trying to make this just to be more convenient to contributors that happen to use windows. I do not want to ask them to overwrite their files, which might create other problems later (what if something need sh.exe?)
    – gcb
    Commented Sep 21, 2020 at 18:17
  • Did you forgot a colon? SHELL:="C:/Program Files/Git/usr/bin/bash.exe" Commented Jul 13 at 11:28
  • 1
    @goulashsoup thanks for the suggestion, but even the manual use "lazy assign" in the SELL example for MS-Windows gnu.org/software/make/manual/html_node/Choosing-the-Shell.html
    – gcb
    Commented Jul 13 at 19:31

0

You must log in to answer this question.

Browse other questions tagged .