#For sun os
#XINCLUDE=/network/software/packages/X/include
#XLIB=/network/software/packages/X/lib
#CC=		gcc 

#for linux
#XINCLUDE = /usr/X11R6/include
#XLIB =     /usr/X11R6/lib
#CC=        gcc -D__SOLARIS__ -D__LINUX__

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

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

#for solaris
#XINCLUDE = /opt/X11R6/include
#XLIB =     /opt/X11R6/lib
#CC=        gcc -D__SOLARIS__

# #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 = \
        alloc44.o \
	back99.o \
	boxes62.o \
	capara99.o \
	drawb62.o \
	drpara72.o \
	for83.o \
        forint46.o \
	forvar58.o \
        graph08.o \
        g_set30.o \
        in_put15.o \
        learn33.o \
	l_save13.o \
        main84.o \
	misc94.o \
        mtree08.o \
        orbants03.o \
	run94.o \
        vecpost34.o \
        wiring18.o

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

#clean: 
#	rm *.o

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