
###############################################################################
# MODULE     : Make file for plugin example
# COPYRIGHT  : (C) 1999-2008  Joris van der Hoeven
###############################################################################
# This software falls under the GNU general public license version 3 or later.
# It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
# in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
###############################################################################

CXX = g++
LD = g++
RM = rm -f
MKDIR_P = mkdir -p
RMDIR = rmdir --i

FILES_CPP := $(wildcard src/*.cpp)
FILES_LIB := $(patsubst src/%.cpp,lib/libtm%.so,$(FILES_CPP))

all: $(FILES_LIB)

lib/libtm%.so : src/%.cpp | lib
	$(LD) -shared $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $< -o $@ $(LIBADD)

lib:
	$(MKDIR_P) $@

clean:
	$(RM) *~
	$(RM) */*~
	$(RM) lib/*
	test -d lib && $(RMDIR) lib || true
