LIBS  = -lm -lXaw -lXmu -lXt -lX11 -lXext -lsocket
FLAGS = -DSYSV -DUSL -DSYSV386 -DNARROWPROTO -I/usr/X/include -L/usr/X/lib
COBJ  = clim.o heat.o pressure.o wind.o rain.o climate.o fileio.o
TOBJ  = tec1.o tec2.o tec3.o fileio.o
GOBJ  = globe.o fileio.o
GRAF  = x

# Change GRAF from x to unix to produce text-only versions

all: clim tec globe

clim:       $(COBJ) $(GRAF).o; cc $(FLAGS) -o clim  $(COBJ) $(GRAF).o $(LIBS)
tec:        $(TOBJ) $(GRAF).o; cc $(FLAGS) -o tec   $(TOBJ) $(GRAF).o $(LIBS)
globe:      $(GOBJ) $(GRAF).o; cc $(FLAGS) -o globe $(GOBJ) $(GRAF).o $(LIBS)

tec1.o:     tec1.c const.h tec.h;      cc $(FLAGS) -c tec1.c
tec2.o:     tec2.c const.h tec.h;      cc $(FLAGS) -c tec2.c
tec3.o:     tec3.c const.h tec.h;      cc $(FLAGS) -c tec3.c

globe.o:    globe.c const.h;           cc $(FLAGS) -c globe.c

clim.o:     clim.c const.h clim.h;     cc $(FLAGS) -c clim.c
heat.o:     heat.c const.h clim.h;     cc $(FLAGS) -c heat.c
pressure.o: pressure.c const.h clim.h; cc $(FLAGS) -c pressure.c
wind.o:     wind.c const.h clim.h;     cc $(FLAGS) -c wind.c
rain.o:     rain.c const.h clim.h;     cc $(FLAGS) -c rain.c
climate.o:  climate.c const.h clim.h;  cc $(FLAGS) -c climate.c

fileio.o:   fileio.c const.h clim.h;   cc $(FLAGS) -c fileio.c
unix.o:     unix.c const.h;            cc $(FLAGS) -c unix.c
x.o:        x.c const.h clim.h;        cc $(FLAGS) -c x.c
