#
# neon source directory Makefile
# 
# Use the NEON_NORMAL_BUILD or NEON_LIBTOOL_BUILD autoconf 
# macros to set up this Makefile correctly.
#

SHELL = /bin/bash

# Installation paths
prefix = /usr
exec_prefix = ${prefix}
libdir = /usr/lib/amd64

# Build paths
VPATH = /jenkins/jobs/oi-userland/workspace/components/library/libneon/neon-0.37.1/src
top_builddir = ..
top_srcdir = /jenkins/jobs/oi-userland/workspace/components/library/libneon/neon-0.37.1

# Toolchain settings.
CC = /usr/gcc/14/bin/gcc
AR = ar
RANLIB = ranlib
LIBTOOL = $(SHELL) $(top_builddir)/libtool

# Flags
CPPFLAGS = -DHAVE_CONFIG_H  -I/usr/openssl/3/include -I/usr/include/libproxy -I${top_builddir}
CFLAGS = -m64 -O3  -I/usr/include/kerberosv5
LDFLAGS = -m64
NEON_LINK_FLAGS = -version-info 37:1:10 -export-symbols-regex '^ne_[^_]'
# Note: don't substitute  in here; during a bundled
# build of this directory,  may include -lneon.
LIBS = -lnsl -lsocket  -lz -L/usr/openssl/3/lib/amd64 -lssl -lcrypto -L/usr/lib -lgss -lkrb5 -lproxy -lexpat 

COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS)
LT_COMPILE = $(LIBTOOL) --quiet --mode=compile --tag=CC $(COMPILE)
LINK = $(LIBTOOL) --quiet --mode=link --tag=CC $(CC) -no-undefined $(LDFLAGS)

NEON_BASEOBJS = ne_request.lo ne_session.lo	\
	ne_basic.lo ne_string.lo			\
	ne_uri.lo ne_dates.lo			\
	ne_alloc.lo ne_md5.lo			\
	ne_utils.lo ne_socket.lo			\
	ne_auth.lo ne_redirect.lo			\
	ne_compress.lo ne_i18n.lo			\
	ne_pkcs11.lo ne_socks.lo			\
	ne_ssl.lo

NEON_DAVOBJS = $(NEON_BASEOBJS) \
	ne_207.lo ne_xml.lo \
	ne_props.lo ne_locks.lo \
	ne_xmlreq.lo

OBJECTS =  $(NEON_DAVOBJS)  ne_oldacl.lo ne_acl3744.lo ne_openssl.lo

.SUFFIXES:
.SUFFIXES: .c .lo .o

.PHONY: all all-yes check-c++ check-incl update-tables \
	update-deps

NEON_TARGET = libneon.la

# Thanks to gettext for this neat trick.
all: all-yes

all-yes: $(NEON_TARGET)
all-no:
	@echo "Bundled neon build not being used."

.c.lo:
	$(LT_COMPILE) -c $< -o $@
.c.o:
	$(COMPILE) -c $< -o $@

libneon.la: $(OBJECTS)
	$(LINK) -rpath $(libdir) $(NEON_LINK_FLAGS) -o $@ $(OBJECTS) $(LIBS)

libneon.a: $(OBJECTS)
	@rm -f $@
	$(AR) cru $@ $(OBJECTS)
	$(RANLIB) $@

clean:
	rm -f $(NEON_TARGET) *.o *.lo *.bbg *.bb *.gc*
	rm -rf .libs

mktable: mktable.lo
	$(LINK) -o $@ mktable.lo

c++.c: Makefile
	find . -name ne_\*.h -print | sed 's/.*/#include "&"/;/ne_priv/d;/ne_internal.h/d;/ne_ntlm.h/d;/ne_acl.h/d' > $@
	echo "int main(void) {}" >> $@

check-c++: c++.c
	c++ -I. c++.c

check-incl:
	@for f in ne_*.h; do						\
	 [ x"$$f" != "xne_internal.h" ] || continue;			\
	 [ x"$$f" != "xne_ntlm.h" ] || continue;			\
	 echo Checking $$f...;						\
	 echo "#include \"$$f\"" > checkincl.c;				\
	 $(LT_COMPILE) -c checkincl.c -o checkincl.o || exit 1; done

