1 # Makefile for cgreylag module
3 # SWIG is still experiencing rapid development--1.3.31 or later is required.
4 # Python 2.5 or later is required.
5 # A reasonably recent g++/libstdc++ may also be required.
7 # Developed with swig 1.3.31, g++ 3.4.6/4.1.2, libstdc++.so.6
10 .PHONY
: all pycheck modsyms
install clean tags check
21 DEST
= /n
/site
/inst
/Linux-i686
/bioinfo
/greylag
/
24 PYTHONFLAGS
= $(shell python
$(PYTHONVER
)-config
--include)
26 CXXBASEFLAGS
= -Wall
-g3
-march
=$(MARCH
) -fPIC
28 # This makes it easy to compile different versions without editing this file.
29 # 0=debug, 2=fast, 3=faster and less safe
33 # for debugging (extra checking, slow)
34 CXXFLAGS
= $(CXXBASEFLAGS
) -O0
-D_GLIBCXX_DEBUG
38 CXXFLAGS
= $(CXXBASEFLAGS
) -O2
-ffast-math
-mfpmath
=sse
41 # for speed (fastest?, fewest checks)
42 CXXFLAGS
= $(CXXBASEFLAGS
) -O3
-DNDEBUG
-ffast-math
-mfpmath
=sse
43 #CXXFASTFLAGS = -finline-limit=20000 --param inline-unit-growth=1000 --param large-function-growth=1000
45 CXXFLAGS
= ---INVALID-SPEED
50 SWIGCXXFLAGS
= $(CXXFLAGS
) $(PYTHONFLAGS
) -fno-strict-aliasing \
51 -Wno-unused-function
-Wno-uninitialized
57 $(MODULE
)_wrap.
cpp : $(MODULE
).i
$(MODULE
).hpp
58 swig
-c
++ -python
-o
$@
$<
60 $(MODULE
)_wrap.o
: $(MODULE
)_wrap.
cpp $(MODULE
).hpp
61 g
++ $(SWIGCXXFLAGS
) -c
$<
63 $(MODULE
).o
: $(MODULE
).
cpp $(MODULE
).hpp
64 g
++ $(CXXFLAGS
) $(CXXFASTFLAGS
) -c
$<
66 _
$(MODULE
).so
: $(MODULE
).o
$(MODULE
)_wrap.o
67 g
++ $(CXXFLAGS
) $(CXXFASTFLAGS
) -shared
$^
-o
$@
71 PYTHONVER
=$(PYTHONVER
) pychecker
--limit
1000 greylag-grind.py
73 # summary C++ modules symbols used by main script
75 @sed
-n
-e
's/^.*\(cgreylag\.[a-zA-Z0-9_.]*\).*$$/\1/p' greylag-grind.py \
79 TAGS
: $(MODULE
).
cpp $(MODULE
).hpp
82 # FIX: we could compile the .py files here
84 [ -d
$(DEST
) ] ||
install -d
$(DEST
)
85 install -p _
$(MODULE
).so
$(DEST
)
86 install -p
--mode
=444 $(MODULE
).py
$(DEST
)
87 install -p greylag-grind.py
$(DEST
)
88 install -p greylag-mp.py
$(DEST
)
91 -rm -f
$(MODULE
).py
$(MODULE
)_wrap.
cpp $(MODULE
).o
$(MODULE
)_wrap.o \
92 _
$(MODULE
).so
*.py
[co] test/*.py
[co] TAGS
*~ .??
*~
test/*~ \
96 nosetests
--exe
--with-doctest
$(NOSEFLAGS
)