build_top=..
include ../config/commondefs
top_srcdir=@top_srcdir@
srcdir=@srcdir@
VPATH=@srcdir@
exec_prefix=@exec_prefix@
LLDLIBS = -lps5


DEST =$(build_top)/lib
LIBDIR = $(DEST)

LC++INCS = -I/usr/local/lib/g++-include

LIBC++FILES = dir_node.C file_node.C  http_response.C normal_response.C \
              url_ops.C web_node.C server.C error_response.C http_server.C
C++FILES = $(LIBC++FILES) main.C
LIBOBJS = $(LIBC++FILES:.C=.o) 

PROGRAM = http_dummy
LIBRARY = libps5.a
TARGETS = $(PROGRAM) $(LIBRARY) $(LIBDIR)/libps5.a

all: $(LIBDIR)/libps5.a  test_qparse

test_qparse : test_qparse.o
		$(C++F) -o $@ $^ $(LDFLAGS)

$(LIBDIR)/libps5.a : $(LIBRARY)
	-rm -f $@
	ln -s ../ps5/libps5.a $@

default: $(TARGETS)

all: $(TARGETS) localinstall

$(PROGRAM): $(LIBRARY) main.o
	$(C++F) -o $@ main.o $(LIBRARY) $(LDFLAGS) 

test_url: test_url.o $(LIBRARY)
	$(C++F) -o $@ test_url.o $(LIBRARY) $(LDFLAGS)

$(LIBRARY): $(LIBOBJS)
	@-rm -f $(LIBRARY)
	$(ARADD) $(LIBRARY) $(LIBOBJS)

localinstall: $(LIBRARY)
	cp -p $(LIBRARY) $(LIBDIR)
include $(COMMONRULES)
