#
#  xplot: the program: written by Matt Wilson. 
#         *heavily* modified and ANSI-fied by Mike Vanier.
#

# Linux
CC          = gcc 
CFLAGS      = -O -Wall -ansi -pedantic -Wstrict-prototypes -DSYSV
LIBS        = -lX11 -lm -L/usr/X11R6/lib
INCLUDES    = -I/usr/X11R6/include 
INSTALLDIR  = /usr/local/bin

# Solaris with Sun C compiler
#CC          = cc 
#CFLAGS      = -DSYSV -DSolaris -fast
#LIBS        = -lX11 -lm -L/usr/openwin/lib
#INCLUDES    = -I/usr/openwin/include 
#INSTALLDIR  = /usr/local/bin

OBJECTS = \
    arg.o          \
    axis.o         \
    buttons.o      \
    color.o        \
    command.o      \
    event_loop.o   \
    graph.o        \
    init.o         \
    keys.o         \
    label.o        \
    load.o         \
    main.o         \
    primitives.o   \
    psdriver.o     \
    save.o         \
    save2.o        \
    scale.o        \
    text.o         \
    tick.o

.c.o:
	$(CC) $(CFLAGS) $(INCLUDES) -c $<

default: xplot

xplot: $(OBJECTS)
	$(CC) $(CFLAGS) $(OBJECTS) -o $@ $(LIBS)


install:
	strip xplot
	cp xplot $(INSTALLDIR)


clean:
	-rm -f *.o xplot
	-if [ -f make.out ]; then rm make.out; fi

