GeneralThis forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The syntax that includes the MAKERULES variable in open and close parentheses is correct syntax. imperialbeachdude said Cygwin: can you confirm which platform you are executing on, Windows or Linux?
The syntax that includes the MAKERULES variable in open and close parentheses is correct syntax. imperialbeachdude said Cygwin: can you confirm which platform you are executing on, Windows or Linux?
Running on Windows - thanks! Perhaps I have a permissions problem?
Hmmmm, one of the first things I would look for is in the original source for the project you are compiling. Does it have any file that defines MAKERULES already? Why would that project require you to have variables like that defined outside of its build environment? I would have expected that variable to be defined by some configuration script (such as one AutoConf would generate).
I agree with what ischiwal stated, but as for the spaces around the "=" character, it depends upon which language (Bourne shell or GNU Make) the variable is being defined in. The spaces would be significant to the Bourne shell syntax, but not to the GNU Make syntax which strips leading and trailing whitespace around both the equal sign and the value.
What is the command you typed to run make? And, into what window did you type it? In a DOS command window or in a Cygwin "terminal" window? This matters on Windows since you are also using Cygwin. On Windows you have a DOS command prompt window which parses command lines differently from the UNIX-like shell running inside the Cygwin terminal window.
As for accessing the /home/foo/bar/rules file, I can guess something about that path by inspection. The "/home" part of that path does not contain a Windows drive component such as "C:/", and so I am guessing that only the Cygwin shells will be able to parse that and know that it gets silently maps to some real Windows path. Therefore, I would expect you to need to use the Cygwin terminal if you are running the command manually. But then again, see above comment about why you would even need to do that.
Also, AFAIK, Cygwin provides (or did at one time provide) a utility command called cygpath. It converts paths from UNIX-like paths such as /home/bla/bla/bla into DOS syntax such as c:\cygwin\home\bla\bla, or a mixed mode (but unexceptable to anything other than Cygwin) syntax with forward slashes such as c:/cygwin/home/bla/bla. That might come in handy to debug how paths get mapped from UNIX-like paths to DOS drive-mounted paths.
Also verify that your HOME environment variable is set to in the Windows Control Panel as you expect it to be (or that Cygwin might expect it to be), and verify that the directory indicated contains files that Cygwin expects, such as .profile or .bashrc. IIRC, when I had upgrade from Cygwin a while back, it had problems with using the pre-existing HOME directory, and I had to use a HOME environment variable in the control panel.
This is a Linux forum, so you might want to track down any Cygwin-related forums on the web too.
There are two small things that I didn't see in your orginal post, but can be implied, so I thought I'd ask anyway.
When you assign a variable, don't have spaces around the "=" character.
MAKERULES=/home/foo/bar/rules
Also, did you export the MAKERULES variable?
export MAKERULES
Also double check that the /home/foo/bar/rules file does exist and that you can access it.
Thanks for the ideas - I don't have spaces around the variable, and I did export it, and the file does exist. I know these are true because I can do "cat $MAKERULES" and I see the contents of the file.
Also - I'm running "make" within the cygwin terminal window, and the error message from make is "/home/foo/bar/rules:file not found", so I know make has correctly expanded the variable. I'm going to try adding the drive letter to see if that helps. That would tell me that "make" is less tolerant of paths than "cat" which works fine.
As for accessing the /home/foo/bar/rules file, I can guess something about that path by inspection. The "/home" part of that path does not contain a Windows drive component such as "C:/", and so I am guessing that only the Cygwin shells will be able to parse that and know that it gets silently maps to some real Windows path. Therefore, I would expect you to need to use the Cygwin terminal if you are running the command manually. But then again, see above comment about why you would even need to do that.
Also, AFAIK, Cygwin provides (or did at one time provide) a utility command called cygpath. It converts paths from UNIX-like paths such as /home/bla/bla/bla into DOS syntax such as c:\cygwin\home\bla\bla, or a mixed mode (but unexceptable to anything other than Cygwin) syntax with forward slashes such as c:/cygwin/home/bla/bla. That might come in handy to debug how paths get mapped from UNIX-like paths to DOS drive-mounted paths.
Also verify that your HOME environment variable is set to in the Windows Control Panel as you expect it to be (or that Cygwin might expect it to be), and verify that the directory indicated contains files that Cygwin expects, such as .profile or .bashrc. IIRC, when I had upgrade from Cygwin a while back, it had problems with using the pre-existing HOME directory, and I had to use a HOME environment variable in the control panel.
This is a Linux forum, so you might want to track down any Cygwin-related forums on the web too.
bgoodr
Thanks for the info - it does look like the drive letter in cygwin is the problem. When I add the drive letter, I get further along in the make. I will look into the "home" path, and the cygpath, I think that's the right direction.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.