# Setup vpath search paths for some suffixes
vpath %.c $(srcdir)
+vpath %.cpp $(srcdir)
vpath %.in $(srcdir)
vpath %.po $(srcdir)
vpath %.exported_symbols $(srcdir)
INSTALL_ROOT_DATA = $(INSTALL) -m 600
INSTALL_SCRIPT = $(INSTALL) -p $(M_INSTALL_PROGRAM)
-.SUFFIXES: .c .d .o .so .a .po .pot .mo .dylib
+.SUFFIXES: .c .cpp .d .o .so .a .po .pot .mo .dylib
WFLAGS += -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings \
-Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
DEPS = $(top_builddir)/make.tmpl $(top_srcdir)/VERSION \
$(top_builddir)/Makefile $(INC_LNS)
-OBJECTS = $(SOURCES:%.c=%.o)
+OBJECTS = $(SOURCES:%.c=%.o) $(CXXSOURCES:%.cpp=%.o)
POTFILES = $(SOURCES:%.c=%.pot)
.PHONY: all pofile distclean clean cleandir cflow device-mapper
%.o: %.c
$(CC) -c $(INCLUDES) $(DEFS) $(WFLAGS) $(CFLAGS) $(CFLAGS_$@) $< -o $@
+%.o: %.cpp
+ $(CXX) -c $(INCLUDES) $(DEFS) $(WFLAGS) $(CXXFLAGS) $(CXXFLAGS_$@) $< -o $@
+
%.pot: %.c Makefile
$(CC) -E $(INCLUDES) -include $(top_builddir)/include/pogen.h \
$(DEFS) $(WFLAGS) $(CFLAGS) $< > $@
ifeq (,$(findstring $(MAKECMDGOALS),cscope.out cflow clean distclean lcov \
help check check_local check_cluster check_lvmetad))
ifdef SOURCES
- -include $(SOURCES:.c=.d)
+ -include $(SOURCES:.c=.d) $(CXXSOURCES:.cpp=.d)
endif
ifdef SOURCES2
-include $(SOURCES2:.c=.d)