# $Id: Makefile,v 1.3 2003/02/13 11:57:00 lsmithso Exp $
# Linux Makefile for pyxasw.
#
# Author: L. Smithson (lsmithson@open-networks.co.uk)
#
# DISCLAIMER
# You are free to use this code in any way you like, subject to the
# Python disclaimers & copyrights. I make no representations about
# the suitability of this software for any purpose. It is provided
# "AS-IS" without warranty of any kind, either express or implied. So
# there.
#


CC=gcc
PYINC=/usr/include/python2.2
PYLIBPATH=/usr/lib/python2.2/config


MQINC=/opt/mqm/inc
ORACLE_HOME=/proj/oracle/product/9.0.1
ORALIBPATH= $(ORACLE_HOME)/lib


all: pyxasw.so mqorapysw.so

pyxasw.so: pyxasw.c
	$(CC) -c -g -Wall -Wstrict-prototypes  -I$(PYINC) pyxasw.c
	ld -Bdynamic -shared pyxasw.o -L$(PYLIBPATH)  -export-dynamic -lpython2.2 -ldl -lpthread -lutil -lm -lc -o $@

mqorapysw.so: mqorapysw.c pyxasw.so
	$(CC) -c -I$(MQINC) mqorapysw.c
	ld -Bdynamic -shared mqorapysw.o -e MQStart -rpath $(ORALIBPATH) -rpath /var/mqm -L$(ORALIBPATH) -lclntsh pyxasw.so -o $@


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