# Makefile for a standalone VAX tftp

LIBDIR = /sys/standca
CRT=	$(LIBDIR)/relsrt0.o
LIBS =	$(LIBDIR)/apa16tty_boot.o $(LIBDIR)/mpeltty_boot.o \
	$(LIBDIR)/mpeltty_mcode.o $(LIBDIR)/libsa.a -lc

CC=hc2
LDFLAGS = -N -x -e start
CFLAGS = -O -I. -I/mit/cgw/src/sys/include \
	-DETHER -Dstandalone -DATHENA_INSTALL -DNOINTR -DSM

BINS =	etftp bootpd #hostname timing hello tboot

OBJS =	tftp.o ether.o e_net.o bootp.o res_name.o dev.o nip.o \
	phex.o name_res.o rt.o un.o

SRCS =	tftp.c ether.c e_net.c bootp.c res_name.c dev.c nip.c \
	phex.c name_res.c rt.c un.c \
	boot.c bootpd.c hostname.c timing.c hello.c

all:	$(BINS)

etftp:	boot.o $(OBJS)
	rm -f etftp
	ld $(LDFLAGS) -T 280000 $(CRT) boot.o $(OBJS) $(LIBS) -o etftp

# tboot does not work... sigh...
tboot:	boot.o $(OBJS)
	rm -f a.out
	ld $(LDFLAGS) -T 2000 -s $(CRT) boot.o $(OBJS) $(LIBS)
	dd if=a.out of=tboot ibs=32 skip=1
	rm -f a.out

hello:	hello.o
	rm -f hello
	ld $(LDFLAGS) -T 100000 $(CRT) hello.o $(LIBS) -o hello

bootpd: bootpd.o
	rm -f bootpd
	cc -o bootpd bootpd.o

hostname: hostname.o $(OBJS)
	rm -f hostname
	ld $(LDFLAGS) -T 100000 $(CRT) hostname.o $(OBJS) $(LIBS) -o hostname

timing:	timing.o $(OBJS)
	rm -f timing
	ld $(LDFLAGS) -T 100000 $(CRT) timing.o $(OBJS) $(LIBS) -o timing

#nip.o:	nip.c
#	cc -c -B/urvd/lib/ $(CFLAGS) nip.c
#name_res.o: name_res.c
#	cc -c -DDEBUG $(CFLAGS) name_res.c

clean:
	rm -f *.o $(BINS)

install:

depend:
	makedepend -s "# DO NOT DELETE THIS LINE -- make depend uses it" \
		$(CFLAGS) $(SRCS)

# DO NOT DELETE THIS LINE -- make depend uses it

tftp.o: /mit/cgw/src/sys/include/types.h /mit/cgw/src/sys/src.rt/types-rt.h
tftp.o: sys.h sys-rt.h /usr/include/a.out.h /usr/include/sys/exec.h ether.h
ether.o: ether.h /mit/cgw/src/sys/include/types.h
ether.o: /mit/cgw/src/sys/src.rt/types-rt.h sys.h sys-rt.h
e_net.o: ether.h /mit/cgw/src/sys/include/types.h
e_net.o: /mit/cgw/src/sys/src.rt/types-rt.h sys.h sys-rt.h
bootp.o: /mit/cgw/src/sys/include/types.h /mit/cgw/src/sys/src.rt/types-rt.h
bootp.o: sys.h sys-rt.h ether.h
dev.o: /mit/cgw/src/sys/include/types.h /mit/cgw/src/sys/src.rt/types-rt.h
dev.o: sys.h sys-rt.h
nip.o: /mit/cgw/src/sys/include/types.h /mit/cgw/src/sys/src.rt/types-rt.h
nip.o: sys.h sys-rt.h ether.h
name_res.o: /mit/cgw/src/sys/include/types.h
name_res.o: /mit/cgw/src/sys/src.rt/types-rt.h sys.h sys-rt.h ether.h
un.o: /mit/cgw/src/sys/include/types.h /mit/cgw/src/sys/src.rt/types-rt.h
un.o: sys.h sys-rt.h unreg.h
bootpd.o: /usr/include/stdio.h /usr/include/sys/types.h
bootpd.o: /usr/include/sys/socket.h /usr/include/netinet/in.h
bootpd.o: /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h
bootpd.o: /usr/include/sys/ttydev.h /usr/include/net/if.h
bootpd.o: /usr/include/net/if_arp.h /usr/include/netdb.h
bootpd.o: /usr/include/syslog.h bootp.h
