######################################################################
#note from sdp: My contribution is really not very important, I hacked the
# merge main.h and vt100.h (ala vt100v22) and cleaned up the formatting of
# the source code so that it didn't offend my asthetic sensitivities. (I'm
# really quite mad you know.)  I also hacked this Makefile to work for me
# and hopefully, without much work, it'll work for you.  This all started
# started when TAW's archive file was corrupted when I downloaded it...
# The executable was unusable and vt100.h was missing.  So, I hacked this
# till it worked.       
# -- Steve Poling
#    701 Livingston NE
#    Grand Rapids, MI 49503
#    (616)459-7261
#    PLINK: SPoling
#
######################################################################
#                                                                    #
# Makefile to build vt100 terminal emulator                          #
#	     861126 sdp - regenerated vt100.h tidied up some code.   #
#	     Oct 86 TAW - added TEK 4010, and removed bugs           #
#            860823 DBW - Integrated and rewrote lots of code        #
#       v2.0 860809 DBW - Major release.. LOTS of changes            #
#       v1.1 860720 DBW - Switches, 80 cols, colors, bug fixes       #
#       v1.0 860712 DBW - First version released                     #
#                                                                    #
######################################################################

OBJ1    = main.o window.o xmodem.o remote.o kermit.o script.o menu.o
OBJ2    = menupick.o devices.o toasc.o filename.o defaults.o tek.o about.o
OBJS    = $(OBJ1) $(OBJ2)
#
#ugly ugly, my version of make gets upset when dependency rules aren't space
#delimited, and alink at least, doesn't like space delimited link lists, 
#sigh.
#
MOD1    = main.o,window.o,xmodem.o,remote.o,kermit.o,script.o,menu.o
MOD2    = menupick.o,devices.o,toasc.o,filename.o,defaults.o,tek.o,about.o
MODS    = $(MOD1),$(MOD2)
LinkLib = ram:lib/
#
# I suggest you add the directory holding blink and cc to your path.  Do you
# think we could get CC to accept an environment variable for includes?
#
# Macros for commands and ancilliary macro.
link = blink
compile = cc
cflags = -c
#
# Macros for the items we'll link.
startup = $(LinkLib)lstartup.obj
libs    =  $(LinkLib)lc.lib + $(LinkLib)amiga.lib
#
# Dependencies...
vt100   : $(OBJS)
   $(link) FROM $(startup) + $(MODS) TO tek4010 LIBRARY $(libs)

#
main.o : main.c vt100.h main.h
	$(compile) $(cflags) main.c
devices.o  : devices.c vt100.h
	$(compile) $(cflags) devices.c
window.o : window.c vt100.h
	$(compile) $(cflags) window.c
xmodem.o : xmodem.c vt100.h
	$(compile) $(cflags) xmodem.c
remote.o : remote.c vt100.h
	$(compile) $(cflags) remote.c
kermit.o : kermit.c vt100.h
	$(compile) $(cflags) kermit.c
script.o : script.c vt100.h
	$(compile) $(cflags) script.c
filename.o : filename.c vt100.h
	$(compile) $(cflags) filename.c
toasc.o : toasc.c vt100.h
	$(compile) $(cflags) toasc.c
defaults.o : defaults.c vt100.h
	$(compile) $(cflags) defaults.c
tek.o : tek.c
	$(compile) $(cflags) tek.c
about.o : about.c
	$(compile) $(cflags) about.c
menu.o : menu.c
	$(compile) $(cflags) menu.c
menupick.o : menupick.c
	$(compile) $(cflags) menupick.c
#
# Extra dependencies to make life easier...
#
justlink :
   $(link) FROM $(startup) + $(MODS) TO tek4010 LIBRARY $(libs)
#
makemap :
   $(link) FROM $(startup) + $(MODS) TO tek4010 LIBRARY $(libs) MAP Tek4010.map
#
#
SRC1    = main.c window.c xmodem.c remote.c kermit.c script.c menu.c
SRC2    = menupick.c devices.c toasc.c filename.c defaults.c tek.c about.c
SRCS    = $(SRC1) $(SRC2)
# ugly, ugly, etc.  I'm quite mad you see...
archive :
   delete tek4010a.arc
   arc a tek4010a.arc $(SRCS)
   arc a tek4010a.arc Readme.sdp Makefile Tek4010
