add-ptprocs-prototype-use-20050426
[openafs.git] / src / ptserver / Makefile.in
index 124e59d..4802445 100644 (file)
@@ -4,66 +4,61 @@
 # 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
-DESTDIR=@DESTDIR@
-SRCDIR=@SRCDIR@
-TOP_SRCDIR=@TOP_SRCDIR@
-SYS_NAME=@AFS_SYSNAME@
-
-SHELL = /bin/sh
-
-include ../config/Makefile.${SYS_NAME}
-
-UKERNELDIR=../libuafs/
-RXGEN=${SRCDIR}bin/rxgen
-COMPILE_ET = ${SRCDIR}bin/compile_et
-MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
-
-CFLAGS = $(DBUG) -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS}
-INCLS=${SRCDIR}include/ubik.h \
-       ${SRCDIR}include/lock.h  \
-       ${SRCDIR}include/lwp.h \
-       ${SRCDIR}include/rx/rx.h \
-       ${SRCDIR}include/rx/xdr.h \
-       ${SRCDIR}include/afs/keys.h \
-       ${SRCDIR}include/afs/cellconfig.h \
-       ptserver.h ptclient.h ptint.h ptopcodes.h pterror.h
-
-LINCLS=${SRCDIR}include/ubik.h \
-       ${SRCDIR}include/lock.h \
-       ${SRCDIR}include/rx/rx.h \
-       ${SRCDIR}include/rx/xdr.h  \
-       ${SRCDIR}include/rx/rxkad.h \
-       ${SRCDIR}include/afs/auth.h \
-       ${SRCDIR}include/afs/cellconfig.h \
-       ptclient.h ptint.h pterror.h
-
-LIBS =         ${SRCDIR}lib/libubik.a \
-       ${SRCDIR}lib/afs/libauth.a \
-       ${SRCDIR}lib/librxkad.a \
-       ${SRCDIR}lib/librxstat.a \
-       ${SRCDIR}lib/librx.a \
-       ${SRCDIR}lib/liblwp.a \
-       ${SRCDIR}lib/libdes.a \
-       ${SRCDIR}lib/afs/libcom_err.a \
-       ${SRCDIR}lib/afs/util.a \
-       ${SRCDIR}lib/afs/libsys.a 
-
-auditlib=${SRCDIR}lib/afs/libaudit.a
-
-LIBOBJS=ptuser.o pterror.o ptint.cs.o ptint.xdr.o
-UKSRCS=ptuser.c ptclient.h pterror.c pterror.h ptserver.h
-
-include ../config/Makefile.version
-
-
-clean:
-       $(RM) -f *.o ptserver ptint.cs.c ptint.ss.c ptclient ptint.xdr.c ptint.h \
-       libprot.a  pts readgroup readpwd db_verify testpt pt_util pterror.h pterror.c \
-        core  AFS_component_version_number.c Kptint.cs.c Kptint.h Kptint.xdr.c
-
-ptserver: ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o utils.o $(LIBS) ${auditlib}
-       $(CC) ${CFLAGS} -o ptserver ptserver.o ptutils.o ptprocs.o  ptint.ss.o ptint.xdr.o utils.o $(LIBS) ${XLIBS} ${auditlib}
+srcdir=@srcdir@
+include @TOP_OBJDIR@/src/config/Makefile.config
+
+INCLS=${TOP_INCDIR}/ubik.h \
+       ${TOP_INCDIR}/lock.h  \
+       ${TOP_INCDIR}/lwp.h \
+       ${TOP_INCDIR}/rx/rx.h \
+       ${TOP_INCDIR}/rx/xdr.h \
+       ${TOP_INCDIR}/afs/keys.h \
+       ${TOP_INCDIR}/afs/cellconfig.h \
+       ptserver.h ptclient.h ptuser.h ptint.h pterror.h map.h ptprototypes.h
+
+LINCLS=${TOP_INCDIR}/ubik.h \
+       ${TOP_INCDIR}/lock.h \
+       ${TOP_INCDIR}/rx/rx.h \
+       ${TOP_INCDIR}/rx/xdr.h  \
+       ${TOP_INCDIR}/rx/rxkad.h \
+       ${TOP_INCDIR}/afs/auth.h \
+       ${TOP_INCDIR}/afs/cellconfig.h \
+       ptclient.h ptuser.h ptint.h pterror.h
+
+LIBS=${TOP_LIBDIR}/libubik.a \
+       ${TOP_LIBDIR}/libauth.a \
+       ${TOP_LIBDIR}/librxkad.a \
+       ${TOP_LIBDIR}/librxstat.a \
+       ${TOP_LIBDIR}/librx.a \
+       ${TOP_LIBDIR}/liblwp.a \
+       ${TOP_LIBDIR}/libdes.a \
+       ${TOP_LIBDIR}/libcmd.a \
+       ${TOP_LIBDIR}/libcom_err.a \
+       ${TOP_LIBDIR}/util.a \
+       ${TOP_LIBDIR}/libsys.a \
+       ${TOP_LIBDIR}/libafsutil.a
+
+
+all: ptserver pts pt_util db_verify ${TOP_LIBDIR}/libprot.a \
+       depinstall readgroup readpwd testpt
+
+depinstall: \
+       ptint.cs.c ptint.xdr.c \
+       ${TOP_INCDIR}/afs/prclient.h \
+       ${TOP_INCDIR}/afs/prerror.h \
+       ${TOP_INCDIR}/afs/print.h \
+       ${TOP_INCDIR}/afs/prserver.h \
+       ${TOP_INCDIR}/afs/ptclient.h \
+       ${TOP_INCDIR}/afs/ptuser.h \
+       ${TOP_INCDIR}/afs/pterror.h \
+       ${TOP_INCDIR}/afs/ptint.h \
+       ${TOP_INCDIR}/afs/ptserver.h
+
+#
+# Build targets
+#
+ptserver: ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o utils.o $(LIBS) ${TOP_LIBDIR}/libaudit.a map.o
+       $(CC) ${CFLAGS} -o ptserver ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o utils.o map.o $(LIBS) ${XLIBS} ${TOP_LIBDIR}/libaudit.a
 
 ptserver.o: ptserver.c ${INCLS} AFS_component_version_number.c
 
