Merged sqt-filter into greylag-validate. This version just does the basic
[greylag.git] / Makefile
blob62d26b67c1638c251fbd63d3369ea5357dab359f
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
11 .DELETE_ON_ERROR:
14 # MARCH = pentium3
15 # MARCH = pentium4
16 # MARCH = prescott
17 # MARCH = opteron
18 MARCH = nocona
21 DEST = /n/site/inst/Linux-x86_64/bioinfo/greylag/
23 PYTHONVER=2.5
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
30 SPEED := 2
32 ifeq ($(SPEED),0)
33 # for debugging (extra checking, slow)
34 CXXFLAGS = $(CXXBASEFLAGS) -O0 -D_GLIBCXX_DEBUG
35 else
36 ifeq ($(SPEED),2)
37 # reasonably fast
38 CXXFLAGS = $(CXXBASEFLAGS) -O2 -ffast-math -mfpmath=sse
39 else
40 ifeq ($(SPEED),3)
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
44 else
45 CXXFLAGS = ---INVALID-SPEED
46 endif
47 endif
48 endif
50 SWIGCXXFLAGS = $(CXXFLAGS) $(PYTHONFLAGS) -fno-strict-aliasing \
51 -Wno-unused-function -Wno-uninitialized
53 MODULE = cgreylag
55 all :: _$(MODULE).so
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 $@
70 pycheck::
71 PYTHONVER=$(PYTHONVER) pychecker --limit 1000 greylag_grind.py
73 # summary C++ modules symbols used by main script
74 modsyms::
75 @sed -n -e 's/^.*\(cgreylag\.[a-zA-Z0-9_.]*\).*$$/\1/p' greylag_grind.py \
76 | sort | uniq -c
78 tags :: TAGS
79 TAGS : $(MODULE).cpp $(MODULE).hpp
80 etags --members $^
82 # FIX: we could compile the .py files here
83 install::
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)/greylag-grind
88 install -p greylag_index_spectra.py $(DEST)/greylag-index-spectra
89 install -p greylag_merge.py $(DEST)/greylag-merge
90 install -p greylag_sqt.py $(DEST)/greylag-sqt
91 install -p greylag_solo.py $(DEST)/greylag-solo
92 install -p greylag_validate.py $(DEST)/greylag-validate
93 @echo "# remember to link 'greylag-python' to your python $(PYTHONVER)"
95 clean::
96 -rm -f $(MODULE).py $(MODULE)_wrap.cpp $(MODULE).o $(MODULE)_wrap.o \
97 _$(MODULE).so *.py[co] test/*.py[co] TAGS *~ .??*~ test/*~ \
98 test/tmp*
100 check::
101 nosetests --exe --with-doctest $(NOSEFLAGS)