Skip to content

Commit

Permalink
src/python: provide a default Makefile
Browse files Browse the repository at this point in the history
This should help fix "make distcheck".
  • Loading branch information
khorben committed Aug 25, 2022
1 parent c23d86b commit 42875df
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions src/python/Makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 42875df

Please sign in to comment.