-
Notifications
You must be signed in to change notification settings - Fork 107
/
Copy pathMakefile
45 lines (32 loc) · 1.29 KB
/
Makefile
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
#
# Makefile for compilation of SNAP Python from SWIG output
#
SNAPVER = 2.x
# set the path to your SNAP directory here
#SNAPROOT = ../Snap-$(SNAPVER)
SNAPROOT = ../../snap
SNAPDIR = $(SNAPROOT)/$(SNAP)
GLIBDIR = $(SNAPROOT)/$(GLIB)
SWIGDIR = ../swig
# include compilation parameters
include $(SNAPROOT)/Makefile.config
include ../Makefile.config
all: _snap.so
snap_wrap.o: snap_wrap.cxx
@if [ -r Version ] && ! diff Version $(SNAPROOT)/Version >/dev/null ; then echo "*** Error: SNAP versions do not match"; exit 1; fi
g++ $(CXXFLAGS) -c snap_wrap.cxx -I$(SWIGDIR) -I$(SNAPDIR) -I$(GLIBDIR) -I/usr/include/python2.6 -I/usr/include/python2.7
Snap.o:
@if [ -r Version ] && ! diff Version $(SNAPROOT)/Version >/dev/null ; then echo "*** Error: SNAP versions do not match"; exit 1; fi
$(CC) $(CXXFLAGS) -c $(SNAPDIR)/Snap.cpp -I$(SNAPDIR) -I$(GLIBDIR)
_snap.so: snap_wrap.o Snap.o
g++ $(LDFLAGS) $(CXXFLAGS) snap_wrap.o Snap.o $(LIBS) -o _snap.so
snap.py: snap_wrap.cxx
install: setup.py snap.py _snap.so
sudo python setup.py install
dist: setup.py snap.py _snap.so
python setup.py sdist
build:
swig -python -c++ -w302,312,317,325,362,383,384,389,401,503,508,509 -O -D_CMPWARN -outcurrentdir -I$(SWIGDIR) -I$(SNAPDIR) -I$(GLIBDIR) $(SWIGDIR)/snap.i
cp $(SNAPROOT)/Version .
clean:
rm -f *.o _*.so *.pyc