# Update generated character lookup tables.
update-tables: mktable
	@for n in `./mktable`; do						\
	  for f in `grep -l "mktable $$n" ne*.c`; do				\
	    new=`mktemp`;							\
	    (sed "/.* Generated with .mktable $$n/,\$$d" $$f;			\
	     ./mktable $$n;							\
	     sed "0,/.* Generated code from .mktable $$n. ends/d" $$f) > $$new;	\
	     mv $$new $$f;							\
	  done									\
	done

# Update generated dependencies below; requires cc -MM as in gcc.
update-deps:
	for f in `echo $(OBJECTS) | sed 's/\\.lo/.c/g;s/ne_openssl.c//;s/ne_gnutls.c//;s/ne_pkcs11.c//;s/ne_stubssl.c//'`; do \
	  $(CC) $(CPPFLAGS) -MM -c $$f; \
	done | sed 's, \.\./, $$(top_builddir)/,g;s, /[^ ]*.h,,g;/^  .$$/d;s/\.o: /.@NEON''_OBJEXT@: /' > new-deps
	sed '/[-]--CUT---/q' Makefile.in > Makefile.new
	cat Makefile.new new-deps > Makefile.in
	rm new-deps Makefile.new

ne_openssl.lo: ne_openssl.c $(top_builddir)/config.h ne_ssl.h ne_defs.h ne_string.h \
  ne_alloc.h ne_session.h ne_uri.h ne_socket.h ne_internal.h ne_private.h \
  ne_request.h ne_utils.h ne_pkcs11.h ne_privssl.h
ne_stubssl.lo: ne_stubssl.c $(top_builddir)/config.h ne_ssl.h ne_defs.h ne_session.h \
  ne_uri.h ne_socket.h
ne_pkcs11.lo: ne_pkcs11.c $(top_builddir)/config.h ne_pkcs11.h ne_defs.h ne_session.h \
  ne_ssl.h ne_uri.h ne_socket.h ne_internal.h ne_privssl.h \
  ne_alloc.h ne_private.h ne_request.h ne_utils.h ne_string.h
ne_gnutls.lo: ne_gnutls.c $(top_builddir)/config.h ne_ssl.h ne_defs.h \
  ne_string.h ne_alloc.h ne_session.h ne_uri.h ne_socket.h ne_internal.h \
  ne_private.h ne_request.h ne_utils.h ne_privssl.h
#### ---CUT--- DO NOT REMOVE THIS LINE.  Generated dependencies follow.  ####
ne_request.lo: ne_request.c $(top_builddir)/config.h ne_internal.h ne_defs.h ne_alloc.h \
 ne_request.h ne_utils.h ne_string.h ne_session.h ne_ssl.h ne_uri.h \
 ne_socket.h ne_dates.h ne_private.h
ne_session.lo: ne_session.c $(top_builddir)/config.h \
 ne_session.h ne_ssl.h ne_defs.h ne_uri.h ne_socket.h ne_alloc.h ne_utils.h \
 ne_internal.h ne_string.h ne_dates.h ne_private.h ne_request.h
ne_basic.lo: ne_basic.c $(top_builddir)/config.h ne_request.h ne_utils.h ne_defs.h \
 ne_string.h ne_alloc.h ne_session.h ne_ssl.h ne_uri.h ne_socket.h \
 ne_basic.h ne_207.h ne_xml.h ne_locks.h ne_dates.h ne_internal.h
ne_string.lo: ne_string.c $(top_builddir)/config.h ne_alloc.h ne_defs.h ne_string.h \
 ne_internal.h
ne_uri.lo: ne_uri.c $(top_builddir)/config.h ne_string.h ne_defs.h ne_alloc.h ne_uri.h
ne_dates.lo: ne_dates.c $(top_builddir)/config.h ne_alloc.h ne_defs.h ne_dates.h \
 ne_string.h
ne_alloc.lo: ne_alloc.c $(top_builddir)/config.h ne_alloc.h ne_defs.h
ne_md5.lo: ne_md5.c $(top_builddir)/config.h ne_md5.h ne_defs.h ne_string.h ne_alloc.h
ne_utils.lo: ne_utils.c $(top_builddir)/config.h ne_utils.h ne_defs.h ne_string.h \
 ne_alloc.h ne_dates.h
ne_socket.lo: ne_socket.c $(top_builddir)/config.h ne_privssl.h ne_ssl.h ne_defs.h \
 ne_socket.h ne_internal.h ne_utils.h ne_string.h ne_alloc.h ne_sspi.h
ne_auth.lo: ne_auth.c $(top_builddir)/config.h ne_dates.h ne_defs.h ne_request.h \
 ne_utils.h ne_string.h ne_alloc.h ne_session.h ne_ssl.h ne_uri.h \
 ne_socket.h ne_auth.h ne_internal.h
ne_redirect.lo: ne_redirect.c $(top_builddir)/config.h ne_session.h ne_ssl.h ne_defs.h \
 ne_uri.h ne_socket.h ne_request.h ne_utils.h ne_string.h ne_alloc.h \
 ne_redirect.h ne_internal.h
ne_compress.lo: ne_compress.c $(top_builddir)/config.h ne_request.h ne_utils.h \
 ne_defs.h ne_string.h ne_alloc.h ne_session.h ne_ssl.h ne_uri.h \
 ne_socket.h ne_compress.h ne_internal.h
ne_i18n.lo: ne_i18n.c $(top_builddir)/config.h ne_i18n.h ne_defs.h
ne_socks.lo: ne_socks.c $(top_builddir)/config.h ne_internal.h ne_defs.h ne_string.h \
 ne_alloc.h ne_socket.h ne_ssl.h ne_utils.h
ne_ssl.lo: ne_ssl.c $(top_builddir)/config.h ne_alloc.h ne_defs.h ne_utils.h \
 ne_internal.h ne_string.h ne_privssl.h ne_ssl.h ne_socket.h
ne_207.lo: ne_207.c $(top_builddir)/config.h ne_alloc.h ne_defs.h ne_utils.h ne_xml.h \
 ne_xmlreq.h ne_request.h ne_string.h ne_session.h ne_ssl.h ne_uri.h \
 ne_socket.h ne_207.h ne_basic.h ne_internal.h
ne_xml.lo: ne_xml.c $(top_builddir)/config.h ne_internal.h ne_defs.h ne_alloc.h \
 ne_xml.h ne_utils.h ne_string.h
ne_props.lo: ne_props.c $(top_builddir)/config.h ne_alloc.h ne_defs.h ne_xmlreq.h \
 ne_request.h ne_utils.h ne_string.h ne_session.h ne_ssl.h ne_uri.h \
 ne_socket.h ne_xml.h ne_props.h ne_207.h ne_basic.h ne_locks.h \
 ne_internal.h
ne_locks.lo: ne_locks.c $(top_builddir)/config.h ne_alloc.h ne_defs.h ne_request.h \
 ne_utils.h ne_string.h ne_session.h ne_ssl.h ne_uri.h ne_socket.h \
 ne_xml.h ne_locks.h ne_basic.h ne_props.h ne_207.h ne_internal.h \
 ne_xmlreq.h
ne_xmlreq.lo: ne_xmlreq.c $(top_builddir)/config.h ne_internal.h ne_defs.h ne_xmlreq.h \
 ne_request.h ne_utils.h ne_string.h ne_alloc.h ne_session.h ne_ssl.h \
 ne_uri.h ne_socket.h ne_xml.h ne_basic.h
ne_oldacl.lo: ne_oldacl.c $(top_builddir)/config.h ne_request.h ne_utils.h ne_defs.h \
 ne_string.h ne_alloc.h ne_session.h ne_ssl.h ne_uri.h ne_socket.h \
 ne_locks.h ne_acl.h ne_xml.h
ne_acl3744.lo: ne_acl3744.c $(top_builddir)/config.h ne_request.h ne_utils.h ne_defs.h \
 ne_string.h ne_alloc.h ne_session.h ne_ssl.h ne_uri.h ne_socket.h \
 ne_locks.h ne_acl3744.h ne_xml.h
