# Static library to be included both in main program an in plugins (.so)

include ../common.mk

PROJECTNAME=libcommon

CXXFLAGS+= -fvisibility=hidden -fPIC

PROGSRC=\
    file.cpp \
    mime.cpp \
    stringutil.cpp \
    tempfile.cpp

SRC=$(PROGSRC)

all: $(PROJECTNAME).a

$(PROJECTNAME).a: $(SRC:.cpp=.o)
	ar rcs $@ $^

%.d: %.cpp
	$(CXX) $(CXXFLAGS) -MM -MP -MF $@ -c $<

%.o: %.cpp %.d
	$(CXX) $(CXXFLAGS) -c $< -o $@

# dependencies

ADD_DEP=Makefile

# misc ---------------------------------------------------
clean:
	-rm -f *.o *.a *.d

.PHONY: clean all install

-include $(wildcard $(SRC:.cpp=.d))