From 42875df7c3b19b8bed5da2b3d1b7eb81804c9dc9 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Thu, 25 Aug 2022 05:23:20 +0200 Subject: [PATCH] src/python: provide a default Makefile This should help fix "make distcheck". --- src/python/Makefile | 56 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/python/Makefile diff --git a/src/python/Makefile b/src/python/Makefile new file mode 100644 index 0000000..a95aaa4 --- /dev/null +++ b/src/python/Makefile @@ -0,0 +1,56 @@ +OBJDIR = +PREFIX = /usr/local +DESTDIR = +MKDIR = mkdir -m 0755 -p +INSTALL = install +RM = rm -f +TARGETS = $(OBJDIR)_libDatabase$(SOEXT) +LIBDIR = $(PREFIX)/lib +CC = cc +CPPFLAGSF= +CPPFLAGS= +CFLAGSF = `pkg-config --cflags python-2.7 libSystem` -fPIC +CFLAGS = -W -Wall -g -O2 -pedantic -D_FORTIFY_SOURCE=2 -fstack-protector-all +LDFLAGSF= `pkg-config --libs python-2.7 libSystem` -lDatabase +LDFLAGS = -L$(OBJDIR).. -Wl,-rpath,$(LIBDIR) +EXEEXT = +AR = ar +ARFLAGS = -rc +RANLIB = ranlib +CCSHARED= $(CC) -shared +SOEXT = .so +RM = rm -f +LN = ln -f +MKDIR = mkdir -m 0755 -p +INSTALL = install + + +all: $(TARGETS) + +_libDatabase_OBJS = $(OBJDIR)libDatabase.o +_libDatabase_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) +_libDatabase_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) + +$(OBJDIR)_libDatabase$(SOEXT): $(_libDatabase_OBJS) + $(CCSHARED) -o $(OBJDIR)_libDatabase$(SOEXT) $(_libDatabase_OBJS) $(_libDatabase_LDFLAGS) + +$(OBJDIR)libDatabase.o: libDatabase.c + $(CC) $(_libDatabase_CFLAGS) -o $(OBJDIR)libDatabase.o -c libDatabase.c + +clean: + $(RM) -- $(_libDatabase_OBJS) + +distclean: clean + $(RM) -- $(TARGETS) + +install: all + $(MKDIR) $(DESTDIR)$(PREFIX)/lib/python2.7/site-packages + $(INSTALL) -m 0755 $(OBJDIR)_libDatabase$(SOEXT) $(DESTDIR)$(PREFIX)/lib/python2.7/site-packages/_libDatabase$(SOEXT) + $(MKDIR) $(DESTDIR)$(PREFIX)/lib/python2.7/site-packages + $(INSTALL) -m 0644 libDatabase.py $(DESTDIR)$(PREFIX)/lib/python2.7/site-packages/libDatabase.py + +uninstall: + $(RM) -- $(DESTDIR)$(PREFIX)/lib/python2.7/site-packages/_libDatabase$(SOEXT) + $(RM) -- $(DESTDIR)$(PREFIX)/lib/python2.7/site-packages/libDatabase.py + +.PHONY: all clean distclean install uninstall