@@ -73,28 +68,43 @@ ptprocs.o: ptprocs.c ${INCLS}
 
 utils.o: utils.c ${INCLS} 
 
+map.o: map.c ${INCLS}
+
 ptint.ss.o: ptint.ss.c ptint.xdr.c ptint.xg
 ptint.cs.o: ptint.cs.c ptint.xdr.c ptint.xg
 ptint.xdr.o: ptint.xdr.c ptint.h ptint.xg
 
-ptint.ss.c ptint.cs.c ptint.xdr.c ptint.h: ptint.xg
-       ${RXGEN} -x ptint.xg
+ptint.cs.c: ptint.xg
+       ${RXGEN} -x -C -o $@ ${srcdir}/ptint.xg
+
+ptint.ss.c: ptint.xg
+       ${RXGEN} -x -S -o $@ ${srcdir}/ptint.xg
+
+ptint.xdr.c: ptint.xg
+       ${RXGEN} -x -c -o $@ ${srcdir}/ptint.xg
+
+ptint.h: ptint.xg
+       ${RXGEN} -x -h -o $@ ${srcdir}/ptint.xg
+
+ptint.cs.c: ptint.h
+ptint.ss.c: ptint.h
+ptint.xdr.c: ptint.h
 
 Kptint.cs.c: ptint.xg Kptint.h
-       ${RXGEN} -x -k -C -o Kptint.cs.c ptint.xg
+       ${RXGEN} -x -k -C -o Kptint.cs.c ${srcdir}/ptint.xg
  
 Kptint.xdr.c: ptint.xg
-       ${RXGEN} -x -k -c -o Kptint.xdr.c ptint.xg
+       ${RXGEN} -x -k -c -o Kptint.xdr.c ${srcdir}/ptint.xg
  
 Kptint.h: ptint.xg
-       ${RXGEN}  -x -k -h -o Kptint.h ptint.xg
+       ${RXGEN} -x -k -h -o Kptint.h ${srcdir}/ptint.xg
 
 display.o: display.c ${INCLS}
 
 db_verify.o: db_verify.c ${INCLS} AFS_component_version_number.c
 
 db_verify: db_verify.o pterror.o display.o $(LIBS)
-       $(CC) ${CFLAGS} -o db_verify db_verify.o display.o pterror.o $(LIBS) ${XLIBS} ${SRCDIR}lib/afs/libcmd.a
+       $(CC) ${CFLAGS} -o db_verify db_verify.o display.o pterror.o $(LIBS) ${XLIBS}
 
 ptclient: ptclient.o display.o libprot.a $(LIBS)
        $(CC) ${CFLAGS} -o ptclient ptclient.o display.o libprot.a $(LIBS) ${XLIBS}
