pywrap: input: Fix & constructor for GP_Event.
[gfxprim.git] / pywrap.mk
blob4518b712cd9be17b80da34fe6281c938840cfc6f
1 ifndef LIBNAME
2 $(error LIBNAME not defined, fix your library Makefile)
3 endif
5 SWIG_SRC=$(LIBNAME).i
6 SWIG_C=$(LIBNAME)_wrap.c
7 SWIG_PY=c_$(LIBNAME).py
8 SWIG_LIB=_c_$(LIBNAME).so
10 ifdef SWIG
11 ifdef PYTHON_CONFIG
13 INCLUDES+=$(addprefix -I$(TOPDIR)/include/, $(INCLUDE))
15 ALL+=$(SWIG_LIB) $(SWIG_PY)
17 # Empty rule to satisfy SWIG_PY
18 $(SWIG_PY): $(SWIG_C)
21 $(SWIG_C): $(SWIG_SRC)
22 ifdef VERBOSE
23 $(SWIG) $(SWIGOPTS) -python $(INCLUDES) $<
24 else # VERBOSE
25 @echo "SWIG $(LIBNAME)"
26 @$(SWIG) $(SWIGOPTS) -python $(INCLUDES) $<
27 endif # VERBOSE
29 $(SWIG_LIB): $(SWIG_C)
30 ifdef VERBOSE
31 $(CC) $< $(CFLAGS) -D_GNU_SOURCE=1 $(LDFLAGS) -I$(PYTHON_INCLUDE) --shared -lGP $(LDLIBS) -L$(TOPDIR)/build/ -o $@
32 else # VERBOSE
33 @echo "LD $@"
34 @$(CC) $< $(CFLAGS) -D_GNU_SOURCE=1 $(LDFLAGS) -I$(PYTHON_INCLUDE) --shared -lGP $(LDLIBS) -L$(TOPDIR)/build/ -o $@
35 endif # VERBOSE
37 endif # PYTHON_CONFIG
38 endif # SWIG
40 CLEAN+=$(SWIG_C) $(SWIG_PY) $(SWIG_LIB) *.pyc