public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* makefile that doesn't work
@ 2001-02-19  4:54 Marco van de Voort
  2001-02-23 13:23 ` Tadeusz Liszka
  0 siblings, 1 reply; 3+ messages in thread
From: Marco van de Voort @ 2001-02-19  4:54 UTC (permalink / raw)
  To: cygwin

I have of set of makefiles that donn't work under win NT and 2000, but
seem to work under '98 ,'95     (and djgpp on those targets), and
FreeBSD, Linux.

- Shell (cmd.exe or bash) doesn't seem to matter.
- I don't have djgpp on the 2000 machine to test.

I isolated the problem part, this makefile snippet prints the current
path, but not under
cygwin on NTish systems.

It seems to be the line with shell in it, but I don't know enough about
makefile semantics to hunt it down or locate the problem spot.

I do monitor the list, but irregularly, so please CC me any replies.

#
# Don't edit, this file is generated by fpcmake v1.99.0 [2001/02/02]
#
default: all
override PATH:=$(subst \,/,$(PATH))
PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(subst ;, ,$(PATH)))))

ifeq ($(PWD),)
PWD:=$(strip $(wildcard $(addsuffix /pwd,$(subst :, ,$(PATH)))))
endif

PWD:=$(firstword $(PWD))
BASEDIR=$(shell $(PWD))

all:
    echo $(BASEDIR)




--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: makefile that doesn't work
  2001-02-19  4:54 makefile that doesn't work Marco van de Voort
@ 2001-02-23 13:23 ` Tadeusz Liszka
  2001-02-23 13:34   ` Marco van de Voort
  0 siblings, 1 reply; 3+ messages in thread
From: Tadeusz Liszka @ 2001-02-23 13:23 UTC (permalink / raw)
  To: Marco van de Voort; +Cc: cygwin

I modified your makefile to print some intermediate results. See below for
the comments on how the makefile works. To find the problem type:
	which pwd
or
	which pwd.exe
in the bash shell (or find it manually if this fails).

My guess is that the $PATH variable is not correct (I recall that on
Windows it may have Path PATH and path and it somehow concatenates them
together

However for me this single line works and does the same as all your lines
BASEDIR1 := $(shell pwd)

Your code goes long way around to have the same result, and obviously it
fails in some situations.

If you do not know much about make :-) then make sure that the lines with
'echo' start with TAB, not space

Try the following:

all:
	echo BASEDIR $(BASEDIR)
	echo BASEDIR1 $(BASEDIR1)
	echo PWD $(PWD)
	echo PWD1 $(PWD1)
	echo PATH $(PATH)
	echo `pwd`
	echo `which pwd`
	




Marco van de Voort wrote:
> 
> I have of set of makefiles that donn't work under win NT and 2000, but
> seem to work under '98 ,'95     (and djgpp on those targets), and
> FreeBSD, Linux.
> 
> - Shell (cmd.exe or bash) doesn't seem to matter.
> - I don't have djgpp on the 2000 machine to test.
> 
> I isolated the problem part, this makefile snippet prints the current
> path, but not under
> cygwin on NTish systems.
> 
> It seems to be the line with shell in it, but I don't know enough about
> makefile semantics to hunt it down or locate the problem spot.
> 
> I do monitor the list, but irregularly, so please CC me any replies.
> 
> #
> # Don't edit, this file is generated by fpcmake v1.99.0 [2001/02/02]
> #
> default: all

# change \ in PATH to unix style /
> override PATH:=$(subst \,/,$(PATH))

#addsuffix builds the list of all dirctories in PATH 
#and appends /pwd.exe to each. Then wildcard searches if there 
#exists any file matching it
> PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(subst ;, ,$(PATH)))))
> 

#if this fails then the same test is repeated with '/pwd'
# so the above is right on Windows, this below works for Unix
> ifeq ($(PWD),)
> PWD:=$(strip $(wildcard $(addsuffix /pwd,$(subst :, ,$(PATH)))))
> endif
> 

#if there are multiple matches (e.g. duplicate directories in PATH)
# then take the first only
> PWD:=$(firstword $(PWD))

#execute it and send result to variable BASEDIR
> BASEDIR=$(shell $(PWD))
> 
> all:
>     echo $(BASEDIR)
> 
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple

-- 
Tadeusz
:: The public opinion should be alarmed by its own nonexistence
:: (512)467-0618 ext. 526 ::       Stanislaw J. Lec, trans. TJL

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: makefile that doesn't work
  2001-02-23 13:23 ` Tadeusz Liszka
@ 2001-02-23 13:34   ` Marco van de Voort
  0 siblings, 0 replies; 3+ messages in thread
From: Marco van de Voort @ 2001-02-23 13:34 UTC (permalink / raw)
  To: Tadeusz Liszka; +Cc: cygwin

> I modified your makefile to print some intermediate results. See below for
> the comments on how the makefile works. To find the problem type:
> 	which pwd
> or
> 	which pwd.exe
> in the bash shell (or find it manually if this fails).
> 
> My guess is that the $PATH variable is not correct (I recall that on
> Windows it may have Path PATH and path and it somehow concatenates them
> together

(we already found a workaround). The problem is the different path 
separator (';' vs':')  in the path env.
 
> However for me this single line works and does the same as all your lines
> BASEDIR1 := $(shell pwd)
> 
> Your code goes long way around to have the same result, and obviously it
> fails in some situations.

> If you do not know much about make :-) then make sure that the lines with
> 'echo' start with TAB, not space

:-) I'm not that bad.
  
Thanks. This looks cleaner than the solution one of our members 
came up with, and we'll start some testing on the different targets to 
see what is best.



Marco van de Voort (MarcoV@Stack.nl or marco@freepascal.org)



--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-02-23 13:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-19  4:54 makefile that doesn't work Marco van de Voort
2001-02-23 13:23 ` Tadeusz Liszka
2001-02-23 13:34   ` Marco van de Voort

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).