public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Magic variables for make and Cygwin drive mapping
@ 1999-09-01  1:56 Schaible, Joerg
  1999-09-03  2:14 ` unsubscribe walter@adersa.worldnet.net Stephane Cateland
  1999-09-30 23:42 ` Magic variables for make and Cygwin drive mapping Schaible, Joerg
  0 siblings, 2 replies; 6+ messages in thread
From: Schaible, Joerg @ 1999-09-01  1:56 UTC (permalink / raw)
  To: 'cygwin-list'

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4071 bytes --]

Hello,

writing currently GNU make compatible make files for different plattforms I
also have to deal with the Cygwin naming scheme using absolute paths within
the system. The make rules and Cygwin tools handle the Cygwin drive mapping,
the probably needed DOS/Win-based tools won't. So I have defined the
following variables to deal with the situation within the rules.

To convert your own file names or directory lists just have a look at the
first variable RT and replace the $@ by your variable. The "macro" will
preserve the sequence. You may test your variables with the debug targets at
the end (e.g. make for.TEST TEST="a b c d e f").

Hope others will find this helpfull.

Greetings
Jörg


------------------------------ cygwin path converter variables
-----------------------------------------

# Special variables to deal with cygwin

ifeq ($(OSTYPE),cygwin32)

ALLDRIVES       := a b c d e f g h i j k l m n o p q r s t u v w x y z
CYGWINROOTDRIVE := c
CYGWINMAPPING   := //
#CYGWINMAPPING   := /cygwin/

