# # Makefile for demo of C interface for Miki Tebeka's num2eng (written in Python) # Rick Ratzel # 3/1/2004 # # Copyright (c) 2004 Richard L. Ratzel # see file "COPYRIGHT" for more details... # # # location on a RH9 system...use the following in Python to determine # where the Python include dir is # # >>> import distutils.sysconfig # >>> distutils.sysconfig.get_config_var('INCLUDEPY') # INCLUDES = -I. -I@PYTHON_INCLUDES@ # # locations on a RH9 system...use the following in Python to determine # what other Python libs are needed # ...LIBPL is the directory where the Python library is installed # ...LIBRARY is the name of the Python library # ...SYSLIBS and LIBS are needed for functions in libpython # ...LINKFORSHARED is for linking an embedded interp which uses shared-libs # # >>> import distutils.sysconfig # >>> distutils.sysconfig.get_config_var('LIBPL') # >>> distutils.sysconfig.get_config_var('LIBRARY') # >>> distutils.sysconfig.get_config_var('SYSLIBS') # >>> distutils.sysconfig.get_config_var('LIBS') # >>> distutils.sysconfig.get_config_var('MODLIBS') # >>> distutils.sysconfig.get_config_var('LINKFORSHARED') # LIBS = @PYTHON_LIB_NAME@ @LIBS@ CFLAGS = @CFLAGS@ CC_SWITCHES = $(CFLAGS) $(INCLUDES) all: HelloWorld HelloWorld_PyExt %.o: %.c $(CC) -c $(CC_SWITCHES) $< HelloWorld : HelloWorld.o $(CC) -o $@ HelloWorld.o HelloWorld_PyExt : HelloWorld_PyExt.o num2eng.o $(CC) -o $@ HelloWorld_PyExt.o num2eng.o $(LIBS) clean: rm -f HelloWorld.o HelloWorld HelloWorld_PyExt.o num2eng.o HelloWorld_PyExt