# Makefile for plotmmfind tool
# This makefile was adapted from the makefile for 
# ChomboVis, from the ANAG group at LBL

CC          = g++
CFLAGS      = -O3 -Wall
LIB         = -lm

OBJS = validate_args.o \
	smartframelinker.o \
	PlotGetCumTime.o

EXEC = smartframelinker

# In makefiles, the first rule is the default
# Executable composed of all the other object files
smartframelinker: $(OBJS)
	$(CC) $(CFLAGS) -o $(EXEC) $(OBJS) $(LIB)

# Checks command-line arguments
validate_args.o: \
	validate_args.cpp \
	validate_args.h \
	smartframelinker.h 
	$(CC) $(CFLAGS) -c validate_args.cpp

# data structures for plotfiles


PlotGetCumTime.o: \
	PlotGetCumTime.cpp \
	PlotGetCumTime.h \
	smartframelinker.h
	$(CC) $(CFLAGS) -c PlotGetCumTime.cpp

# Contains main()
smartframelinker.o: \
	smartframelinker.h \
	validate_args.h \
	PlotGetCumTime.h \
	smartframelinker.cpp 
	$(CC) $(CFLAGS) -c smartframelinker.cpp  $(INCLUDE) 

# Delete all the objects to the next 'make' creates new copies
clean:
	rm -f $(EXEC)
	rm -f  `find . -name "*.o"`
	echo blah

export:
	rm -f plotmmfind.tar
	rm -Rf plotmmfind
	mkdir plotmmfind
	cp *.cpp plotmmfind/
	cp *.h   plotmmfind/
	cp Makefile plotmmfind/
	cp README.txt plotmmfind
	tar -c plotmmfind -f plotmmfind.tar
	rm -Rf plotmmfind
	make


