File: Makefile

package info (click to toggle)
python2.2-libplot 1.0.2-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 100 kB
  • ctags: 182
  • sloc: ansic: 372; python: 178; makefile: 72; sh: 3
file content (45 lines) | stat: -rw-r--r-- 1,117 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

PYTHON		= /usr/bin/python2.2
pyprefix	= $(shell $(PYTHON) -c 'import sys; print sys.prefix')
pyversion	= $(shell $(PYTHON) -c 'import sys; print sys.version[:3]')
pysitepkgs	= $(pyprefix)/lib/python$(pyversion)/site-packages/

PL_VER		= 4.1
TARGETS		= libplot.py libplot.pyc _libplot.so

CC		= gcc
CFLAGS		= -Wall -fPIC
CPPFLAGS	= -I$(pyprefix)/include/python$(pyversion) -I/usr/local/include
LDFLAGS		= -L/usr/local/lib -lplot -L/usr/X11R6/lib \
		  -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11 -lm
SWIG		= /usr/bin/swig
SWIGFLAGS	= -dnone -python

.PHONY: all install uninstall clean

all: $(TARGETS)

install: $(TARGETS)
	[ -d $(pysitepkgs) ] && mv $^ $(pysitepkgs)

uninstall:
	cd $(pysitepkgs) && rm $(TARGETS)

clean:
	-rm *.o *.so *.pyc _* $(TARGETS)

_libplot.i libplot.py: plot-$(PL_VER).h make_interfaces.py
	./make_interfaces.py $(PL_VER)

libplot.pyc: libplot.py
	$(PYTHON) -c "import py_compile; py_compile.compile('$<')"

_libplot_wrap.c: _libplot.i
	$(SWIG) $(SWIGFLAGS) $<

_libplot.o: _libplot_wrap.c
	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<

_libplot.so: _libplot.o
	$(CC) -shared -o $@ $^ $(LDFLAGS)