add COPYING and --copyright flag
[greylag.git] / Makefile
blob75245b0051c3bd30b81ad57fbf1f0ad2c0f226d1
1 # Makefile for cgreylag module
3 # $Id$
6 # SWIG is still experiencing rapid development--1.3.28 or better is required.
7 # A reasonably recent g++/libstdc++ may also be required. Python 2.4 or
8 # better is assumed.
10 # Developed (on devel01) with swig 1.3.28, g++ 4.1.2, libstdc++.so.6 (ld 2.16.91)
13 .PHONY: all clean install
14 .DELETE_ON_ERROR:
17 # MARCH = pentium3
18 # MARCH = pentium4
19 # MARCH = prescott
20 # MARCH = opteron
21 MARCH = nocona
24 DEST = /n/site/inst/Linux-i686/bioinfo/greylag/
26 # Generally, this is where the 'Python.h' corresponding to your 'python' lives.
27 #PYTHON_I = /n/site/inst/Linux-i686/sys/include/python2.4
28 PYTHON_I = /usr/include/python2.4
31 # for debugging (extra checking, slow)
32 #CXXFLAGS = -Wall -g3 -O0 -D_GLIBCXX_DEBUG -march=$(MARCH)
34 # for speed (fastest?, fewest checks)
35 CXXFLAGS = -Wall -g3 -O3 -DNDEBUG -ffast-math -mfpmath=sse -march=$(MARCH)
36 #CXXFASTFLAGS = -finline-limit=20000 --param inline-unit-growth=1000 --param large-function-growth=1000
38 # reasonably fast
39 #CXXFLAGS = -Wall -g3 -O2 -ffast-math -mfpmath=sse -march=$(MARCH)
41 SWIGCXXFLAGS = $(CXXFLAGS) -fPIC -I$(PYTHON_I) -fno-strict-aliasing \
42 -Wno-unused-function -Wno-uninitialized
45 MODULE = cgreylag
47 all :: _$(MODULE).so
49 $(MODULE)_wrap.cpp : $(MODULE).i $(MODULE).hpp
50 swig -c++ -python -o $@ $<
52 $(MODULE)_wrap.o : $(MODULE)_wrap.cpp $(MODULE).hpp
53 g++ $(SWIGCXXFLAGS) -c $<
55 $(MODULE).o : $(MODULE).cpp $(MODULE).hpp
56 g++ $(CXXFLAGS) $(CXXFASTFLAGS) -c $<
58 _$(MODULE).so : $(MODULE).o $(MODULE)_wrap.o
59 g++ $(CXXFLAGS) $(CXXFASTFLAGS) -shared $^ -o $@
62 # FIX: we could compile the .py files here
63 install::
64 [ -d $(DEST) ] || install -d $(DEST)
65 install -p _$(MODULE).so $(DEST)
66 install -p --mode=444 $(MODULE).py $(DEST)
67 install -p greylag.py $(DEST)
69 clean::
70 @rm -f $(MODULE).py $(MODULE)_wrap.cpp $(MODULE).o $(MODULE)_wrap.o \
71 _$(MODULE).so *.py[co]