🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3769

Re: Makefile : %.class: %.java

#3769
From: Jonathan Kamens
Date: Sun, 03 Jun 2001 01:38
23 lines
1993 bytes
In article <sa8snhiepqq.fsf_-_@sun_tong_001.personal.yahoo.com>,
 * Tong * <sun_tong_001@yahoo.com> writes:
>Here is an example of explicit rule:
>
>${CLASSFDIR}/knn/DbKnn.class: knn/DbKnn.java
>        javac -d ${CLASSFDIR} knn/DbKnn.java
>
>${CLASSFDIR}/knn/Knn.class: knn/Knn.java
>        javac -d ${CLASSFDIR} knn/Knn.java
>
>Any idea that can make 'make' work this way? 

I am not sure what the problem is.  The rule I already gave you should
work just fine:

${CLASSFDIR}/%.class: %.java
	javac -d ${CLASSFDIR} $<

Note that there's nothing special about slashes as far as '%' is
concerned -- it's a generic wildcard.  In the examples you gave above,
it would match "knn/DbKnn" the first time or "knn/Knn" the second time.

Perhaps there's something wrong with your example?
Technical Details
Message-ID: <9fc4e2$cko$1@jik.kamens.brookline.ma.us>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!jik.kamens.brookline.ma.us!jik
References: <3B03B870.2168B36C@bigfoot.com> <p5lmnwukdf.fsf@lemming.engeast.baynetworks.com> <p5bsosui8e.fsf@lemming.engeast.baynetworks.com> <sa8vgmls6pf.fsf@sun_tong_001.personal.yahoo.com> <9f4aia$bda$1@jik.kamens.brookline.ma.us> <sa8snhiepqq.fsf_-_@sun_tong_001.personal.yahoo.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109f73,4f4561c76a5fff83
X-Google-Attributes: gid109f73,public
X-Google-Thread: fc89c,4f4561c76a5fff83
X-Google-Attributes: gidfc89c,public
X-Google-ArrivalTime: 2001-06-02 19:01:02 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!jik.kamens.brookline.ma.us!jik
From: jik@kamens.brookline.ma.us (Jonathan Kamens)
Newsgroups: comp.unix.programmer,gnu.utils.help
Subject: Re: Makefile : %.class: %.java
Date: 3 Jun 2001 01:38:10 GMT
Organization: jik's Linux box
Lines: 23
Message-ID: <9fc4e2$cko$1@jik.kamens.brookline.ma.us>
References: <3B03B870.2168B36C@bigfoot.com> <p5lmnwukdf.fsf@lemming.engeast.baynetworks.com> <p5bsosui8e.fsf@lemming.engeast.baynetworks.com> <sa8vgmls6pf.fsf@sun_tong_001.personal.yahoo.com> <9f4aia$bda$1@jik.kamens.brookline.ma.us> <sa8snhiepqq.fsf_-_@sun_tong_001.personal.yahoo.com>
NNTP-Posting-Host: jik-0.dsl.speakeasy.net
X-Trace: jik.kamens.brookline.ma.us 991532290 12952 66.92.77.120 (3 Jun 2001 01:38:10 GMT)
X-Complaints-To: usenet@kamens.brookline.ma.us
NNTP-Posting-Date: 3 Jun 2001 01:38:10 GMT
X-Newsreader: xrn 9.03-beta-5