Browse Source

Build system and so

David Lanzendörfer 9 months ago
parent
commit
7f93f76647
2 changed files with 23 additions and 18 deletions
  1. +12
    -1
      Makefile.conf
  2. +11
    -17
      src/Makefile

+ 12
- 1
Makefile.conf View File

@ -5,7 +5,18 @@
HERE:=$(dir $(lastword $(MAKEFILE_LIST)))
TARGET=libpEpAdapter.a
BUILD_ON:=$(shell uname)
ifeq ($(BUILD_ON),OS/390)
TARGETS=libpEpAdapter.a libpEpAdapter.so
SO_CFLAGS = -W "l,xplink,dll" -W "c,float(ieee),xplink,dll,exportall"
CPPFLAGS += -W "l,xplink,dll" -W "c,float(ieee),xplink,dll,exportall"
else ifeq ($(BUILD_ON),Linux)
TARGETS=libpEpAdapter.a libpEpAdapter.so
SO_CFLAGS = -shared
else
TARGETS=libpEpAdapter.a
endif
# Build config
# Defaults


+ 11
- 17
src/Makefile View File

@ -15,42 +15,36 @@ DEPENDS=$(subst .cc,.d,$(SRC_CXX))
CXXFLAGS+= -MMD -MP
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPENDS)
-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
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
$(CXX) $(SO_CFLAGS) -o $@ $^ $(LDLIBS) -lpEpEngine -lpEpMIME -lsequoia_ffi -lsequoia_openpgp_ffi
all: $(TARGETS)
clean:
rm -vf $(TARGET) $(OBJECTS) $(DEPENDS)
rm -vf $(TARGETS) $(OBJECTS) $(DEPENDS)
rm -f *.d.*
install: libpEpAdapter.a libpEpAdapter.so
install: $(TARGETS)
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
cp -v $(TARGETS) $(LIBDIR)/
uninstall:
cd $(PREFIX)/include/pEp && rm -vf $(HEADERS)
cd $(PREFIX)/lib && rm -vf $(TARGET)
cd $(LIBDIR) && rm -vf $(TARGET)

Loading…
Cancel
Save