# @(#)makefile	19.1 (ESO-IPG) 02/25/03 13:58:13
# .COPYRIGHT:	Copyright (c) 1988 European Southern Observatory,
#						all rights reserved
# .TYPE		make file
# .NAME		$MIDASHOME/$MIDVERS/libsrc/tw/makefile
# .LANGUAGE	makefile syntax
# .ENVIRONMENT	Unix Systems. 
# .COMMENT	Compiles source files and generates twlib library
#
# .REMARKS	
# .AUTHOR	Francois Ochsenbein
# .VERSION 1.1	880105:		Implementation
# .VERSION 1.2	890104:		Generating makefile.com for VMS systems
# .VERSION 1.3	890120:		Use NOTRACING option 	
# .VERSION 1.4	890714:		Added str1 routines.
# .VERSION 2.1  901203:         New directory structure. CG
# .VERSION 3.0  930308:		Using default.mk file

include ../../local/default.mk

OBJ =	termcap.o tvutil.o tvinit.o tvget.o tvgets.o tvput.o tvout.o \
	tvcursor.o tvclear.o tvindel.o tvhelp.o error.o trace.o str1.o 

LIB = $(LIBDIR)/libtw.a
LLIB = -L$(LIBDIR) -ltw -los 
CMD = tvtest.exe
OBJS = tvtest.o 

# DEPENDENCIES:
#all: $(MAKEFILE_VMS) $(LIB) $(CMD)
all: $(MAKEFILE_VMS) $(LIB)

$(MAKEFILE_VMS): makefile
	$(MAKE_VMS)

$(CMD): $(OBJS) $(LIB)
	$(LDCC) $(OBJS) $(LLIB) $(SLIB) -o $@
	$(STRIP) $@

$(LIB): $(OBJ)
	$(AR) $(AR_OPT) $(LIB) $(OBJ)
	$(RANLIB) $(LIB)

error.c: $(INC)/osdefos.h \
	$(INC)/macrogen.h \
	$(INC)/error.h
termcap.c: $(INC)/twset.h
trace.c: $(INC)/osdefos.h \
	$(INC)/macrogen.h \
	$(INC)/atype.h \
	$(INC)/osfile.h
tvclear.c: $(INC)/twset.h
tvcursor.c: $(INC)/twset.h
tvget.c: $(INC)/twset.h
tvgets.c: $(INC)/twset.h
tvhelp.c: $(INC)/twset.h
tvindel.c: $(INC)/twset.h
tvinit.c: $(INC)/twset.h \
	$(INC)/osterm.h
tvout.c: $(INC)/twset.h
tvput.c: $(INC)/twset.h
tvtest.c: $(INC)/macrogen.h \
	$(INC)/ok.h \
	$(INC)/trace.h \
	$(INC)/error.h \
	$(INC)/tw.h \
	$(INC)/atype.h
tvutil.c: $(INC)/twset.h

clean:
	rm -f $(OBJ) $(OBJS)