# Rule target
RT = $(strip $(subst /,\\,$(foreach directory,$@,$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))
# First dependend
RF = $(strip $(subst /,\\,$(foreach directory,$<,$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))
# Newer dependend
RN = $(strip $(subst /,\\,$(foreach directory,$?,$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))
# All dependend
RA = $(strip $(subst /,\\,$(foreach directory,$^,$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))
# Stem of rule target
RS = $(strip $(subst /,\\,$(foreach directory,$*,$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))

# Rule target without extension
RTB = $(strip $(subst /,\\,$(foreach directory,$(basename $@),$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))
# First dependend without extension
RFB = $(strip $(subst /,\\,$(foreach directory,$(basename $<),$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))

# Rule target directory
RTD = $(strip $(subst /,\\,$(foreach directory,$(@D),$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))
# First dependend directory
RFD = $(strip $(subst /,\\,$(foreach directory,$(<D),$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))

else

# Rule target
RT = $@
# First dependend
RF = $<
# Newer dependend
RN = $<
# All dependend
RA = $^
# Stem of rule target
RS = $*

# Rule target without extension
RTB = $(basename $@)
# First dependend without extension
RFB = $(basename $<)

# Rule target directory
RTD = $(@D)
# First dependend directory
RFD = $(<D)

endif

------------------------------ debug targets
-----------------------------------------

ECHO = echo -e

echo.%:
    @$(ECHO) $(subst \,\\,$($(patsubst echo.%,%,$@)))

for.%:
    @for i in $(subst \,\\,$($(patsubst for.%,%,$@))); do $(ECHO) $$i; done



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

* unsubscribe walter@adersa.worldnet.net
  1999-09-01  1:56 Magic variables for make and Cygwin drive mapping Schaible, Joerg
@ 1999-09-03  2:14 ` Stephane Cateland
  1999-09-03 10:55   ` Samba 2 running in NT box: almost there !! MoMa
  1999-09-30 23:42   ` unsubscribe walter@adersa.worldnet.net Stephane Cateland
  1999-09-30 23:42 ` Magic variables for make and Cygwin drive mapping Schaible, Joerg
  1 sibling, 2 replies; 6+ messages in thread
From: Stephane Cateland @ 1999-09-03  2:14 UTC (permalink / raw)
  To: 'cygwin-list'

unsubscribe walter@adersa.worldnet.net

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

* Samba 2 running in NT box: almost there !!
  1999-09-03  2:14 ` unsubscribe walter@adersa.worldnet.net Stephane Cateland
@ 1999-09-03 10:55   ` MoMa
  1999-09-30 23:42     ` MoMa
  1999-09-30 23:42   ` unsubscribe walter@adersa.worldnet.net Stephane Cateland
  1 sibling, 1 reply; 6+ messages in thread
From: MoMa @ 1999-09-03 10:55 UTC (permalink / raw)
  To: cygwin

Hi,

I have been able to port Samba 2 to an NT box with this setup:
NT 4.0, cygwin Beta 20.1, gcc of this version of cygwin

Well, almost.There is a probleml with the select (cygwin) call in the
samba function sys_select. This select returns inmediately, with
errno=EBADF. This seems akward to me at this point of the server
process, it must be an indicator of a prior error. But the socket opens
correctly some source lines before, and is ready to listen (errno=0).

This prevents the smbd in NT from serving (does not detect the
connection from the client) and the smbclient in NT from receiving the
results of the commands it sends (it connects to a Linux box Samba,
sends commands but does not receive the returning packages).

If we overcome this, Samba will work on NT. I have done a research on
the legal/license implications of this, and look very interesting:
 * The legal limit of 10 connections to an NT workstation dissapear =>
NT server value for NT workstation price, legal.
 * No need for CAL (client access license) to connect to an NT box =>
legal non Win clients, and the NT Terminal server client implications
seem interesting too.

Can someone help withthe select problem?

TIA

Ivan & Ray


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

* Samba 2 running in NT box: almost there !!
  1999-09-03 10:55   ` Samba 2 running in NT box: almost there !! MoMa
@ 1999-09-30 23:42     ` MoMa
  0 siblings, 0 replies; 6+ messages in thread
From: MoMa @ 1999-09-30 23:42 UTC (permalink / raw)
  To: cygwin

Hi,

I have been able to port Samba 2 to an NT box with this setup:
NT 4.0, cygwin Beta 20.1, gcc of this version of cygwin

Well, almost.There is a probleml with the select (cygwin) call in the
samba function sys_select. This select returns inmediately, with
errno=EBADF. This seems akward to me at this point of the server
process, it must be an indicator of a prior error. But the socket opens
correctly some source lines before, and is ready to listen (errno=0).

This prevents the smbd in NT from serving (does not detect the
connection from the client) and the smbclient in NT from receiving the
results of the commands it sends (it connects to a Linux box Samba,
sends commands but does not receive the returning packages).

If we overcome this, Samba will work on NT. I have done a research on
the legal/license implications of this, and look very interesting:
 * The legal limit of 10 connections to an NT workstation dissapear =>
NT server value for NT workstation price, legal.
 * No need for CAL (client access license) to connect to an NT box =>
legal non Win clients, and the NT Terminal server client implications
seem interesting too.

Can someone help withthe select problem?

TIA

Ivan & Ray


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

* unsubscribe walter@adersa.worldnet.net
  1999-09-03  2:14 ` unsubscribe walter@adersa.worldnet.net Stephane Cateland
  1999-09-03 10:55   ` Samba 2 running in NT box: almost there !! MoMa
@ 1999-09-30 23:42   ` Stephane Cateland
  1 sibling, 0 replies; 6+ messages in thread
From: Stephane Cateland @ 1999-09-30 23:42 UTC (permalink / raw)
  To: 'cygwin-list'

unsubscribe walter@adersa.worldnet.net

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

* Magic variables for make and Cygwin drive mapping
  1999-09-01  1:56 Magic variables for make and Cygwin drive mapping Schaible, Joerg
  1999-09-03  2:14 ` unsubscribe walter@adersa.worldnet.net Stephane Cateland
@ 1999-09-30 23:42 ` Schaible, Joerg
  1 sibling, 0 replies; 6+ messages in thread
From: Schaible, Joerg @ 1999-09-30 23:42 UTC (permalink / raw)
  To: 'cygwin-list'

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4071 bytes --]

Hello,

writing currently GNU make compatible make files for different plattforms I
also have to deal with the Cygwin naming scheme using absolute paths within
the system. The make rules and Cygwin tools handle the Cygwin drive mapping,
the probably needed DOS/Win-based tools won't. So I have defined the
following variables to deal with the situation within the rules.

To convert your own file names or directory lists just have a look at the
first variable RT and replace the $@ by your variable. The "macro" will
preserve the sequence. You may test your variables with the debug targets at
the end (e.g. make for.TEST TEST="a b c d e f").

Hope others will find this helpfull.

Greetings
Jörg


------------------------------ cygwin path converter variables
-----------------------------------------

# Special variables to deal with cygwin

ifeq ($(OSTYPE),cygwin32)

ALLDRIVES       := a b c d e f g h i j k l m n o p q r s t u v w x y z
CYGWINROOTDRIVE := c
CYGWINMAPPING   := //
#CYGWINMAPPING   := /cygwin/

# Rule target
RT = $(strip $(subst /,\\,$(foreach directory,$@,$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))
# First dependend
RF = $(strip $(subst /,\\,$(foreach directory,$<,$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))
# Newer dependend
RN = $(strip $(subst /,\\,$(foreach directory,$?,$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))
# All dependend
RA = $(strip $(subst /,\\,$(foreach directory,$^,$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))
# Stem of rule target
RS = $(strip $(subst /,\\,$(foreach directory,$*,$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))

# Rule target without extension
RTB = $(strip $(subst /,\\,$(foreach directory,$(basename $@),$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))
# First dependend without extension
RFB = $(strip $(subst /,\\,$(foreach directory,$(basename $<),$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))

# Rule target directory
RTD = $(strip $(subst /,\\,$(foreach directory,$(@D),$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))
# First dependend directory
RFD = $(strip $(subst /,\\,$(foreach directory,$(<D),$(foreach
drive,$(ALLDRIVES),$(filter $(drive):/%,$(patsubst
//$(drive)/%,$(drive):/%,$(directory)))) $(patsubst
/%,$(CYGWINROOTDRIVE):/%,$(filter-out $(CYGWINMAPPING)%,$(directory))))))

else

# Rule target
RT = $@
# First dependend
RF = $<
# Newer dependend
RN = $<
# All dependend
RA = $^
# Stem of rule target
RS = $*

# Rule target without extension
RTB = $(basename $@)
# First dependend without extension
RFB = $(basename $<)

# Rule target directory
RTD = $(@D)
# First dependend directory
RFD = $(<D)

endif

------------------------------ debug targets
-----------------------------------------

ECHO = echo -e

echo.%:
    @$(ECHO) $(subst \,\\,$($(patsubst echo.%,%,$@)))

for.%:
    @for i in $(subst \,\\,$($(patsubst for.%,%,$@))); do $(ECHO) $$i; done



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

end of thread, other threads:[~1999-09-30 23:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-01  1:56 Magic variables for make and Cygwin drive mapping Schaible, Joerg
1999-09-03  2:14 ` unsubscribe walter@adersa.worldnet.net Stephane Cateland
1999-09-03 10:55   ` Samba 2 running in NT box: almost there !! MoMa
1999-09-30 23:42     ` MoMa
1999-09-30 23:42   ` unsubscribe walter@adersa.worldnet.net Stephane Cateland
1999-09-30 23:42 ` Magic variables for make and Cygwin drive mapping Schaible, Joerg

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).