tools/Makefile

changeset 612
452f79a5ad71
parent 559
2bcccc6976f9
child 633
8b84e73af50e
--- a/tools/Makefile	Wed May 12 21:17:59 2021 +0200
+++ b/tools/Makefile	Thu May 13 13:49:04 2021 +0200
@@ -2,12 +2,7 @@
 
 include ../Makefile.global
 
-#SRCS		= $(wildcard *.c)
-#HDRS		= $(wildcard *.h)
-#OBJS		= $(SRCS:.c=.o)
-#SLIBS		= -lpthread
-#TARGET		= thermferm
-OTHER		= Makefile thermferm.init
+OTHER		= Makefile init.debian init.slackware setup.slackware
 
 #############################################################################
 
@@ -21,8 +16,19 @@
 		rm -f ${TARGET} *.o *.h~ *.c~ core filelist Makefile.bak
 
 install:
-		${INSTALL} -c -g root -o root -m 0755 thermferm.init /etc/init.d/thermferm
-		[ -x /bin/systemctl ] && /bin/systemctl daemon-reload
+		@if [ -x /lib/systemd/systemd ]; then \
+			${INSTALL} -c -g root -o root -m 0755 init.debian /etc/init.d/thermferm ; \
+			echo "${INSTALL} -c -g root -o root -m 0755 init.debian /etc/init.d/thermferm" ; \
+			[ -x /bin/systemctl ] && /bin/systemctl daemon-reload ; \
+			echo "[ -x /bin/systemctl ] && /bin/systemctl daemon-reload" ; \
+		elif [ -f /etc/slackware-version ]; then \
+			${INSTALL} -c -g root -o root -m 0755 init.slackware /etc/rc.d/init.d/thermferm ; \
+			echo "${INSTALL} -c -g root -o root -m 0755 init.slackware /etc/rc.d/init.d/thermferm" ; \
+			${INSTALL} -c -g root -o root -m 0755 setup.slackware /var/lib/pkgtools/setup/setup.thermferm ; \
+			echo "${INSTALL} -c -g root -o root -m 0755 setup.slackware /var/lib/pkgtools/setup/setup.thermferm" ; \
+		else \
+			echo "Unsupported distribution" ; \
+		fi
 
 filelist:	Makefile
 		BASE=`pwd`; \

mercurial