auth: local realms configuration
[openafs.git] / src / auth / Makefile.in
index 1c8bfe4..8f2cf1c 100644 (file)
 # 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}
-
-KERNELDIR = ../libafs/
-UKERNELDIR = ../libuafs/
-COMPILE_ET = ${SRCDIR}/bin/compile_et
-OBJS= cellconfig.o ktc.o userok.o writeconfig.o authcon.o \
-    acfg_errors.o ktc_errors.o
-KOBJS= cellconfig.o ktc.krb.o userok.o writeconfig.o authcon.o \
-    acfg_errors.o ktc_errors.o
-
-CFLAGS=-g -I${TOP_SRCDIR}/config -I${SRCDIR}/include ${XCFLAGS} 
-LIBS= libauth.a ${DESTDIR}/lib/afs/libsys.a \
-      ${DESTDIR}/lib/librxkad.a ${DESTDIR}/lib/libdes.a \
-      ${DESTDIR}/lib/librx.a ${DESTDIR}/lib/afs/libsys.a \
-      ${DESTDIR}/lib/liblwp.a ${SRCDIR}/lib/afs/util.a ${XLIBS}
-INCLS=cellconfig.h auth.h keys.h
+srcdir=@srcdir@
+include @TOP_OBJDIR@/src/config/Makefile.config
+include @TOP_OBJDIR@/src/config/Makefile.lwp
+
+
+OBJS= cellconfig.o keys.o ktc.o userok.o writeconfig.o authcon.o \
+    acfg_errors.o ktc_errors.o token.xdr.o token.o realms.o
+KOBJS= cellconfig.o keys.o ktc.krb.o userok.o writeconfig.o authcon.o \
+    acfg_errors.o ktc_errors.o token.xdr.o token.o realms.o
+
+LIBS=libauth.a \
+      ${TOP_LIBDIR}/librxkad.a \
+      ${TOP_LIBDIR}/librx.a \
+      ${TOP_LIBDIR}/libsys.a \
+      ${TOP_LIBDIR}/liblwp.a \
+      ${TOP_LIBDIR}/util.a
+
+INCLS=cellconfig.h auth.h keys.h internal.h
 KSRCS=auth.h
 UKSRCS=${KSRCS} cellconfig.h acfg_errors.c keys.h cellconfig.c \
        ktc.c authcon.c ktc_errors.c
 
-all: install
+all: ${TOP_LIBDIR}/libauth.a ${TOP_LIBDIR}/libauth.krb.a depinstall
+
+depinstall: ${TOP_INCDIR}/afs/keys.h \
+       ${TOP_INCDIR}/afs/cellconfig.h \
+       ${TOP_INCDIR}/afs/auth.h \
+       ${TOP_INCDIR}/afs/ktc.h \
+       ${TOP_INCDIR}/afs/token.h \
+       token.h \
+       Ktoken.xdr.c \
+       token.xdr.c
+
+${TOP_INCDIR}/afs/token.h: token.h
+       ${INSTALL_DATA} $? $@
+
+generated: acfg_errors.c cellconfig.h ktc_errors.c auth.h
+
+${TOP_INCDIR}/afs/keys.h: keys.h
+       ${INSTALL_DATA} $? $@
+
+${TOP_INCDIR}/afs/cellconfig.h: cellconfig.h
+       ${INSTALL_DATA} cellconfig.h $@
+
+${TOP_INCDIR}/afs/auth.h: auth.h
+       ${INSTALL_DATA} $? $@
+
+${TOP_INCDIR}/afs/ktc.h: ktc.h
+       ${INSTALL_DATA} $? $@
+
+${TOP_LIBDIR}/libauth.a: libauth.a
+       ${INSTALL_DATA} libauth.a $@
+
+${TOP_LIBDIR}/libauth.krb.a: libauth.krb.a
+       ${INSTALL_DATA} libauth.krb.a $@
 
 cellconfig.o: cellconfig.c ${INCLS}
