#%ARCHIVE = libprof_stopwatch.a
#%DEPENDS = time_stamp posix_compat

CXX = ../../bin/g++w
MAKE_ARCHIVE = ../../bin/make-archive
CHDIR = cd
RM = rm

INCLUDES = -I../time_stamp/include -I../posix_compat/include

CXXFLAGS = -g $(CCXXOPTFLAGS) $(CXXOPTFLAGS) $(INCLUDES) \
	      $(CCXXADDITIONALFLAGS) $(CXXADDITIONALFLAGS)

LDFLAGS = $(LDADDITIONALFLAGS)

LIB_TIME_STAMP = ../time_stamp/libtime_stamp.a


all: libprof_stopwatch.a

library: libprof_stopwatch.a

library-lean: library
	$(RM) -f *.o prof_stopwatch-test

prof_stopwatch-test: prof_stopwatch.cc prof_stopwatch.h
	$(CXX) -o prof_stopwatch-test prof_stopwatch.cc \
	       $(LIB_TIME_STAMP) $(CXXFLAGS) $(LDFLAGS) -DPROF_STOPWATCH_TEST

libprof_stopwatch.a: prof_stopwatch.o
	$(MAKE_ARCHIVE) libprof_stopwatch.a prof_stopwatch.o

$(LIB_TIME_STAMP):
	($(CHDIR) ../time_stamp && $(MAKE) libtime_stamp.a)

clean:
	$(RM) -f *.o libprof_stopwatch.a prof_stopwatch-test

.PHONY: all library library-lean clean

##
prof_stopwatch.o: prof_stopwatch.h prof_stopwatch.cc
