ifdef NDEBUG
XDLLCCFLAG = -DNDEBUG
endif
ifdef VISIBILITY
XDLLCCFLAG := $(XDLLCCFLAG) -DTESTLIB_DLL -fvisibility=hidden
endif

all: testprg

libtestlib.so: testlib.cpp testlib.hpp
	g++ -o $@ $(XDLLCCFLAG) -fPIC -shared testlib.cpp -lboost_serialization

testprg: testprg.cpp libtestlib.so
	g++ -o $@ testprg.cpp -L. -ltestlib

runtest: testprg
	LD_LIBRARY_PATH=$$PWD ./testprg

clean:
	rm -f testprg libtestlib.so

