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

what:
	@echo Usage: make system-type. System types are:
	@echo sunos4 sunos5 ultrix4 hpux9 freebsd irix5 newsos4 osf1
	@exit 1;

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

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

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

clean:
	for i in $(LIST1) telnetd $(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
