

ifeq ($(NEOTONIC_ROOT),)
NEOTONIC_ROOT = ..
endif

include $(NEOTONIC_ROOT)/rules.mk

NEO_SO = libneo.so
NEO_STATIC_LIBS =  

LIBS += -L$(LIB_DIR) $(DLIBS) $(DB2_LIB)


TARGETS = $(NEO_SO) dsotest

all: $(TARGETS)

$(NEO_SO): $(NEO_STATIC_LIBS) $(DEP_LIBS) Makefile 
	gcc -o libneo.so -fpic -shared ../util/neo_err.o ../util/neo_files.o ../util/neo_misc.o ../util/neo_rand.o ../util/ulist.o ../util/neo_hdf.o ../util/neo_str.o ../util/neo_date.o ../util/wildmat.o ../util/neo_hash.o ../util/ulocks.o ../util/rcfs.o ../util/skiplist.o ../util/dict.o ../util/filter.o ../util/neo_net.o ../util/neo_server.o ../cs/csparse.o ../cgi/cgiwrap.o ../cgi/cgi.o ../cgi/html.o ../cgi/date.o ../cgi/rfc2388.o

#	 /usr/bin/ld  -rpath ../libs -shared -o libneo.so -whole-archive ../libs/libneo_cgi.a ../libs/libneo_cs.a ../libs/libneo_utl.a -no-whole-archive $(LIBS)
#	$(LDSHARED) -o $@ $(LDFLAGS) -Wl,-whole-archive $(DLIBS)

install: all
	$(NEOTONIC_ROOT)/mkinstalldirs $(DESTDIR)$(PYTHON_SITE)
	$(INSTALL) $(TARGETS) $(DESTDIR)$(PYTHON_SITE)

dsotest: dsotest.c $(NEO_SO)
	gcc -o dsotest dsotest.c -lneo -L. -I..

clean:
	$(RM) *.o 

distclean:
	$(RM) Makefile.depends $(TARGETS) *.o
