Makefile 1.41 KB
O'Reilly Media, Inc. committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
# Notes:
# $@ means "The file name of the target of the rule"
# $< means "The name of the first prerequisite"
# $+ means "The names of all the prerequisites, with spaces between them, exactly as given"
# For more magic automatic variables, see
# <http://www.gnu.org/software/make/manual/html_chapter/make_10.html#SEC111>

# First target is "run", which will cause Make build and run the specified target
# The prerequisite should be the Java program name to run (without the ".class" suffix)

run: TestResolve

CLASSES = \
	TestRegister.class \
	TestRegisterWithAttributes.class \
	TestRegisterWithUpdates.class \
	TestBrowse.class \
	TestResolve.class \
	TestResolveWithMonitoring.class

all: $(CLASSES)

clean:
	rm $(CLASSES)

# Rules to run programs with appropriate arguments

TestRegister: TestRegister.class
	java -Dfile.encoding=UTF8 $@ "Moët & Chandon"

TestRegisterWithAttributes: TestRegisterWithAttributes.class
	java -Dfile.encoding=UTF8 $@ "Moët & Chandon"

TestRegisterWithUpdates: TestRegisterWithUpdates.class
	java -Dfile.encoding=UTF8 $@ "Moët & Chandon"

TestResolve: TestResolve.class
	java -Dfile.encoding=UTF8 $@ "Moët & Chandon" local

TestResolveWithMonitoring: TestResolveWithMonitoring.class
	java -Dfile.encoding=UTF8 $@ "Moët & Chandon" local

dns-sd:
	dns-sd -Q 'Moët\032&\032Chandon._example._tcp.local.' 16

# Implicit rules

%.class: %.java
	javac -encoding UTF8 $<

%: %.class
	java -Dfile.encoding=UTF8 $@