# # Name: Makehead.macosx # # Purpose: This file is used to customize operating system and installation # dependent features of the Mp makefiles. This version is # customized for MacOS X running on a PPC Macintosh. # # Please note that modules dynamically loaded via the dlopen() # style API from Linux, Solaris, etc. must be compiled and linked # as Mach-O bundles rather than dylib shared libraries. Thus, # the fact that I am creating bundles below is _not_ a mistake. # # There are several different versions of Python for MacOS X. The first # value of PYTHON_DIR below is for Fink, while the other one is for the # version of Python bundled with MacOS X. You must select the one # appropriate to your installation. # #PYTHON_DIR = /sw #MX_PYTHON = 2.6 ifndef MX_PYTHON MX_PYTHON = $(shell python -V 2>&1 | cut -f2 -d' ' | cut -c1-3) endif $(info Python is [${MX_PYTHON}]) PYTHON_DIR = \ /System/Library/Frameworks/Python.framework/Versions/$(MX_PYTHON) PYTHON_INCLUDES = -I$(PYTHON_DIR)/include/python$(MX_PYTHON) # # The following optional modules import external Python modules that may not # be available at all sites and for all operating systems. Comment out any # that will not build at your site. # # MpNum.py - Requires the 'numpy' module. OPTIONAL_MODULES += MpNum.pyc # #========================================================================= # # Generally, you should not have to modify anything after this point. # PYTHON = python MP_BUILD_PYC = $(PYTHON) MpBuildPyc.pyx CC = cc CFLAGS = -g -O -fPIC -fno-common $(GCCFLAGS) $(INCLUDES) $(PYTHON_INCLUDES)\ -DOS_MACOSX $(EXTRA_FLAGS) -DDEBUG MAKEDEPEND = cc -MM $(CFLAGS) mp_*.c > Makefile.depend MAKEDEPEND_CLEAN = rm Makefile.depend #--------------------------------------------------------------------- LIBMP_OBJS = $(LIBMP_SRCS:.c=.$(OBJ)) LIBMP_NAME = libMp.dylib LIBMP_STATIC_NAME = libMp.a LIBMP_DELETE = rm $(LIBMP_NAME) $(LIBMP_STATIC_NAME) #--- $(LIBMP_NAME): $(LIBMP_OBJS) -$(LIBMP_DELETE) gcc -dynamiclib -o $(LIBMP_NAME) $(LIBMP_OBJS) $(MP_LIBRARIES) \ -undefined suppress -flat_namespace ar rcs $(LIBMP_STATIC_NAME) $(LIBMP_OBJS) ranlib $(LIBMP_STATIC_NAME) #--------------------------------------------------------------------- MP_PYTHON_MODULES = Mp.pyc MpScan.pyc MP_MODULE_NAME = MpPrivate.so MP_MODULE_OBJS = $(MP_MODULE_SRCS:.c=.$(OBJ)) #--------------------------------------------------------------------- MP_MODULE_DELETE = rm $(MP_MODULE_NAME) $(MP_MODULE_NAME): $(MP_MODULE_OBJS) $(LIBMP_NAME) -$(MP_MODULE_DELETE) cc -bundle -undefined suppress -flat_namespace \ -o $(MP_MODULE_NAME) $(MP_MODULE_OBJS) \ $(LIBMP_NAME) $(MP_LIBRARIES) #--------------------------------------------------------------------- INCLUDES = -I$(LIBMXSRC) MP_LIBRARIES = -L$(LIBMXSRC) -lMx -lc #--------------------------------------------------------------------- mp_install: -mkdir $(MX_INSTALL_DIR)/bin -mkdir $(MX_INSTALL_DIR)/lib -mkdir $(MX_INSTALL_DIR)/lib/mp /usr/bin/install -c -m 644 $(LIBMP_NAME) $(MX_INSTALL_DIR)/lib /usr/bin/install -c -m 644 $(LIBMP_STATIC_NAME) $(MX_INSTALL_DIR)/lib /usr/bin/install -c -m 644 *.py $(MX_INSTALL_DIR)/lib/mp /usr/bin/install -c -m 644 *.pyc $(MX_INSTALL_DIR)/lib/mp /usr/bin/install -c -m 644 MpPrivate.so $(MX_INSTALL_DIR)/lib/mp /usr/bin/install -c -m 755 ../mpscript/mpscript $(MX_INSTALL_DIR)/bin /usr/bin/install -c -m 755 ../mpscript/mpshell $(MX_INSTALL_DIR)/bin /usr/bin/install -c -m 755 ../mpscript/mpenv $(MX_INSTALL_DIR)/bin