
OBJS=SMPDataFlowAnalysis.o   SMPInstr.o   SMPBasicBlock.o   \
	SMPFunction.o   SMPProgram.o   SMPDBInterface.o ProfilerInformation.o
CXX=@CXX@
LD=@LD@
EXTRA_CXXFLAGS=@EXTRA_CXXFLAGS@
STARS_HOME=@STARS_HOME@
LIB=$(STARS_HOME)/lib/libbase.a

all: $(OBJS)

# pull in dependency info for *existing* .o files
-include $(OBJS:.o=.d)

%.o: %.cpp
	$(CXX) -c  $(EXTRA_CXXFLAGS) $*.cpp 
	$(AR) -r $(LIB) $*.o
	@#
	@# build dependencies --  http://scottmcpeak.com/autodepend/autodepend.html
	@#
	$(CXX) -MM $(EXTRA_CXXFLAGS) $*.cpp > $*.d
	@cp -f $*.d $*.d.tmp
	@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
	@rm -f $*.d.tmp

%.i: %.cpp
	$(CXX) -E  $(EXTRA_CXXFLAGS) $*.cpp  -o $@


clean:  
	rm -f $(OBJS) *.d

