#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 -fsigned-char -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
#XLIB =     /usr/X11R6/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
#OPTFLAGS=	-Wchar-subscripts
#OPTFLAGS=	-Wno-format-zero-length

#OPTFLAGS=	-O1
#for Valgrid
#OPTFLAGS=	-O0 
#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: $(OBJECTS)
	$(CC) $(CFLAGS) $(RFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS) 

#clean: 
#	rm *.o


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