#for linux and unix (sun stopped working at COGS)
#XINCLUDE = /usr/X11R6/include
#XLIB =     /usr/X11R6/lib
# -g for line number with valgrid (debugging symbols) slower!!
#CC=        gcc -g -D__SOLARIS__ -D__LINUX__
#CC=        gcc -D__SOLARIS__ -D__LINUX__

#for Cygwin
#CC=        gcc -D__SOLARIS__ -D__LINUX__ -D__CYGWIN__

#for OSX + X11 (Mac)
#XINCLUDE = /usr/X11R6/include
XINCLUDE = /opt/X11/include
#XLIB =     /usr/X11R6/lib
XLIB = /opt/X11/lib
CC=        cc -D__LINUX__ -D__DARWIN__ -D__UNIX__ 

# #for irix 6.5.x
# XINCLUDE =  /usr/include/X11
# XLIB =      /usr/lib/X11
# CC=         cc -D__IRIX__


#debug, with warnings
#OPTFLAGS=	-g -Wall 
#debug, with errors only
#OPTFLAGS=	-g 
#smallest code, no warnings
OPTFLAGS=	-O3
#smallest code with warnings#
#OPTFLAGS=	-O3 -Wall

# #with warnings (irix 6.5.x)
# #uncomment either O32FLAGS or N32FLAGS, and the desired corresponding OPTFLAGS
# #O32FLAGS=	-o32 -signed -Wl,-wall 
# N32FLAGS=	-n32 -signed -Wl,-wall
# #OPTFLAGS=	$(O32FLAGS) -g -fullwarn
# #OPTFLAGS=	$(N32FLAGS) -g -fullwarn
# #errors only
# #OPTFLAGS=	$(O32FLAGS) -g
# #OPTFLAGS=	$(N32FLAGS) -g
# #smallest code
# #OPTFLAGS=	$(O32FLAGS) -O2 -Olimit 1700
# OPTFLAGS=	$(N32FLAGS) -O2 -OPT:Olimit=0

#include XLib etc
CFLAGS=		$(OPTFLAGS) -I$(XINCLUDE)

#sun
#LDFLAGS= -L$(XLIB) -L/opt/SUNWspro/lib -L/usr/local/lib
#LIBS=	  -lX11 -lnsl -lsocket -lm -lsunmath
#RFLAGS=  -R$(XLIB) -R/opt/SUNWspro/lib -R/usr/local/lib

#linux
#LDFLAGS=  -L$(XLIB) -L/opt/SUNWspro/lib

#for OSX + X11 (Mac)
LDFLAGS=  -L$(XLIB) 
RFLAGS=

LIBS=     -lX11 -lm

# #irix 6.5.x
# LDFLAGS=   -L$(XLIB)
# RFLAGS=
# LIBS=      -lX11 -lm

OBJECTS = \
        alloc40.o \
	back88.o \
	boxes61.o \
	capara56.o \
	drawb57.o \
	drpara48.o \
	for60.o \
        forint13.o \
	forvar23.o \
        graph56.o \
        g_set26.o \
        in_put11.o \
        learn33.o \
	l_save09.o \
        main74.o \
	misc38.o \
        mtree08.o \
        orbants03.o \
	run85.o \
        vecpost31.o \
        wiring10.o

ddlabz04: $(OBJECTS)
	$(CC) $(CFLAGS) $(RFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)

#clean: 
#	rm *.o

#  "-static" links in the libraries making 
#  a bigger executable