DESTDIR ?= JAR_DIR ?= /usr/share/java ANT = ant EXISTS = test -e FAIL = exit 1 FIND = find INSTALL = install RM = rm -f TOUCH = touch all: PHONY output/lib/ow_util_ant_tasks.jar output/lib/ow_util_ant_tasks.jar: $(shell $(FIND) src) $(ANT) jar && $(EXISTS) $@ || { $(RM) -r output; $(FAIL); } install: PHONY $(DESTDIR)$(JAR_DIR)/ow_util_ant_tasks.jar $(DESTDIR)$(JAR_DIR)/ow_util_ant_tasks.jar: output/lib/ow_util_ant_tasks.jar $(INSTALL) -Dm644 $< $@ clean: PHONY $(RM) -r output .PHONY: PHONY .DELETE_ON_ERROR: .SECONDARY: