# Copyright 2000, International Business Machines Corporation and others.
# All Rights Reserved.
# 
# This software has been released under the terms of the IBM Public
# License.  For details, see the LICENSE file in the top-level source
# directory or online at http://www.openafs.org/dl/license10.html

srcdir=@srcdir@
include @TOP_OBJDIR@/src/config/Makefile.config
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@

# System specific build commands and flags
DEFINES=-DKERNEL -DUKERNEL -D_NO_PROTO -DOSF
KOPTS=
DBG=
OPTF=-O
CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBG} $(XCFLAGS) -pthread
WEBOPTS = -I../nsapi -DNETSCAPE_NSAPI -DNET_SSL -DXP_UNIX -DMCC_HTTPD

TEST_CFLAGS=-pthread -D_NO_PROTO -D_REENTRANT -DAFS_PTHREAD_ENV -Dosf -DAFS_OSF_ENV -DOSF $(XCFLAGS)
TEST_LDFLAGS=-pthread
TEST_LIBS=-lm

LIBUAFS = libuafs.a
LIBJUAFS = libjuafs.a
LIBAFSWEB = nsafs.so
LIBAFSWEBKRB = nsafs.krb.so

include Makefile.common

$(LIBUAFS): $(UAFSOBJ)
	-$(RM) -f $(LIBUAFS)
	$(AR) $(ARFLAGS) $(LIBUAFS) $(UAFSOBJ)
	ranlib $(LIBUAFS)

libuafs_pic.a: $(PICUAFSOBJ)
	-$(RM) -f libuafs_pic.a
	$(AR) $(ARFLAGS) libuafs_pic.a $(PICUAFSOBJ)
	ranlib libuafs_pic.a

$(LIBJUAFS): $(JUAFSOBJ)
	-$(RM) -f $(LIBJUAFS)
	$(AR) $(ARFLAGS) $(LIBJUAFS) $(JUAFSOBJ)
	ranlib $(LIBJUAFS)

$(LIBAFSWEB): $(AFSWEBOBJ) ${DES}/libdes.a
	-$(RM) -f $(LIBAFSWEB)
	ld -all -shared -expect_unresolved "*" $(LIBAFSWEB) $(AFSWEBOBJ) ${DES}/libdes.a $(WEBLIBS)

$(LIBAFSWEBKRB): $(AFSWEBOBJKRB) ${DES}/libdes.a
	-$(RM) -f $(LIBAFSWEBKRB)
	ld -all -shared -expect_unresolved "*" $(LIBAFSWEBKRB) $(AFSWEBOBJKRB) ${DES}/libdes.a $(WEBLIBS)
