SHELL	= /bin/sh
MAKE	= make
LIST1	= ftpd login rexecd
LIST2	= rlogind rshd telnetd
LIST3	= keysu skeysh

what:
	@echo Usage: make system-type. System types are:
	@echo ""
	@echo "	sunos4		SunOS 4.1.x"
	@echo "	sunos5		SunOS 5.x, aka Solaris 2.x"
	@echo "	ultrix4		Ultrix 4.x"
	@echo "	freebsd		FreeBSD 2.x"
	@echo "	hpux9		HP-UX 9.x        (no rshd/rlogind/telnetd)"
	@echo "	irix5		IRIX 5.x         (no rshd/rlogind/telnetd)"
	@echo "	decosf1		DIGITAL UNIX     (no rshd/rlogind/telnetd)"
	@echo "	newsos4		Sony NEWS/OS 4.x (no rshd/rlogind/telnetd)"
	@echo ""
	@exit 1;

sunos4 sunos5 ultrix4 freebsd:
	for i in $(LIST1); \
	do \
		(cd $$i; $(MAKE) $@-skey); \
	done
	for i in $(LIST2) $(LIST3); \
	do \
		(cd $$i; $(MAKE) $@); \
	done

hpux9 newsos4 irix5 decosf1:
	for i in $(LIST1); \
	do \
		(cd $$i; $(MAKE) $@-skey); \
	done
	for i in $(LIST3); \
	do \
		(cd $$i; $(MAKE) $@); \
	done

clean:
	for i in $(LIST1) $(LIST2) $(LIST3); \
	do \
		(cd $$i; $(MAKE) $@); \
	done

tidy:
	$(MAKE) clean
	rm -rf des
	find . -type f -print | xargs chmod a+r
	find . -type d -print | xargs chmod 755
