File: Makefile

package info (click to toggle)
pyepl 1.1.0-3.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,120 kB
  • sloc: cpp: 7,986; python: 6,026; makefile: 360; ansic: 132
file content (56 lines) | stat: -rw-r--r-- 1,843 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# PyEPL: hardware/eeg/pulse/Makefile
#
# Copyright (C) 2003-2005 Michael J. Kahana
# Authors: Ian Schleifer, Per Sederberg, Aaron Geller, Josh Jacobs
# URL: http://memory.psych.upenn.edu/programming/pyepl
#
# Distributed under the terms of the GNU Lesser General Public License
# (LGPL). See the license.txt that came with this file.

PLATFORM = $(shell uname)
INCLUDEPY=$(shell python -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('INCLUDEPY')")

include ../../../../Makefile.common

ifeq ($(PLATFORM), Linux)
all: _parallel.so

_parallel.so: parallel.o parallel.i
	swig -c++ -python parallel.i
	g++ -pthread -fno-strict-aliasing -DNDEBUG -O2 -Wall -fPIC -I$(INCLUDEPY) -c parallel_wrap.cxx -o parallel_wrap.o
	g++ -lpthread -shared parallel_wrap.o parallel.o -o _parallel.so

parallel.o: parallel.cpp parallel.h
	g++ -pthread -fno-strict-aliasing -DNDEBUG -O2 -Wall -fPIC -I$(INCLUDEPY) -c parallel.cpp -o parallel.o



endif

ifeq ($(PLATFORM), Darwin)
all: _awCard.so

INCLUDEPY=$(shell python -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('INCLUDEPY')")
LIBPY=$(shell python -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('LIBPL')")
PYTHON_INC = $(INCLUDEPY)
PYTHON_LIB = $(LIBPY)
FLAGS1 = -Wno-long-double -DHAVE_CONFIG_H
FLAGS2 = -bundle -undefined suppress -flat_namespace -lpthread
FLAGS3 = -fno-strict-aliasing -Wno-long-double -no-cpp-precomp	\
-mno-fused-madd -fno-common -dynamic -DNDEBUG -O2 -Wall	

_awCard.so: awCard.o awCard.i 
	swig -c++ -python awCard.i
	g++ $(FLAGS1) -I$(PYTHON_INC) -L$(PYTHON_LIB) -c awCard_wrap.cxx 
	g++ $(FLAGS2) awCard.o awCard_wrap.o -o $@ -law 

awCard.o: awCard.cpp awCard.h 
	g++ $(FLAGS3) -I$(PYTHON_INC) -c $*.cpp -o $@

awctest: awCard.cpp awCard.h
	g++ -g -o $@ awCard.cpp -law

endif

clean:
	rm -f *.o *.so *.cxx