# Makefile for tleds and xtleds.
# GPL (c) 1997 Jouni.Lohikoski@iki.fi

all:	tleds xtleds install
# The first one is if you want to include X code
xtleds:	tleds.c
	# Making xtleds
	gcc -O3 -Wall -o xtleds tleds.c -I /usr/X11R6/include/ -L /usr/X11R6/lib/ -lX11

# This second one works only when started in VT. Check the REMOVE_X_CODE
# in the source code.
tleds:	tleds.c
	# Making tleds
	gcc -DNO_X_SUPPORT -O3 -Wall -o tleds tleds.c

help:
	# make help	-	this.
	# make tleds	-	makes tleds.
	# make xtleds	-	makes xtleds.
	# make install	-	installs tleds, xtleds and tleds man page
	#			if EUID root.
	# make all	-	make tleds, xtleds, and install if root.
	
install: tleds
	# EUID root needed !
	# installing ....
	cp tleds /usr/bin/tleds
	chgrp users /usr/bin/tleds
	chmod u+x /usr/bin/tleds
	cp tleds.1 /usr/man/man1/tleds.1
	chmod og-wr /usr/bin/tleds /usr/man/man1/tleds.1
	chmod og+r /usr/man/man1/tleds.1
	ln -fs /usr/man/man1/tleds.1 /usr/man/man1/xtleds.1
	cp xtleds /usr/bin/xtleds
	chgrp users /usr/bin/xtleds
	chmod u+x /usr/bin/xtleds
	chmod og-wr /usr/bin/xtleds
	sync
	# ....Done.

