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 (95 lines) | stat: -rw-r--r-- 3,675 bytes parent folder | download | duplicates (3)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# PyEPL: hardware/sound/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.

all: _eplSound.so _soundFile.so

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

PLATFORM = $(shell uname | sed s/GNU\\/kFreeBSD/Linux/)

ifeq ($(PLATFORM), Linux)
########################################################
#
# Make rules for linux
#
########################################################
SOUND_DRIVER=ALSA

_eplSound.so: eplSound.o eplSound.i RtAudio.o fifo.o
	swig -c++ -python eplSound.i
	g++ -pthread -fno-strict-aliasing -DNDEBUG -O2 -Wall -fPIC -I$(INCLUDEPY) -c eplSound_wrap.cxx -o eplSound_wrap.o
	g++ -lpthread -lasound -shared eplSound_wrap.o eplSound.o RtAudio.o fifo.o -o _eplSound.so

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

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

RtAudio.o: RtAudio.cpp
	g++ -O2 -Wall -fPIC -D__LINUX_$(SOUND_DRIVER)__  -c RtAudio.cpp -o RtAudio.o

soundFile.o: soundFile.cpp soundFile.h
	g++ -pthread -fno-strict-aliasing -DNDEBUG -O2 -Wall -fPIC -c soundFile.cpp -o soundFile.o

_soundFile.so: soundFile.i soundFile.o
	swig -c++ -python soundFile.i
	g++ -pthread -fno-strict-aliasing -DNDEBUG -O2 -Wall -fPIC -I$(INCLUDEPY) -c soundFile_wrap.cxx -o soundFile_wrap.o
	g++ -lpthread -shared soundFile_wrap.o soundFile.o -lsndfile -lsamplerate -o _soundFile.so

endif

ifeq ($(PLATFORM), Darwin)
########################################################
#
# Make rules for mac
#
########################################################

LIBDIR = -L/usr/local/lib -L/opt/local/lib -L/sw/lib
INCLUDEDIR = -I/usr/local/include -I/opt/local/include -I/sw/include

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 -framework CoreAudio
FLAGS3 = -fno-strict-aliasing -Wno-long-double -no-cpp-precomp	\
-mno-fused-madd -fno-common -dynamic -DNDEBUG -O2 -Wall	

_eplSound.so: eplSound.o eplSound.i RtAudio.o fifo.o
	swig -c++ -python eplSound.i
	g++ $(FLAGS1) -I$(PYTHON_INC) -L$(PYTHON_LIB) -c eplSound_wrap.cxx 
	g++ $(FLAGS2) eplSound.o eplSound_wrap.o RtAudio.o fifo.o -o _eplSound.so 

eplSound.o: eplSound.cpp eplSound.h
	g++ $(FLAGS3) -I$(PYTHON_INC) -c eplSound.cpp -o eplSound.o

fifo.o: fifo.cpp fifo.h
	g++ $(FLAGS3) -I$(PYTHON_INC) -c fifo.cpp -o fifo.o

RtAudio.o: RtAudio.cpp
	g++ -O2 -Wall -D__MACOSX_CORE__ -c RtAudio.cpp -o RtAudio.o

soundFile.o: soundFile.cpp soundFile.h
	g++  -O2 -W -Wall -Wcast-align -Wcast-qual -Wwrite-strings -pipe -fpascal-strings -c soundFile.cpp -o soundFile.o $(LIBDIR) $(INCLUDEDIR)

_soundFile.so: soundFile.i soundFile.o
	swig -c++ -python soundFile.i		
	g++ -Wno-long-double -c soundFile_wrap.cxx -DHAVE_CONFIG_H -I$(PYTHON_INC)
	g++ -bundle -undefined suppress -flat_namespace soundFile_wrap.o soundFile.o -lsndfile -lsamplerate -o _soundFile.so $(LIBDIR) $(INCLUDEDIR)

test_epl: eplSound.o RtAudio.o test_epl.cpp
	g++ -O2 -I../  -D__MACOSX_CORE__ -o test_epl test_epl.cpp eplSound.o RtAudio.o -lstdc++ -lpthread  -framework CoreAudio

endif

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