@@ -104,17 +114,18 @@ ptclient.o: ptclient.c ${INCLS} AFS_component_version_number.c
 ptuser.o: ptuser.c ${LINCLS}
 
 pterror.h pterror.c: pterror.et
-       $(RM) -f pterror.h pterror.c; ${COMPILE_ET} pterror
+       $(RM) -f pterror.h pterror.c
+       ${COMPILE_ET} -p ${srcdir} pterror
 
-libprot.a: ${LIBOBJS} AFS_component_version_number.o
-       $(RM) -f libprot.a
-       $(AR) r libprot.a ${LIBOBJS} AFS_component_version_number.o
-       $(RANLIB) libprot.a
+libprot.a: ptuser.o pterror.o ptint.cs.o ptint.xdr.o AFS_component_version_number.o
+       $(RM) -f $@
+       $(AR) crv $@ ptuser.o pterror.o ptint.cs.o ptint.xdr.o AFS_component_version_number.o
+       $(RANLIB) $@
 
-pts: pts.o libprot.a ${SRCDIR}lib/afs/libcmd.a $(LIBS)
-       $(CC) ${CFLAGS} -o pts pts.o ${SRCDIR}lib/afs/libcmd.a libprot.a ${LIBS} ${XLIBS}
+pts: pts.o libprot.a ${TOP_LIBDIR}/libcmd.a $(LIBS)
+       $(CC) ${CFLAGS} -o pts pts.o ${TOP_LIBDIR}/libcmd.a libprot.a ${LIBS} ${XLIBS}
 
-pts.o: pts.c ${LINCLS} ${SRCDIR}include/afs/cmd.h AFS_component_version_number.c
+pts.o: pts.c ${LINCLS} ${TOP_INCDIR}/afs/cmd.h AFS_component_version_number.c
 
 readgroup: readgroup.o libprot.a $(LIBS)
        $(CC) ${CFLAGS} -o readgroup readgroup.o libprot.a ${LIBS} ${XLIBS}
@@ -126,63 +137,184 @@ readpwd: readpwd.o libprot.a $(LIBS)
 
 readpwd.o: readpwd.c ${LINCLS} AFS_component_version_number.c
 
-testpt: testpt.o libprot.a ${SRCDIR}lib/afs/libcmd.a $(LIBS)
+testpt: testpt.o libprot.a ${TOP_LIBDIR}/libcmd.a $(LIBS)
        case "$(SYS_NAME)" in \
-       ppc_darwin_12 ) \
-               $(CC) ${CFLAGS} -o testpt testpt.o ${SRCDIR}lib/afs/libcmd.a libprot.a $(LIBS) ;; \
+       *_darwin_12 ) \
+               $(CC) ${CFLAGS} -o testpt testpt.o ${TOP_LIBDIR}/libcmd.a libprot.a $(LIBS) ;; \
        * ) \
-               $(CC) ${CFLAGS} -o testpt testpt.o -lm ${SRCDIR}lib/afs/libcmd.a libprot.a $(LIBS) ${XLIBS} ;; \
+               $(CC) ${CFLAGS} -o testpt testpt.o -lm ${TOP_LIBDIR}/libcmd.a libprot.a $(LIBS) ${XLIBS} ;; \
        esac
 
-testpt.o: testpt.c ${INCLS} ${SRCDIR}include/afs/cmd.h AFS_component_version_number.c
+testpt.o: testpt.c ${INCLS} ${TOP_INCDIR}/afs/cmd.h AFS_component_version_number.c
 
-pt_util: pt_util.o ptutils.o ubik.o utils.o libprot.a $(LIBS)
-       $(CC) ${CFLAGS} -o pt_util pt_util.o ptutils.o ubik.o utils.o libprot.a $(LIBS) ${XLIBS}
+pt_util: pt_util.o ptutils.o ubik.o utils.o map.o libprot.a $(LIBS)
+       $(CC) ${CFLAGS} -o pt_util pt_util.o ptutils.o ubik.o utils.o map.o libprot.a ${TOP_LIBDIR}/libcmd.a $(LIBS) ${XLIBS}
 
 ubik.o: ubik.c ${INCLS}
 
