2

In a makefile, I want to use an environment variable ${PROJECT_SOURCE} with value /c/foo.

But when I set my Windows 10 environment variable through control panel to /c/foo, the result is C:\foo when I execute my make command in Mingw32. I need exactly /c/foo. I tried to escape with ^ or % when setting the variable in the control panel, but nothing works : it's stil C:\foo in Mingw32 or windows powershell I'm using a portable version of Make 3.82.90

example of command :

dos2unix:
      find ${PROJECT_SOURCE}/www/project/ -type f -name *.php | xargs dos2unix /

1 Answers1

1

It is not clear the exact problem you have, but I will attempt a solution.

Given that you mean to use make under mingw32, you could start setting up the variable in mingw32 bash, instead of Control Panel. This is what I tried in my msys2

$ export TEST="/c/Datos"
$ echo ${TEST}

So it doesn't get automatically converted to C:\Datos. I am not sure if make will work later on, since there is still missing info. If this works, you can make it persistent by adding to ~/.bashrc

If setting up the variable in Control Panel is absolutely mandatory for you, this can at least help you identifying the problem and how to continue. I cannot test the Control Panel way because of this.

Show:

  1. The makefile which is giving problems. If it is too large, you may do some work to come up with a simpler "distilled case" (a MCVE) that reproduces the problem.

  2. How you created the makefile.

  3. The environment just prior to executing make. In particular, the value of the troublesome variable.