1 # Makefile for cgreylag module
3 # The SWIG Python/STL interface is pretty new, so SWIG 1.3.31 or later is
5 # Python 2.5 or later is required.
6 # A reasonably recent g++/libstdc++ may also be required.
8 # Developed with swig 1.3.31, g++ 3.4.6/4.1.2, libstdc++.so.6
11 .PHONY
: all modsyms
install install_scripts
clean tags check release
15 DEST
= /usr
/local
/lib
/greylag
/
17 PYTHONFLAGS
= $(shell python-config
--include)
19 CXXBASEFLAGS
= -Wall
-Werror
-g3
-fPIC
-pipe
21 # use to add flags from the make command-line
24 # This makes it easy to compile different versions without editing this file.
25 # 0=debug, 2=fast, 3=maybe faster (and less debuggable)
29 # for debugging (extra checking, slow)
30 CXXFLAGS
= $(CXXBASEFLAGS
) -O0
-D_GLIBCXX_DEBUG
34 CXXFLAGS
= $(CXXBASEFLAGS
) -O2
-ffast-math
37 # for speed (fastest?, fewest checks)
38 CXXFLAGS
= $(CXXBASEFLAGS
) -O3
-ffast-math
-DNDEBUG
40 CXXFLAGS
= ---INVALID-SPEED
45 SWIGCXXFLAGS
= $(CXXFLAGS
) $(PYTHONFLAGS
) -fno-strict-aliasing
-Wno-error
51 $(MODULE
)_wrap.
cpp : $(MODULE
).i
$(MODULE
).hpp
52 swig
-c
++ -python
-o
$@
$<
54 $(MODULE
)_wrap.o
: $(MODULE
)_wrap.
cpp $(MODULE
).hpp
55 @echo
"# some warnings possible here (compiling swig output)"
56 $(CXX
) $(SWIGCXXFLAGS
) -c
$<
58 $(MODULE
).o
: $(MODULE
).
cpp $(MODULE
).hpp
59 $(CXX
) $(CXXFLAGS
) $(CXXFASTFLAGS
) -c
$<
61 _
$(MODULE
).so
: $(MODULE
).o
$(MODULE
)_wrap.o
62 $(CXX
) $(CXXFLAGS
) $(CXXFASTFLAGS
) -shared
$^
-o
$@
65 # summary of C++ modules symbols used by main script
67 @sed
-n
-e
's/^.*\(cgreylag\.[a-zA-Z0-9_.]*\).*$$/\1/p' \
72 TAGS
: $(MODULE
).
cpp $(MODULE
).hpp
75 install :: all install_scripts
76 install -p _
$(MODULE
).so
$(DEST
)
77 install -p
--mode
=444 $(MODULE
).py
$(DEST
)
79 # FIX: we could compile the .py files here
81 [ -d
$(DEST
) ] ||
install -d
$(DEST
)
82 install -p
--mode
=444 greylag.py
$(DEST
)
83 install -p greylag_flatten_fasta.py
$(DEST
)/greylag-flatten-fasta
84 install -p greylag_shuffle_database.py
$(DEST
)/greylag-shuffle-database
85 install -p greylag_chase.py
$(DEST
)/greylag-chase
86 install -p greylag_rally.py
$(DEST
)/greylag-rally
87 install -p greylag_merge.py
$(DEST
)/greylag-merge
88 install -p greylag_sqt.py
$(DEST
)/greylag-sqt
89 install -p greylag_validate.py
$(DEST
)/greylag-validate
92 -rm -f
$(MODULE
).py
$(MODULE
)_wrap.
cpp $(MODULE
).o
$(MODULE
)_wrap.o \
93 _
$(MODULE
).so
*.py
[co] TAGS
*~ .??
*~ \
94 test/*.py
[co] test/*.glw
test/*-bad.sqt
test/tmp
* test/*~
97 nosetests
--exe
--with-doctest
$(NOSEFLAGS
)
101 # - bump version number in greylag.py, commit to master branch
102 # - make clean; make; make check
103 # - tag with version number
104 # - publish website (cd doc; make; make publish)
106 # - upload to sourceforge
107 # - push master to public git archive
108 # - announce to greylag-announce
111 @echo
"# did you update VERSION in greylag.py?"
112 git-tag
-l
"v$(VERSION)" || false
# no such tag
113 git-archive
--format
=tar --prefix=greylag-
$(VERSION
)/ v
$(VERSION
) \
114 | gzip
-9 > ..
/greylag-
$(VERSION
).tgz