Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-ID: <01BEC828.36E9EDA0.rmode@rmode.com> From: "Lan or Richard L. King" Reply-To: "rmode AT rmode DOT com" To: "'cygwin AT sourceware DOT cygnus DOT com'" Subject: B20.1/NT: Make 3.75 -- trailing spaces in makefile macros cause weird problems Date: Wed, 7 Jul 1999 03:24:17 -0700 Organization: R-Mode Corp. X-Mailer: Microsoft Internet E-mail/MAPI - 8.0.0.4211 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, A variety of problems including endless looping on recursive makes and a message saying "HOME not defined" (or similar) is caused by having trailing spaces in makefiles on macro definition lines like: MY_MACRO = this that theother (If you want more detail see below.) I have discovered a workaround to this, but felt that it should be recorded, and this appears to be the "journal of record". I believe it should be fixed because the time spent figuring out the seemingly unrelated problem and contorting the configuration places others at risk. (I almost gave up on make entirely after downloading the source and realizing I can't quickly decipher the structure of the source.) The workaround is simply to remove trailing spaces from at least macro definition lines. I wrote a shell/sed combo to remove them from every line in every makefile (of which I have many). If anyone needs further details, please don't hesitate to email me. Thank you for your consideration, Richard rking AT rmode DOT com ------------ DETAIL ------------- Having just downloaded the most recent "full.exe" a few days ago, I set about to convert, if necessary, my makefiles that worked with Sun Solaris onto my NT machine until I could get my Linux server installed. I chose cygwin over DJGPP (which I also tried) because it appears that cygwin does a more complete job making paths and filenames transparent (i.e. slashes, drives, and length). This is what I needed. I ran into a variety of problems seemingly related to my development environment complexity. Essentially, I have multiple languages and intermediate tools (e.g. parser generators, schema generators and the like) in a moderately deep (2 to 5 levels) directory hierarchy, where every directory has a make file that includes the somewhat complex shared ruleset I use to produce a finished product set consisting of libraries, applications, 3rd party tool inputs, help files, DB configurations and so forth. (This is why I don't use tools like, say, Java Workshop that are too structure for what I need). Make is invoked recursively on each directory. The first thing I noticed is that for a given directory, the makefile would run through all the sub-directories, and then it would try running a make on a blank directory (i.e. it said it was building sub-library ""). This was accompanied by an error message saying "HOME" wasn't defined. I never recalled make needing a home directory, but to oblige it I set HOME to the top-level project directory and retried. This time at the bottom level of the first leg it did the same thing but also looped forever starting at the top directory and going down the same path it had been before. Then I created a test case in a separate directory tree and retried. It went down the first leg as above and after the blank directory, it started making the original project! There was no reference in the test makefiles to that project at all. This led to the conclusion that (1) the trailing spaces create an additional blank "word" if the macro is used as a wordlist (say, a list of libraries to make); and (2) that invoking make on the blank library caused a "cd" with no arguments, thus ending up in the HOME directory. -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com