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
58 $(MODULE
)_wrap.
cpp : $(MODULE
).i
$(MODULE
).hpp
59 swig
-c
++ -python
-o
$@
$<
61 $(MODULE
)_wrap.o
: $(MODULE
)_wrap.
cpp $(MODULE
).hpp
62 g
++ $(SWIGCXXFLAGS
) -c
$<
64 $(MODULE
).o
: $(MODULE
).
cpp $(MODULE
).hpp
65 g
++ $(CXXFLAGS
) $(CXXFASTFLAGS
) -c
$<
67 _
$(MODULE
).so
: $(MODULE
).o
$(MODULE
)_wrap.o
68 g
++ $(CXXFLAGS
) $(CXXFASTFLAGS
) -shared
$^
-o
$@
72 PYTHONVER
=$(PYTHONVER
) pychecker
--limit
1000 $(PROGRAM
).py
74 # summary C++ modules symbols used by main script
76 @sed
-n
-e
's/^.*\(cgreylag\.[a-zA-Z0-9_.]*\).*$$/\1/p' $(PROGRAM
).py \
80 TAGS
: $(MODULE
).
cpp $(MODULE
).hpp
83 # FIX: we could compile the .py files here
85 [ -d
$(DEST
) ] ||
install -d
$(DEST
)
86 install -p _
$(MODULE
).so
$(DEST
)
87 install -p
--mode
=444 $(MODULE
).py
$(DEST
)
88 install -p
$(PROGRAM
).py
$(DEST
)
89 install -p
$(PROGRAM
)-mp.py
$(DEST
)
92 -rm -f
$(MODULE
).py
$(MODULE
)_wrap.
cpp $(MODULE
).o
$(MODULE
)_wrap.o \
93 _
$(MODULE
).so
*.py
[co] test/*.py
[co] TAGS
*~ .??
*~
test/*~ \
97 nosetests
--exe
--with-doctest
$(NOSEFLAGS
)