#
# File: Makefile
# Author: David Meyers,
#         K.R. Sloan
# Last Modified: 7 November 1990
# Purpose: maintain DrawContours application

ARCH = SS1

BASE = /wa/Contours

SGP = /wa/SGP
WFF = /wa/wff

DEST = ${BASE}/${ARCH}bin

SOURCE =  ../Contours.c ../InputStuff.c \
	  ../ParsingFunctions.c DrawContours.c

OBJECTS = Contours.o InputStuff.o \
	  ParsingFunctions.o

PROGRAMS = DrawContours XDrawContours

all: ${PROGRAMS}

INCLUDE = -I../../include  -I${SGP}/include

CFLAGS  =-g ${INCLUDE}

# for devW
LW = ${WFF}/${ARCH}bin/wff.o -lm

# for devX
LX = -lX11 -lm

# for all others
L = -lm

LIBX  = ${SGP}/src/libSGP.${ARCH}.a ${SGP}/src/devX/libDEVICE.${ARCH}.a
LIBW  = ${SGP}/src/libSGP.${ARCH}.a ${SGP}/src/devW/libDEVICE.${ARCH}.a


DrawContours: DrawContours.c ${LIBW} ${OBJECTS}
	cc -o DrawContours ${CFLAGS} DrawContours.c \
           -DPREVIEW=0 -DMAXTRIANGLES=32752 ${LIBW} ${LW} ${OBJECTS}

XDrawContours: DrawContours.c ${LIBX} ${OBJECTS}
	cc -o XDrawContours ${CFLAGS} DrawContours.c \
            -DPREVIEW=1 -DMAXTRIANGLES=32752 ${LIBX} ${LX} ${OBJECTS}

Contours.o: ../Contours.c
	cc -c ${CFLAGS} ../Contours.c

InputStuff.o: ../InputStuff.c
	cc -c ${CFLAGS} ../InputStuff.c

ParsingFunctions.o: ../ParsingFunctions.c
	cc -c ${CFLAGS} ../ParsingFunctions.c

lint :
	lint  ${INCLUDE} ${SOURCE} -lc

install :${PROGRAMS}
	mv ${PROGRAMS} ${DEST}
	(cd ${DEST}; chmod a+rx ${PROGRAMS})
	ls -l ${DEST}

clean :
	rm -f *.o *~ a.out core
	ls -l
