# License. For details, see the LICENSE file in the top-level source
# directory or online at http://www.openafs.org/dl/license10.html
-DEST=@DEST@
-TOP_INCDIR=@TOP_INCDIR@
-TOP_LIBDIR=@TOP_LIBDIR@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-bindir=@bindir@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-libdir=@libdir@
-includedir=@includedir@
-mandir=@mandir@
-afssrvbindir=@afssrvbindir@
-afssrvsbindir=@afssrvsbindir@
-afssrvlibexecdir=@afssrvlibexecdir@
-COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et
-TOP_SRCDIR=@TOP_SRCDIR@
-SYS_NAME=@AFS_SYSNAME@
-
-SHELL = /bin/sh
-
-include ../config/Makefile.${SYS_NAME}
-
-LIBS=${TOP_LIBDIR}/libauth.a \
- ${TOP_LIBDIR}/librxkad.a \
- ${TOP_LIBDIR}/libdes.a \
- ${TOP_LIBDIR}/librx.a \
- ${TOP_LIBDIR}/liblwp.a \
- ${TOP_LIBDIR}/libcom_err.a \
- ${TOP_LIBDIR}/util.a \
- ${TOP_LIBDIR}/libsys.a
-
-CFLAGS=-I${TOP_INCDIR} -I${TOP_SRCDIR}/config ${XCFLAGS}
-
-RXGEN=${TOP_SRCDIR}/rxgen/rxgen
+srcdir=@srcdir@
+include @TOP_OBJDIR@/src/config/Makefile.config
+include @TOP_OBJDIR@/src/config/Makefile.pthread
+
+LIBS= \
+ $(top_builddir)/src/auth/liboafs_auth.la \
+ $(top_builddir)/src/rx/liboafs_rx.la \
+ $(top_builddir)/src/rxkad/liboafs_rxkad.la \
+ $(top_builddir)/src/cmd/liboafs_cmd.la \
+ $(top_builddir)/src/util/liboafs_util.la \
+ $(top_builddir)/src/opr/liboafs_opr.la
all: upserver upclient
+generated: update.cs.c update.ss.c update.xdr.c update.h
+
#
# Build targets
#
-upclient: client.o update.cs.o utils.o ${LIBS}
- ${CC} ${CFLAGS} -o upclient client.o update.cs.o utils.o ${LIBS} ${XLIBS}
+upclient: client.o update.cs.o utils.o ${LIBS}
+ $(LT_LDRULE_static) client.o update.cs.o utils.o \
+ ${LIBS} $(LIB_roken) ${XLIBS}
upserver: server.o utils.o update.ss.o ${LIBS}
- ${CC} ${CFLAGS} -o upserver server.o utils.o update.ss.o ${LIBS} ${XLIBS}
+ $(LT_LDRULE_static) server.o utils.o update.ss.o \
+ ${LIBS} $(LIB_roken) ${XLIBS}
utils.o: utils.c update.h global.h
client.o server.o: update.h global.h AFS_component_version_number.c
-update.cs.c update.ss.c update.er.c update.h: update.xg
- ${RXGEN} update.xg
+update.cs.c: update.xg
+ ${RXGEN} -A -u -C -o $@ ${srcdir}/update.xg
+
+update.ss.c: update.xg
+ ${RXGEN} -A -S -o $@ ${srcdir}/update.xg
+
+update.xdr.c: update.xg
+ ${RXGEN} -A -c -o $@ ${srcdir}/update.xg
+
+update.h: update.xg
+ ${RXGEN} -A -u -h -o $@ ${srcdir}/update.xg
+
+update.cs.c: update.h
+update.ss.c: update.h
+update.er.c: update.h
#
# Installation targets
#
-install : ${DESTDIR}${afssrvlibexecdir}/upserver ${DESTDIR}${afssrvlibexecdir}/upclient
+install: upserver upclient
+ ${INSTALL} -d ${DESTDIR}${afssrvlibexecdir}
+ ${INSTALL_PROGRAM} upserver ${DESTDIR}${afssrvlibexecdir}/upserver
+ ${INSTALL_PROGRAM} upclient ${DESTDIR}${afssrvlibexecdir}/upclient
-${DEST}/root.server/usr/afs/bin/upserver: upserver
- ${INSTALL} $? $@
-
-${DEST}/root.server/usr/afs/bin/upclient: upclient
- ${INSTALL} $? $@
+dest: upserver upclient
+ ${INSTALL} -d ${DEST}/root.server/usr/afs/bin
+ ${INSTALL_PROGRAM} upserver ${DEST}/root.server/usr/afs/bin/upserver
+ ${INSTALL_PROGRAM} upclient ${DEST}/root.server/usr/afs/bin/upclient
#
# Misc. targets
#
-clean:
+clean:
$(RM) -f *.o upclient upserver update.ss.c update.cs.c update.xdr.c update.h core \
AFS_component_version_number.c
include ../config/Makefile.version
-
-${DESTDIR}${afssrvlibexecdir}/upserver: upserver
- ${INSTALL} $? $@
-
-${DESTDIR}${afssrvlibexecdir}/upclient: upclient
- ${INSTALL} $? $@
-
-dest: ${DEST}/root.server/usr/afs/bin/upserver ${DEST}/root.server/usr/afs/bin/upclient
-