🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: be.comp.programming
2 messages
2 total messages Started by Bart Vandewoestyne Tue, 19 Nov 2002 23:45
java & Makefiles
#6849
Author: Bart Vandewoestyne
Date: Tue, 19 Nov 2002 23:45
65 lines
2936 bytes
Ziehier een tweede post ivm Makefiles :-)

Bij mij is het probleem het volgende:

Ik heb momenteel volgende heel simpele Makefile:

sip:
        javac src/sip/*.java
        javac src/sip/exception/*.java
        javac src/sip/sipheader/*.java

unittest:
        javac test/sip/*.java
        javac test/sip/sipheader/*.java


Nu is het probleem hier zo'n beetje bij dat als ik subdirectories
bijmaak, dat ik dan ook die Makefile moet zitten aanpassen... ik zou
eigenlijk een 'intelligentere' Makefile willen die gewoon recursief
alle subdirectories doorloopt en gewoon alle .java bestanden
compileert naar .class files.

Ik heb vroeger al volgende file gebruikt:


# Simple makefile for java programs.
#

JAVAC = javac

# Get the list of files matching *.java
sources = $(wildcard *.java)

# Take the variabele 'sources' and substitute every .java with
# a .class to define the classes.
classes = $(sources:.java=.class)

# Ensure that everything gets built.
all: $(classes)

%.class : %.java
        $(JAVAC) $<

#jar: *.class
#       jar cmf Manifest.txt LogMeIn.jar *.class

clean :
        rm -f *.class *.jar *~


Maar die zoekt enkel in de huidige directory, en gaat niet recursief
alle directories af... de clue zit hem in hoe je 'sources = $(wildcard
*.java)' moet veranderen zodat je daar ALLE .java files krijgt...

Iemand?

Greetzzz,
mc303

-- 
Ing. Bart Vandewoestyne		      Bart.Vandewoestyne_at_pandora.be
Hugo Verrieststraat 48			       GSM: +32 (0)478 397 697
B-8550 Zwevegem			 http://users.pandora.be/vandewoestyne
----------------------------------------------------------------------
"Any fool can know, the point is to understand." - Albert Einstein
Re: java & Makefiles
#6852
Author: Dominique Devriese
Date: Wed, 20 Nov 2002 00:08
24 lines
1648 bytes
Bart Vandewoestyne writes:

> Ziehier een tweede post ivm Makefiles :-) Bij mij is het probleem
> het volgende:

<snip>

> # Get the list of files matching *.java
> sources = $(wildcard *.java)

<snip>

> Maar die zoekt enkel in de huidige directory, en gaat niet recursief
> alle directories af... de clue zit hem in hoe je 'sources =
> $(wildcard *.java)' moet veranderen zodat je daar ALLE .java files
> krijgt...

$(shell find -name '*.java') ?

sjuus
domi

-- 
You will soon forget this.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads