pylib, demos: Another round of fixes for pyton 3.2
[gfxprim.git] / pywrap.mk
blobd53041e16491aee27803c1f5836280bd151053ad
1 ifndef LIBNAME
2 $(error LIBNAME not defined, fix your library Makefile)
3 endif
5 SWIG_SRC=$(LIBNAME).i
6 SWIG_PY=$(LIBNAME)_c.py
7 SWIG_C=$(LIBNAME)_wrap.c
8 SWIG_LIB=_$(LIBNAME)_c.so
10 include $(TOPDIR)/config.gen.mk
12 ifneq ($(SWIG),)
14 INCLUDES+=$(addprefix -I$(TOPDIR)/include/, $(INCLUDE))
16 ALL+=$(SWIG_LIB) $(SWIG_PY)
18 $(SWIG_C) $(SWIG_PY): $(SWIG_SRC)
19 ifdef VERBOSE
20 $(SWIG) $(SWIGOPTS) -python $(INCLUDES) $<
21 else # VERBOSE
22 @echo "SWIG $(LIBNAME)"
23 @$(SWIG) $(SWIGOPTS) -python $(INCLUDES) $<
24 endif # VERBOSE
26 $(SWIG_LIB): $(SWIG_C)
27 ifdef VERBOSE
28 $(CC) $< $(CFLAGS) $(LDFLAGS) -I$(PYTHON_INCLUDE) --shared -lGP $(LDLIBS) -L$(TOPDIR)/build/ -o $@
29 else # VERBOSE
30 @echo "LD $@"
31 @$(CC) $< $(CFLAGS) $(LDFLAGS) -I$(PYTHON_INCLUDE) --shared -lGP $(LDLIBS) -L$(TOPDIR)/build/ -o $@
32 endif # VERBOSE
34 endif # ifneq ($(SWIG),)
36 CLEAN+=$(SWIG_C) $(SWIG_PY) $(SWIG_LIB) *.pyc