# PyEPL: hardware/rt/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')")
LIBPY=$(shell python -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('LIBPL')")

ifeq ($(PLATFORM), Linux)

all: 
# Do nothing for now

clean:
	rm -f *.so *.o

endif

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

_realtime.so: realtime.o realtime.i 
	swig -c++ -python realtime.i
	g++ -c  -Wno-long-double realtime_wrap.cxx -DHAVE_CONFIG_H -I$(INCLUDEPY)
	g++ -bundle -undefined suppress -flat_namespace realtime.o realtime_wrap.o -o _realtime.so -lpthread

realtime.o: realtime.cpp
	g++ -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -D__MACOSX_CORE__ -I$(INCLUDEPY) -c realtime.cpp -o realtime.o


endif
