added install target (and some other improvements) to Makefile
authorMatthias Förste <foerste@schlittermann.de>
Mon, 23 May 2016 16:07:17 +0200
changeset 2 b7ec299a0f88
parent 1 c023631e8f3b
child 3 dd2512deef63
added install target (and some other improvements) to Makefile
Makefile
--- a/Makefile	Mon May 23 16:06:08 2016 +0200
+++ b/Makefile	Mon May 23 16:07:17 2016 +0200
@@ -1,14 +1,22 @@
-SCRIPT = check_avastlicense
+SCRIPTS = check_avastlicense
+CLEANFILES = $(SCRIPTS)
+DESTDIR =
+prefix = /usr
 
-.PHONY:	all clean
+plugindir = $(prefix)/lib/nagios/plugins/ius
 
-all:	$(SCRIPT)
+.PHONY:	all clean install
+
+all:	$(SCRIPTS)
 
 clean:
-	rm -rf $(SCRIPT)
+	rm -rf $(CLEANFILES)
 
-%:	%.sh Makefile
+install: all
+	install -d -m 0755 $(DESTDIR)/$(plugindir)
+	install -m 0755 $(SCRIPTS) $(DESTDIR)/$(plugindir)/
+
+%:	%.sh
 	# $@
 	@sh -n $<
 	@cp $< $@
-	@chmod +x $@