summaryrefslogtreecommitdiff
path: root/GNUmakefile.in
diff options
context:
space:
mode:
Diffstat (limited to 'GNUmakefile.in')
-rw-r--r--GNUmakefile.in155
1 files changed, 155 insertions, 0 deletions
diff --git a/GNUmakefile.in b/GNUmakefile.in
new file mode 100644
index 0000000..1f38136
--- /dev/null
+++ b/GNUmakefile.in
@@ -0,0 +1,155 @@
+## -*- makefile -*-
+
+ifneq (,)
+This makefile requires GNU Make.
+endif
+
+VPATH := @srcdir@
+
+PACKAGE := @PACKAGE@
+VERSION := @VERSION@
+
+STATIC_EXAMPLES := pyhello.py testtk.py
+EXAMPLES := $(addprefix docs/examples/, env.sh)
+DOCS := $(addprefix docs/html/, index.html ivycpy_wrap.html)
+
+DEFINES := @DEFINES@
+INCLUDES := @INCLUDES@
+LIBRARIES := @LIBRARIES@
+
+prefix := @prefix@
+exec_prefix := @exec_prefix@
+datadir := @datadir@
+includedir := @includedir@
+libdir := @libdir@
+bindir := @bindir@
+mandir := @mandir@
+infodir := @infodir@
+pyexecdir := @pyexecdir@
+pythondir := @pythondir@
+
+PKGEXAMPLESDIR := $(datadir)/$(PACKAGE)-$(VERSION)/examples
+PKGDOCDIR := $(datadir)/$(PACKAGE)-$(VERSION)/docs
+
+MKDIR := mkdir -p
+RMDIR := rmdir -p
+
+LN_S := @LN_S@ -f
+
+ARFLAGS := r
+
+RANLIB := @RANLIB@
+
+INSTALL := @INSTALL@
+INSTALL_PROGRAM := @INSTALL_PROGRAM@
+INSTALL_SCRIPT := @INSTALL_SCRIPT@
+INSTALL_DATA := @INSTALL_DATA@
+
+UMASK ?= 022
+
+INSTALL_DIR := $(SHELL) $(top_srcdir)/mkinstalldirs
+INSTALL_DIR := $(INSTALL) -d
+INSTALL_DIR := umask $(UMASK) && mkdirhier
+INSTALL_DIR := umask $(UMASK) && $(MKDIR)
+
+SWIG := @SWIG@
+
+CC := gcc
+
+CC_WARNING_OPTIONS := -Wall
+CC_PIC_OPTIONS := -fPIC
+CC_SHARED_OPTIONS := -shared
+
+CC_OPTIONS := $(CC_WARNING_OPTIONS)
+
+ifdef DEBUG
+CC_OPTIONS += -g
+DEFINES += -D__DEBUG__
+else
+DEFINES += -DNDEBUG
+endif
+
+CPPFLAGS = $(DEFINES) $(INCLUDES) @DEFS@ @CPPFLAGS@
+CFLAGS = @CFLAGS@ $(CC_OPTIONS)
+LDFLAGS = @LDFLAGS@ $(LD_OPTIONS)
+LDLIBS = $(LIBRARIES) @LIBS@
+
+default: ivycpy.so $(DOCS) $(EXAMPLES)
+
+ivycpy.so: ivycpy_wrap_neat.o @PYTHON_LIBDIR@/python@PYTHON_VERSION@/lib-dynload/_tkinter.so
+ $(LINK.o) $(CC_SHARED_OPTIONS) $^ -o $@ -livy $(LDLIBS) -lc
+
+ivycpy_wrap_neat.o: CFLAGS += $(CC_PIC_OPTIONS)
+ivycpy_wrap_neat.o: ivycpy_wrap_neat.c
+
+# true or neat wrapper with proper name for function
+ivycpy_wrap_neat.c: ivycpy_wrap.c
+ >$@ sed -f ivycpy_namer.sed $<
+
+# wrapper code generated by swig
+ivycpy_wrap.c: ivycpy.i
+ $(SWIG) -python -dhtml $<
+
+# testing include and defines
+
+ivycpy_test.e: ivycpy_test.c
+ >|$@ $(CC) -E $(CPPFLAGS) $<
+
+# documentation
+
+docs/html/ivycpy_wrap.html: ivycpy_wrap.html
+ >|$@ sed -e "s/<B>pyIvy/<B>Ivy/g" $<
+
+docs/html/index.html: docs/html/index_tpl.html
+ >|$@ sed -e "s/_VERSION_/$(VERSION)/g" $<
+
+VERSION:
+ printf '# generated dynamically do not edit; change VERSION in configure.in instead\n' >|$@
+ printf '$$Id$$\n' $(VERSION) >|$@
+
+# misc
+docs/examples/env.sh: env_tpl.sh
+ >|$@ sed -e "s|_IVYCPYPATH_|$(pythondir)|g" $<
+
+install:: ivycpy.so
+ $(INSTALL_DIR) $(pythondir)
+ $(INSTALL_DATA) $< $(pythondir)
+
+install:: $(DOCS)
+ $(INSTALL_DIR) $(PKGDOCDIR)
+ cp -rp docs/* $(PKGDOCDIR)
+
+.PHONY: default install VERSION
+
+clean:
+ $(RM) core a.out *.o
+ $(RM) ivycpy.so
+
+realclean: clean
+ $(RM) ivycpy_wrap*.c
+ $(RM) $(EXAMPLES)
+
+distclean: realclean
+ $(RM) ivycpy_wrap*.*
+ $(RM) GNUmakefile config.log config.status config.cache
+
+.PHONY: clean realclean distclean
+
+GNUmakefile:: GNUmakefile.in
+ CONFIG_FILES=GNUmakefile ./config.status
+
+GNUmakefile:: ./config.status
+ ./config.status
+
+config.status: @top_srcdir@/configure
+ ./config.status --recheck
+
+@top_srcdir@/configure: @top_srcdir@/configure.in
+ cd @top_srcdir@ && autoconf
+
+recheck:
+ ./config.status --recheck && ./config.status
+
+.PHONY: recheck
+
+## [END OF FILE]