#NS_HOME=/home/nsadmin
NS_HOME=/home/aol30

MALLOC_DEBUG=
#MALLOC_DEBUG=-ldmalloc
CC=gcc
CFLAGS=-D_REENTRANT -I$(NS_HOME)/include -I./include
LD= ld -dy -G -L./lib
LIBS=$(MALLOC_DEBUG) ./lib/libxml.a

all: ns_xml.so


.configure:
	sh -c "cd libxml; ./configure --prefix=`pwd` --enable-static"
	touch .configure

.libxml: .configure
	sh -c "cd libxml; make NS_HOME=$(NS_HOME) install"
	touch .libxml

ns_xml.so : ns_xml.o
	$(LD) -o $@ $< $(LDFLAGS) $(LIBS)

ns_xml.o: ns_xml.c .libxml

clean:
	rm -f .libxml .configure *.so *.o *~
	sh -c "cd libxml; make clean"

distclean: clean
	rm -rf lib bin include share
	sh -c "cd libxml; make distclean"