-system: install
+prerror.h: pterror.h
+       ${INSTALL} $? $@
+       echo '#define ERROR_TABLE_BASE_pr ERROR_TABLE_BASE_PT' >> $@
+
+#
+# Installation targets
+#
+install: \
+       ${DESTDIR}${afssrvlibexecdir}/ptserver \
+       ${DESTDIR}${afssrvbindir}/pts \
+       ${DESTDIR}${bindir}/pts \
+       ${DESTDIR}${afssrvsbindir}/pt_util \
+       ${DESTDIR}${afssrvsbindir}/prdb_check \
+       ${DESTDIR}${libdir}/afs/libprot.a \
+       ${DESTDIR}${includedir}/afs/prclient.h \
+       ${DESTDIR}${includedir}/afs/prerror.h \
+       ${DESTDIR}${includedir}/afs/print.h \
+       ${DESTDIR}${includedir}/afs/prserver.h \
+       ${DESTDIR}${includedir}/afs/ptclient.h \
+       ${DESTDIR}${includedir}/afs/ptuser.h \
+       ${DESTDIR}${includedir}/afs/pterror.h \
+       ${DESTDIR}${includedir}/afs/ptint.h \
+       ${DESTDIR}${includedir}/afs/ptserver.h
+
+${DEST}/root.server/usr/afs/bin/ptserver: ptserver
+       ${INSTALL} $? $@
+
+${DEST}/bin/pts ${DEST}/root.server/usr/afs/bin/pts: pts
+       ${INSTALL} $? $@
+
+${DEST}/root.server/usr/afs/bin/pt_util: pt_util
+       ${INSTALL} $? $@
+
+${DEST}/lib/afs/libprot.a: libprot.a
+       ${INSTALL} $? $@
+
+${DEST}/etc/prdb_check: db_verify
+       ${INSTALL} -f $? $@
+
+${DEST}/include/afs/prclient.h: ptclient.h
+       ${INSTALL} $? $@
+
+${DEST}/include/afs/prerror.h: pterror.h
+       ${INSTALL} $? $@
+
+${DEST}/include/afs/print.h: ptint.h
+       ${INSTALL} $? $@
+
+${DEST}/include/afs/prserver.h: ptserver.h
+       ${INSTALL} $? $@
+
+${DEST}/include/afs/ptserver.h: ptserver.h
+       ${INSTALL} $? $@
+
+${DEST}/include/afs/ptint.h: ptint.h
+       ${INSTALL} $? $@
+
+${DEST}/include/afs/pterror.h: pterror.h
+       ${INSTALL} $? $@
+
+${DEST}/include/afs/ptclient.h: ptclient.h
+       ${INSTALL} $? $@
+
+${DEST}/include/afs/ptuser.h: ptuser.h
+       ${INSTALL} $? $@
+
+#
+# Misc. targets
+#
+clean:
+       $(RM) -f *.a *.o ptserver ptint.cs.c ptint.ss.c ptclient ptint.xdr.c ptint.h \
+       libprot.a pts readgroup readpwd db_verify testpt pt_util pterror.h pterror.c \
+       core AFS_component_version_number.c Kptint.cs.c Kptint.h Kptint.xdr.c
+
+include ../config/Makefile.version
+${DESTDIR}${afssrvlibexecdir}/ptserver: ptserver
+       ${INSTALL} $? $@
+
+${DESTDIR}${afssrvbindir}/pts: pts
+       ${INSTALL} $? $@
+
+${DESTDIR}${bindir}/pts: pts
+       ${INSTALL} $? $@
+
+${DESTDIR}${afssrvsbindir}/pt_util: pt_util
+       ${INSTALL} $? $@
+
+${DESTDIR}${afssrvsbindir}/prdb_check: db_verify
+       ${INSTALL} -f $? $@
 
-kinstall:
-       @echo No $@ source here.
+${DESTDIR}${libdir}/afs/libprot.a: libprot.a
+       ${INSTALL} $? $@
+
+${TOP_LIBDIR}/libprot.a: libprot.a
+       ${INSTALL} $? $@
 
-ukinstall webinstall: ${UKSRCS} Kptint.h Kptint.cs.c Kptint.xdr.c
-       set ${UKERNELDIR}afs; $(MKDIR_IF_NEEDED)
-       ${INSTALL} Kptint.h ${UKERNELDIR}afsint/ptint.h
-       ${INSTALL} Kptint.cs.c ${UKERNELDIR}afsint/ptint.cs.c
-       ${INSTALL} Kptint.xdr.c ${UKERNELDIR}afsint/ptint.xdr.c
-       ${INSTALL} ${UKSRCS} ${UKERNELDIR}afs
+${DESTDIR}${includedir}/afs/prclient.h: ptclient.h
+       ${INSTALL} $? $@
 