-ktc.o: ktc.c ${INCLS} ${SRCDIR}/include/afs/vice.h
+keys.o: keys.c ${INCLS}
+ktc.o: ktc.c ${INCLS} ${TOP_INCDIR}/afs/vice.h
 writeconfig.o: writeconfig.c ${INCLS}
 authcon.o: authcon.c ${INCLS}
 userok.o: userok.c ${INCLS}
 cellconfig.o: cellconfig.c ${INCLS}
 copyauth.o: copyauth.c ${INCLS} AFS_component_version_number.o
 setkey.o: setkey.c ${INCLS} AFS_component_version_number.o
+realms.o: realms.c ${INCLS}
 
-ktc.krb.o: ktc.c ${INCLS} ${SRCDIR}/include/afs/vice.h
-       ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ktc.c -o ktc.krb.o
+CFLAGS_ktc.krb.o = -DAFS_KERBEROS_ENV
+ktc.krb.o: ktc.c ${INCLS} ${TOP_INCDIR}/afs/vice.h
+       $(AFS_CCRULE) $(srcdir)/ktc.c
 
 libauth.a: $(OBJS) AFS_component_version_number.o
-       -rm -f libauth.a
-       ar rv libauth.a $(OBJS) AFS_component_version_number.o
+       -$(RM) -f libauth.a
+       $(AR) crv $@ $(OBJS) AFS_component_version_number.o
        $(RANLIB) libauth.a
 
 libauth.krb.a: $(KOBJS) AFS_component_version_number.o
-       -rm -f libauth.krb.a
-       ar rv libauth.krb.a $(KOBJS) AFS_component_version_number.o
-       $(RANLIB) libauth.krb.a
+       -$(RM) -f $@
+       $(AR) crv $@ $(KOBJS) AFS_component_version_number.o
+       $(RANLIB) $@
 
-copyauth: copyauth.o
-       $(CC) $(CFLAGS) -o copyauth copyauth.o ${LIBS}
+copyauth: copyauth.o ${LIBS}
+       $(AFS_LDRULE) copyauth.o ${LIBS} ${XLIBS}
 
-setkey: setkey.o
-       ${CC} $(CFLAGS) -o setkey setkey.o ${LIBS}
-
-acfg_errors.o: acfg_errors.c
+setkey: setkey.o ${LIBS}
+       $(AFS_LDRULE) setkey.o ${LIBS} ${XLIBS}
 
 acfg_errors.c cellconfig.h: acfg_errors.et cellconfig.p.h
-       rm -f cellconfig.h acfg_errors.c; ${COMPILE_ET} acfg_errors -h cellconfig
+       $(RM) -f cellconfig.h acfg_errors.c
+       ${COMPILE_ET} -p ${srcdir} acfg_errors -h cellconfig
 
-ktc_errors.o: ktc_errors.c
+ktc.o: token.h
 
 ktc_errors.c auth.h: ktc_errors.et auth.p.h
-       rm -f auth.h ktc_errors.c; ${COMPILE_ET} ktc_errors -h auth
-
-#
-# Install targets
-#
-kinstall: ${KERNELDIR}/afs/auth.h
-
-${KERNELDIR}/afs/auth.h: auth.h
-       ${INSTALL} $? $@
-
-ukinstall: \
-       ${UKERNELDIR}/afs/auth.h \
-       ${UKERNELDIR}/afs/cellconfig.h \
-       ${UKERNELDIR}/afs/acfg_errors.c \
-       ${UKERNELDIR}/afs/keys.h \
-       ${UKERNELDIR}/afs/cellconfig.c \
-       ${UKERNELDIR}/afs/ktc.c \
-       ${UKERNELDIR}/afs/authcon.c \
-       ${UKERNELDIR}/afs/ktc_errors.c
-
-${UKERNELDIR}/afs/auth.h: auth.h
-       ${INSTALL} $? $@
-
-${UKERNELDIR}/afs/cellconfig.h: cellconfig.h
-       ${INSTALL} $? $@
-
-${UKERNELDIR}/afs/cellconfig.c: cellconfig.c
-       ${INSTALL} $? $@
-
-${UKERNELDIR}/afs/acfg_errors.c: acfg_errors.c
-       ${INSTALL} $? $@
-
-${UKERNELDIR}/afs/keys.h: keys.h
-       ${INSTALL} $? $@
-
-${UKERNELDIR}/afs/ktc.c: ktc.c
-       ${INSTALL} $? $@
+       $(RM) -f auth.h ktc_errors.c
+       ${COMPILE_ET} -p ${srcdir} ktc_errors -h auth
 
