This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: More problems with Make.


I use the $(subst ...) construct to translate directory delimiters.

In the following snippet, I needed to replace the "\" delimiters with "/" (which is what "gcc" likes) in the environment variable
JAVAHOME (inherited from my CMD DOS-Prompt session). This was necessary to pick up the Java C headers (for some native stuff).

CC=gcc -c -I$(subst \,/,$(JAVAHOME))/include -I$(subst \,/,$(JAVAHOME))/include/win32

----- Original Message -----
From: "Bernard Dautrevaux" <Dautrevaux@microprocess.com>
To: "'John Melody'" <john@sybernet.ie>; <cygwin@cygwin.com>
Sent: Thursday, January 18, 2001 5:34 PM
Subject: RE: More problems with Make.


> > -----Original Message-----
> > From: John Melody [mailto:john@sybernet.ie]
> > Sent: Thursday, January 18, 2001 5:21 PM
> > To: cygwin@cygwin.com
> > Subject: More problems with Make.
> >
> >
> >
> >
> > I still have some problems with make - I thought I had
> > resolved the problems
> > with the --unix qualifier but not so ....
> >
> >
> > I am using
> > cygwin 1.16
> > make 3.79
> > from the cygwin directory.
> >
> > I have included a part of my make file as follows:
> >
> > ------------------------------------------
> > SRC_ROOT=d:/work/squash02
> > OUTPUTDIR=d:\cm-build
> > VERSION=checkmate-0.7.0
> > CM_VER= CheckMate API V0.7.0
> > DISTRIBUTION_DIR=$(OUTPUTDIR)\$(VERSION)
> >
> > CLASSES=d:\\classes
> > CPath=.;$(CLASSES);$(SRC_ROOT)\lib\jaxp.jar;$(SRC_ROOT)\lib\pa
> > rser.jar;$(SRC
> > _ROOT)\lib\jh.jar
> >
> > Flags=-deprecation -d $(CLASSES) -classpath $(CPath)
> >
> > all:
> > javac $(Flags) d:\work\squash02\squ\SQUCheckmate.java
> >
> > jar:
> > cd $(CLASSES) ; \
> > jar -cvf $(DISTRIBUTION_DIR)\lib\classes.jar squ/
> >
> > -------------------------------------------
>
>
> My suggestion:
>
> Use only forward slashes in the Makefile and, if javac or jar do not
> like these, use cygpath to convert:
>
> ------------------------------------------
> SRC_ROOT=/cygdrive/d/work/squash02
> OUTPUTDIR=/cygdrive/d/cm-build
> VERSION=checkmate-0.7.0
> CM_VER= CheckMate API V0.7.0
> DISTRIBUTION_DIR=$(OUTPUTDIR)/$(VERSION)
>
> CLASSES=/cygdrive/d/classes
> CPath=.:$(CLASSES):$(SRC_ROOT)/lib/jaxp.jar:$(SRC_ROOT)/lib/parser.jar:$(SRC
> _ROOT)/lib/jh.jar
> Flags=-deprecation -d `cygpath -w $(CLASSES)` -classpath `cygpath -p -w
> $(CPath)`
>
> JAVA_SOURCE=/cygdrive/d/work/squash02/squ/SQUCheckmate.java
>
> all:
> javac $(Flags) `cygpath -w $(JAVA_SOURCE)`
>
> jar:
> cd $(CLASSES) ; \
> jar -cvf $(DISTRIBUTION_DIR)/lib/classes.jar squ/
>
> -------------------------------------------
>
> Using cygpath everywhere allows to use the various paths as
> targets/dependencies so that make could only rebuild what has to be rebuilt.
>
> HTH
>
> Bernard
>
> --------------------------------------------
> Bernard Dautrevaux
> Microprocess Ingenierie
> 97 bis, rue de Colombes
> 92400 COURBEVOIE
> FRANCE
> Tel: +33 (0) 1 47 68 80 80
> Fax: +33 (0) 1 47 88 97 85
> e-mail: dautrevaux@microprocess.com
> b.dautrevaux@usa.net
> --------------------------------------------
>
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]