C++11 library providing functionality common to all adapters.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

56 lines
1.4 KiB

# Copyright 2018, pEp Foundation
# This file is part of lib pEp Adapter
# This file may be used under the terms of the GNU General Public License version 3
# see LICENSE.txt
include ../Makefile.conf
SRC_CXX=$(wildcard *.cc)
SRC_C=$(wildcard *.c)
HEADERS=$(wildcard *.hh *.hxx *.h)
OBJ_CXX=$(subst .cc,.o,$(SRC_CXX))
OBJ_C=$(subst .c,.o,$(SRC_C))
OBJECTS=$(OBJ_CXX) $(OBJ_C)
DEPENDS=$(subst .cc,.d,$(SRC_CXX))
CXXFLAGS+= -MMD -MP
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPENDS)
endif
.PHONY: all install uninstall clean
.DEFAULT_GOAL := all
all: libpEpAdapter.a libpEpAdapter.so
ifdef SQLITE3_FROM_OS
OBJECTS := $(filter-out sqlite3.o,$(OBJECTS))
CPPFLAGS+= -DSQLITE3_FROM_OS
LDLIBS+= -lsqlite3
endif
libpEpAdapter.a: $(OBJECTS)
$(AR) -rc $@ $^
libpEpAdapter.so: $(OBJECTS)
ifeq ($(BUILD_ON),OS/390)
$(CC) -W "l,xplink,dll" -W "c,float(ieee),xplink,dll,exportall" -o $@ $^
CPPFLAGS+= -W "l,xplink,dll" -W "c,float(ieee),xplink,dll,exportall"
else ifeq ($(BUILD_ON),Linux)
$(CC) -shared -o $@ $^
endif
clean:
rm -vf $(TARGET) $(OBJECTS) $(DEPENDS)
rm -f *.d.*
install: $(TARGET)
mkdir -p $(PREFIX)/include/pEp
mkdir -p $(LIBDIR)
cp -v $(HEADERS) $(PREFIX)/include/pEp/
cp -v libpEpAdapter.a $(LIBDIR)/
cp -v libpEpAdapter.so $(LIBDIR)/libpEpAdapter.so.0
uninstall:
cd $(PREFIX)/include/pEp && rm -vf $(HEADERS)
cd $(PREFIX)/lib && rm -vf $(TARGET)