SHELL = /bin/sh
#CC = /home/dobbs/6/yauli/sun4/bin/g++
CC = g++
RM = /bin/rm -f -r
MV = /bin/mv -f
LINT = lint
ECHO = echo
GREP = egrep
GREPFLAGS = -v
PATTERNS = 'Centerline'
TARGET = fptest 

#----------------------------------------------------------------------#
####files
CFILES = floorplan/SAFloorPlan.cc \
	 floorplan/GDFloorPlan.cc \
	 floorplan/FloorPlan.cc \
	 floorplan/FloorPlan2.cc \
	 floorplan/wire.C \
	 foundation/AssocVec.cc \
	 foundation/BinTree.cc \
	 foundation/DualMap.cc \
	 foundation/Epsilon.cc \
	 foundation/FVector.cc \
	 foundation/Geom.cc \
	 foundation/Graph.cc \
	 foundation/ISet.cc \
	 foundation/Interface.cc foundation/MST.cc \
	 foundation/MemChecker.cc \
	 foundation/RAlgo.cc \
	 foundation/RGen.cc foundation/RMath.cc \
	 foundation/RStd.cc \
	 foundation/RString.cc \
	 foundation/RVector.cc \
	 foundation/RecVector.cc \
	 foundation/RefAdapter.cc foundation/rstd.c
  
MAIN_CFILE = main.cc
OFILES = floorplan/SAFloorPlan.o \
	 floorplan/GDFloorPlan.o \
	 floorplan/FloorPlan.o \
	 floorplan/FloorPlan2.o \
	 floorplan/wire.o \
	 foundation/AssocVec.o \
	 foundation/BinTree.o \
	 foundation/DualMap.o \
	 foundation/Epsilon.o \
	 foundation/FVector.o \
	 foundation/Geom.o \
	 foundation/Graph.o \
	 foundation/ISet.o \
	 foundation/Interface.o \
	 foundation/MST.o \
	 foundation/MemChecker.o \
	 foundation/RAlgo.o \
	 foundation/RGen.o foundation/RMath.o \
	 foundation/RStd.o \
	 foundation/RString.o \
	 foundation/RVector.o \
	 foundation/RecVector.o \
	 foundation/RefAdapter.o
 
MAIN_OFILE = main.o
#----------------------------------------------------------------------#
INCFLAGS = -Ifloorplan/ -Ifoundation/

HFILES =
####clear suffixes first, and then set them
.SUFFIXES:
.SUFFIXES: .C .cc .c .o 

####suffix conversion rules
.C.o: $*.C $*.h
	$(CC) -c  $(CFLAGS) -o $*.o $*.C

.cc.o: $*.cc $*.cct $*.h
	$(CC) -c  $(CFLAGS) -o $*.o $*.cc 

.c.o: $*.c $*.h
	$(CC) -c  $(CFLAGS) -o $*.o $*.c 
CFLAGS = -g -DMAKEMODE='"debug"' $(INCFLAGS) -DPHYSICAL -DPHYSICAL_DEBUG 

#-------------PHYSICAL DEBUG MODE - ASSERTIONS + DEBUGGER INFO------------------#
lzhong:= CFLAGS = -g -DMAKEMODE='"debug"' $(INCFLAGS) -DPHYSICAL
lzhong:= LDFLAGS = -g
lzhong:  $(OFILES) $(MAIN_OFILE)
	$(CC) -o $(TARGET) $(LDFLAGS) $(OFILES) $(MAIN_OFILE) -lm


#----------------------------------------------------------------------#
clean: 
	@$(RM) $(OFILES) $(MAIN_OFILE) $(TARGET) $(PTREPOSITORY)


floorplan/FloorPlan.o: floorplan/FloorPlan.h 
floorplan/FloorPlan2.o: floorplan/FloorPlan.h floorplan/FloorPlan2.h floorplan/wire.h
floorplan/GDFloorPlan.o: floorplan/GDFloorPlan.h
floorplan/SAFloorPlan.o: floorplan/SAFloorPlan.h floorplan/FloorPlan2.h floorplan/FloorPlan.h
