# Makefile for partiview - please do not edit if the file is named "Makefile",
# since configure would overwrite it on the next configure. Edit "Makefile.in"
# instead!!!

# the following variables are under AC control
# KIRA_INC, KIRA_LIB
# FLTK_INC, FLTK_LIB
# PV_FLAGS

SHELL = /bin/sh

# TARGET
TARGET   = partiview

#	Override with --with-fltk=
FLTK_INC   = @FLTK_INC@
FLTK_LIB   = @FLTK_LIB@

#KIRA_INC = -I$(STARLAB_PATH)/src/node/dyn/tdyn
#KIRA_LIB = -L${STARLAB_PATH)/lib

#  AC variables KIRA_INC and KIRA_LIB automatically created
#  if $STARLAB_PATH present; override with --with-kira=
KIRA_INC = @KIRA_INC@
KIRA_LIB = @KIRA_LIB@

#GL_LIB   = -L/usr/local/lib/Mesa -lGL -lGLU
GL_LIB   = @GLLIBS@
X_LIB    = @XLIBS@
M_LIB    = -lm

# FLAGS and BINARIES
PV_FLAGS    = @PV_FLAGS@
DEFS	    = -DNOCAVE -Dunix $(PV_FLAGS) ## -DUSE_KIRA ## -DUSE_IEEEIO
INCL	    = ${FLTK_INC} -I/usr/X11R6/include $(KIRA_INC)
CC          = @CC@
CFLAGS      = ${OPT} ${DEFS} ${INCL}
CXX	    = @CXX@
CXXFLAGS    = ${CFLAGS} 
## OTYPE    = -n32 -mips3
#OPT        = -g3 -Ofast ${OTYPE}
OPT         = -g -O2 ${OTYPE}
LINK        = ${CXX}
LIBS        = ${KIRA_LIB} ${FLTK_LIB} ${GL_LIB} ${X_LIB} ${M_LIB}

APP_CSRCS   = geometry.c partibrains.c mgtexture.c textures.c findfile.c sfont.c
APP_CXXSRCS = partiview.cc partiviewc.cc partipanel.cc Gview.cc Hist.cc # parti-ieee.cc

APP_OBJS    = partiview.o partiviewc.o partipanel.o Gview.o Hist.o \
		geometry.o partibrains.o \
		mgtexture.o textures.o futil.o findfile.o sfont.o ${MORE}

all:	$(TARGET)

help:
	@echo  Partiview
	@echo  

clean:
	rm -f *.o core Makedepend $(TARGET)
	touch Makedepend

cleanall: clean
	rm -f Makefile config.log config.status config.h config.cache

$(TARGET):  $(APP_OBJS)
	$(CXX) -o $@ $(OPT)  $(APP_OBJS) $(LIBS)

ptest:  ptest.o
	$(CXX) -o $@ $(OPT) ptest.o $(LIBS)

dometest:  dometest.o geometry.o
	$(CXX) -o $@ $(OPT) dometest.o geometry.o $(LIBS)


.PHONEY: depend

# dep: depend
# depend:	_always

depend:
	rm -f Makedepend
	${CC} -M ${CFLAGS} ${APP_CSRCS} > Makedepend
	${CXX} -M ${CXXFLAGS} ${APP_CXXSRCS} >> Makedepend

_always:

include Makedepend