-all: ptclient libprot.a pts db_verify readgroup readpwd testpt pt_util
+${TOP_INCDIR}/afs/prclient.h: ptclient.h
+       ${INSTALL} $? $@
 
-${DESTDIR}root.server/usr/afs/bin/ptserver: ptserver
+${DESTDIR}${includedir}/afs/prerror.h: pterror.h
        ${INSTALL} $? $@
 
-${DESTDIR}bin/pts ${DESTDIR}root.server/usr/afs/bin/pts: pts
+${TOP_INCDIR}/afs/prerror.h: pterror.h
        ${INSTALL} $? $@
 
-${DESTDIR}root.server/usr/afs/bin/pt_util: pt_util
+${DESTDIR}${includedir}/afs/print.h: ptint.h
        ${INSTALL} $? $@
 
-${DESTDIR}lib/afs/libprot.a: libprot.a
-       ${INSTALL}   $? $@
+${TOP_INCDIR}/afs/print.h: ptint.h
+       ${INSTALL} $? $@
 
+${DESTDIR}${includedir}/afs/prserver.h: ptserver.h
+       ${INSTALL} $? $@
 
-install: all ukinstall ${DESTDIR}root.server/usr/afs/bin/ptserver ${DESTDIR}root.server/usr/afs/bin/pts ${DESTDIR}bin/pts ${DESTDIR}lib/afs/libprot.a ${DESTDIR}root.server/usr/afs/bin/pt_util
-       ${INSTALL} libprot.a ${DESTDIR}lib/afs/libprot.a
-       ${INSTALL} ptserver.h ptint.h pterror.h ptclient.h ${DESTDIR}include/afs
-       ${INSTALL} ptserver.h ${DESTDIR}include/afs/prserver.h
-       ${INSTALL} ptint.h ${DESTDIR}include/afs/print.h
-       ${INSTALL} pterror.h ${DESTDIR}include/afs/prerror.h
-       ${INSTALL} ptclient.h ${DESTDIR}include/afs/prclient.h
-       ${INSTALL} -f db_verify ${DESTDIR}etc/prdb_check
-       echo '#define ERROR_TABLE_BASE_pr ERROR_TABLE_BASE_pt' >> ${DESTDIR}include/afs/prerror.h
+${TOP_INCDIR}/afs/prserver.h: ptserver.h
+       ${INSTALL} $? $@
 
-libinstall: ${DESTDIR}lib/afs/libprot.a
-       ${INSTALL} libprot.a ${DESTDIR}lib/afs/libprot.a
-       ${INSTALL} ptserver.h ptint.h pterror.h ptclient.h ${DESTDIR}include/afs
-       ${INSTALL} ptserver.h ${DESTDIR}include/afs/prserver.h
-       ${INSTALL} ptint.h ${DESTDIR}include/afs/print.h
-       ${INSTALL} pterror.h ${DESTDIR}include/afs/prerror.h
-       ${INSTALL} ptclient.h ${DESTDIR}include/afs/prclient.h
+${DESTDIR}${includedir}/afs/ptclient.h: ptclient.h
+       ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/ptuser.h: ptuser.h
+       ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/ptclient.h: ptclient.h
+       ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/ptuser.h: ptuser.h
+       ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/pterror.h: pterror.h
+       ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/pterror.h: pterror.h
+       ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/ptint.h: ptint.h
+       ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/ptint.h: ptint.h
+       ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/ptserver.h: ptserver.h
+       ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/ptserver.h: ptserver.h
+       ${INSTALL} $? $@
 
+dest: \
+       ${DEST}/root.server/usr/afs/bin/ptserver \
+       ${DEST}/root.server/usr/afs/bin/pts \
+       ${DEST}/bin/pts \
+       ${DEST}/root.server/usr/afs/bin/pt_util \
+       ${DEST}/etc/prdb_check \
+       ${DEST}/lib/afs/libprot.a \
+       ${DEST}/include/afs/prclient.h \
+       ${DEST}/include/afs/prerror.h \
+       ${DEST}/include/afs/print.h \
+       ${DEST}/include/afs/prserver.h \
+       ${DEST}/include/afs/ptclient.h \
+       ${DEST}/include/afs/ptuser.h \
+       ${DEST}/include/afs/pterror.h \
+       ${DEST}/include/afs/ptint.h \
+       ${DEST}/include/afs/ptserver.h