##   This file is part of PeerHood.
##
##   PeerHood is free software: you can redistribute it and/or modify
##   it under the terms of the GNU Lesser General Public License 
##   version 2 as published by the Free Software Foundation.
##
##   PeerHood is distributed in the hope that it will be useful,
##   but WITHOUT ANY WARRANTY; without even the implied warranty of
##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##   GNU Lesser General Public License for more details.
##
##   You should have received a copy of the GNU Lesser General Public
##   License along with PeerHood. If not, see <http://www.gnu.org/licenses/>.
##

## libpeerhood/ Makefile
## * so library version numbers are forgotten as this phase as peerhood
##   does not have a version yet

# TODO: Make specific public include file list, not all includes are public.

## 1. common defines
include ../MakeCommonDefs.mk

## 2. own defines
MODULE = libpeerhood
MODULEDIR = $(BUILDDIR)/$(MODULE)
SRCS = $(wildcard *.cc)
OBJS = $(addprefix $(MODULEDIR)/, $(SRCS:%.cc=%.o))
INCS = $(wildcard *.h)
# public includes
PINCS = $(addprefix $(resultincludedir)/,$(INCS))
LDFLAGS = $(PTHREAD.lib)
libname = libpeerhood.so
libpeerhood = $(resultlibdir)/$(libname) 
LIBRARY = $(libpeerhood)
LDFLAGS += $(DBUS.lib)
CPPFLAGS += `pkg-config --cflags dbus-glib-1`


## 3. common rules
include ../MakeCommonRules.mk

## 4. own rules
build-pre:: $(PINCS)

build-do:: $(libpeerhood)

clean-do::
	rm -f $(OBJS) $(PINCS) $(LIBRARY)

$(LIBRARY): $(OBJS)
	$(MKDIR) $(dir $@)
	$(CXX) $(LDFLAGS) -shared -Wl,-soname,$(libname) -o $@ $(OBJS)





