# TNET Makefile 11/08/92     Michael Temari (temari@temari.ae.ge.com)

# TNET installation main directory
tnetdir = /etc/tnet

Mos_patches:
	@echo "OS_patches should be installed before making all of TNET"
	@echo "After os_patches have been installed type: make TNET"

TNET:	Mlibrary Mkernel Mdrivers Mcommands
	@echo "TNET build is complete type: make INSTALL"

INSTALL:
	@echo "TNET main directory is: $(tnetdir)"
	@sleep 5
	mkdir $(tnetdir)
	chmod 777 $(tnetdir)
	mkdir $(tnetdir)/.pipes
	chmod 777 $(tnetdir)/.pipes
	mkdir $(tnetdir)/bin
	chmod 755 $(tnetdir)/bin
	cd $(tnetdir)/bin
	cp commands/alive/alive $(tnetdir)/bin
	cp commands/daytimed/daytimed $(tnetdir)/bin
	cp commands/finger/finger $(tnetdir)/bin
	cp commands/fingerd/fingerd $(tnetdir)/bin
	cp commands/ftp/ftp $(tnetdir)/bin
	cp commands/ftpd/ftpd $(tnetdir)/bin
	cp commands/host/host $(tnetdir)/bin
	cp commands/hostname/hostname $(tnetdir)/bin
	cp commands/inetd/inetd $(tnetdir)/bin
	cp commands/netcom/netcom $(tnetdir)/bin
	cp commands/netdate/netdate $(tnetdir)/bin
	cp commands/nntp/nntp $(tnetdir)/bin
	cp commands/smtp/smtp $(tnetdir)/bin
	cp commands/telnet/telnet $(tnetdir)/bin
	cp commands/telnetd/telnetd $(tnetdir)/bin
	cp commands/timed/timed $(tnetdir)/bin
	chmod 755 $(tnetdir)/bin/*
	chmod 4755 $(tnetdir)/bin/ftpd
	ln $(tnetdir)/bin/netcom $(tnetdir)/bin/attach
	ln $(tnetdir)/bin/netcom $(tnetdir)/bin/ip
	ln $(tnetdir)/bin/netcom $(tnetdir)/bin/tcp
	ln $(tnetdir)/bin/netcom $(tnetdir)/bin/route
	ln $(tnetdir)/bin/netcom $(tnetdir)/bin/arp
	ln $(tnetdir)/bin/netcom $(tnetdir)/bin/halt
	ln $(tnetdir)/bin/netcom $(tnetdir)/bin/pause
	ln $(tnetdir)/bin/netcom $(tnetdir)/bin/restart
	ln $(tnetdir)/bin/netcom $(tnetdir)/bin/detach
#	cp drivers/cslip/cslip.drv $(tnetdir)
	cp drivers/ether/ether.drv $(tnetdir)
#	cp drivers/ppp/ppp.drv $(tnetdir)
	cp drivers/slip/slip.drv $(tnetdir)
	cp samples/* $(tnetdir)
	chmod 644 $(tnetdir)/*
	chmod 755 $(tnetdir)/*.drv
	cp kernel/tnet $(tnetdir)
	chmod 755 $(tnetdir)/tnet
	@echo
	@echo "Modify configuration files in $(tnetdir) to suit your needs"
	@echo "Add $(tnetdir)/bin to your PATH"
	@echo
	@echo "Enjoy TNET..."
	@echo "Send any comments, bug fixes, enhancements, etc... to temari@temari.ae.ge.com"

Mlibrary:
	@echo "Making TNET libraries"
	@(cd lib/tnet; make; cd ../..)
	@(cd lib/inet; make; cd ../..)

Mkernel:
	@echo "Making TNET kernel"
	@(cd kernel; make; cd ..)

Mdrivers:
	@echo "Making TNET drivers"
	@(cd drivers/cslip; make; cd ../..)
	@(cd drivers/ether; make; cd ../..)
	@(cd drivers/ppp; make; cd ../..)
	@(cd drivers/slip; make; cd ../..)

Mcommands:
	@echo "Making TNET commands"
	@(cd commands/alive; make; cd ../..)
	@(cd commands/daytimed; make; cd ../..)
	@(cd commands/finger; make; cd ../..)
	@(cd commands/fingerd; make; cd ../..)
	@(cd commands/ftp; make; cd ../..)
	@(cd commands/ftpd; make; cd ../..)
	@(cd commands/host; make; cd ../..)
	@(cd commands/hostname; make; cd ../..)
	@(cd commands/inetd; make; cd ../..)
	@(cd commands/netcom; make; cd ../..)
	@(cd commands/netdate; make; cd ../..)
	@(cd commands/nntp; make; cd ../..)
	@(cd commands/smtp; make; cd ../..)
	@(cd commands/telnet; make; cd ../..)
	@(cd commands/telnetd; make; cd ../..)
	@(cd commands/timed; make; cd ../..)