-${UKERNELDIR}/afs/authcon.c: authcon.c
-       ${INSTALL} $? $@
+Ktoken.xdr.c: token.xg
+       $(RXGEN) -A -x -k -c -o $@ $(srcdir)/token.xg
 
-${UKERNELDIR}/afs/ktc_errors.c: ktc_errors.c
-       ${INSTALL} $? $@
+token.xdr.c: token.xg
+       $(RXGEN) -A -x -c -o $@ ${srcdir}/token.xg
 
-install: kinstall ukinstall \
-       ${DESTDIR}/lib/afs/libauth.a \
-       ${DESTDIR}/lib/afs/libauth.krb.a \
-       ${DESTDIR}/include/afs/keys.h \
-       ${DESTDIR}/include/afs/cellconfig.h \
-       ${DESTDIR}/include/afs/auth.h \
-       ${DESTDIR}/etc/copyauth \
-       setkey
+token.h : token.xg
+       $(RXGEN) -A -x -h -o $@ ${srcdir}/token.xg
 
-${DESTDIR}/lib/afs/libauth.a: libauth.a
-       ${INSTALL} $? $@
-
-${DESTDIR}/lib/afs/libauth.krb.a: libauth.krb.a
-       ${INSTALL} $? $@
-
-${DESTDIR}/etc/copyauth: copyauth
-       ${INSTALL} $? $@
-
-${DESTDIR}/include/afs/keys.h: keys.h
-       ${INSTALL} $? $@
-
-${DESTDIR}/include/afs/cellconfig.h: cellconfig.h
-       ${INSTALL} $? $@
-
-${DESTDIR}/include/afs/auth.h: auth.h
-       ${INSTALL} $? $@
+#
+# Install targets
+#
+install: libauth.a libauth.krb.a auth.h cellconfig.h
+       ${INSTALL} -d ${DESTDIR}${libdir}/afs
+       ${INSTALL} -d ${DESTDIR}${includedir}/afs
+       ${INSTALL_DATA} libauth.a ${DESTDIR}${libdir}/afs/libauth.a
+       ${INSTALL_DATA} libauth.krb.a ${DESTDIR}${libdir}/afs/libauth.krb.a
+       ${INSTALL_DATA} ${srcdir}/keys.h ${DESTDIR}${includedir}/afs/keys.h
+       ${INSTALL_DATA} cellconfig.h ${DESTDIR}${includedir}/afs/cellconfig.h
+       ${INSTALL_DATA} auth.h ${DESTDIR}${includedir}/afs/auth.h
+       ${INSTALL_DATA} ${srcdir}/ktc.h ${DESTDIR}${includedir}/afs/ktc.h
+
+dest: libauth.a libauth.krb.a auth.h cellconfig.h
+       ${INSTALL} -d ${DEST}/lib/afs
+       ${INSTALL} -d ${DEST}/include/afs
+       ${INSTALL_DATA} libauth.a ${DEST}/lib/afs/libauth.a
+       ${INSTALL_DATA} libauth.krb.a ${DEST}/lib/afs/libauth.krb.a
+       ${INSTALL_DATA} ${srcdir}/keys.h ${DEST}/include/afs/keys.h
+       ${INSTALL_DATA} cellconfig.h ${DEST}/include/afs/cellconfig.h
+       ${INSTALL_DATA} auth.h ${DEST}/include/afs/auth.h
+       ${INSTALL_DATA} ${srcdir}/ktc.h ${DEST}/include/afs/ktc.h
 
 #
 # Misc. targets
@@ -148,7 +141,8 @@ test:
        cd test; $(MAKE)
 
 clean:
-       rm -f *.o *.a copyauth setkey auth.h cellconfig.h acfg_errors.c ktc_errors.c core\
-       AFS_component_version_number.c
+       $(RM) -f *.o *.a copyauth setkey auth.h cellconfig.h acfg_errors.c \
+               ktc_errors.c token.h token.xdr.c core Ktoken.xdr.c \
+               AFS_component_version_number.c
 
 include ../config/Makefile.version