Add PIC variant for libuafs
[openafs.git] / src / util / Makefile.in
index 9750823..3a620ce 100644 (file)
@@ -7,21 +7,53 @@
 
 srcdir=@srcdir@
 include @TOP_OBJDIR@/src/config/Makefile.config
+include @TOP_OBJDIR@/src/config/Makefile.lwp
 
-objects = assert.o base64.o casestrcpy.o ktime.o volparse.o hostparse.o \
-        hputil.o kreltime.o isathing.o get_krbrlm.o uuid.o serverLog.o \
-        dirpath.o fileutil.o netutils.o flipbase64.o \
-        afs_atomlist.o afs_lhash.o snprintf.o ${REGEX_OBJ}
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+HELPER_SPLINT=@HELPER_SPLINT@
 
-all: includes \
-       ${TOP_LIBDIR}/util.a \
-       ${TOP_LIBDIR}/libafsutil.a \
-       sys
 
-includes: \
+objects = assert.o base64.o casestrcpy.o config_file.o ktime.o volparse.o \
+        hostparse.o exec.o \
+        hputil.o kreltime.o isathing.o get_krbrlm.o uuid.o serverLog.o \
+        dirpath.o fileutil.o netutils.o flipbase64.o fstab.o \
+        afs_atomlist.o afs_lhash.o snprintf.o pthread_glock.o \
+        tabular_output.o ${REGEX_OBJ}
+
+objects_pic = \
+       pic_assert.o \
+       pic_base64.o \
+       pic_casestrcpy.o \
+       pic_config_file.o \
+       pic_ktime.o \
+       pic_volparse.o \
+       pic_hostparse.o \
+       pic_exec.o \
+       pic_hputil.o \
+       pic_kreltime.o \
+       pic_isathing.o \
+       pic_get_krbrlm.o \
+       pic_uuid.o \
+       pic_serverLog.o \
+       pic_dirpath.o \
+       pic_fileutil.o \
+       pic_netutils.o \
+       pic_flipbase64.o \
+       pic_fstab.o \
+       pic_afs_atomlist.o \
+       pic_afs_lhash.o \
+       pic_snprintf.o \
+       pic_pthread_glock.o \
+       pic_tabular_output.o \
+       ${REGEX_OBJ_PIC}
+
+includes = \
        ${TOP_INCDIR}/afs/dirpath.h \
        ${TOP_INCDIR}/afs/pthread_nosigs.h \
-       ${TOP_INCDIR}/afs/assert.h \
+       ${TOP_INCDIR}/afs/afs_assert.h \
        ${TOP_INCDIR}/afs/errors.h \
        ${TOP_INCDIR}/afs/vice.h \
        ${TOP_INCDIR}/afs/remote.h \
@@ -34,294 +66,317 @@ includes: \
        ${TOP_INCDIR}/afs/pthread_glock.h \
        ${TOP_INCDIR}/afs/afs_atomlist.h \
        ${TOP_INCDIR}/afs/afs_lhash.h \
-       ${TOP_INCDIR}/potpourri.h 
-
-depinstall: includes
-
-dirpath.h: ${srcdir}/dirpath.hin Makefile
-       ( sed \
-               -e "s+@afsconfdir+${afsconfdir}+" \
-               -e "s+@viceetcdir+${viceetcdir}+" \
-               -e "s+@afssrvbindir+${afssrvbindir}+" \
-               -e "s+@afssrvsbindir+${afssrvsbindir}+" \
-               -e "s+@afssrvlibexecdir+${afssrvlibexecdir}+" \
-               -e "s+@afsdbdir+${afsdbdir}+" \
-               -e "s+@afslogsdir+${afslogsdir}+" \
-               -e "s+@afslocaldir+${afslocaldir}+" \
-               -e "s+@afsbackupdir+${afsbackupdir}+" \
-               -e "s+@afsbosconfigdir+${afsbosconfigdir}+" \
-               ${srcdir}/dirpath.hin >dirpath.h.tmp && \
-               mv dirpath.h.tmp dirpath.h )
-
-util.a: ${objects} AFS_component_version_number.o
-       $(RM) -f util.a
-       $(AR) crv util.a ${objects} AFS_component_version_number.o
-       $(RANLIB) util.a
-
-assert.o: ${srcdir}/assert.c ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/assert.c
-
-casestrcpy.o: ${srcdir}/casestrcpy.c ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/casestrcpy.c
-
-hputil.o: ${srcdir}/hputil.c ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/hputil.c
-
-flipbase64.o: ${srcdir}/flipbase64.c ${TOP_INCDIR}/afs/dirpath.h ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/flipbase64.c
-
-volparse.o: ${srcdir}/volparse.c ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/volparse.c
-
-snprintf.o: ${srcdir}/snprintf.c ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/snprintf.c
-
-base64.o: ${srcdir}/base64.c ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/base64.c
-
-hostparse.o: ${srcdir}/hostparse.c ${srcdir}/afsutil.h ${srcdir}/afsutil_prototypes.h ${TOP_INCDIR}/afs/dirpath.h
-       ${CC} ${CFLAGS} -c ${srcdir}/hostparse.c
-
-ktime.o: ${srcdir}/ktime.c ${TOP_INCDIR}/afs/dirpath.h ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/ktime.c
-
-kreltime.o: ${srcdir}/kreltime.c ${TOP_INCDIR}/afs/dirpath.h ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/kreltime.c
-
-get_krbrlm.o: ${srcdir}/get_krbrlm.c ${TOP_INCDIR}/afs/dirpath.h ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/get_krbrlm.c
-
-uuid.o: ${srcdir}/uuid.c ${TOP_INCDIR}/afs/dirpath.h ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/uuid.c
-
-sys.o: ${srcdir}/sys.c ${TOP_INCDIR}/afs/param.h AFS_component_version_number.c ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/sys.c
-
-sys: sys.o 
-       ${CC} ${LDFLAGS} -o sys sys.o
-
-isathing.o: ${srcdir}/isathing.c ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/isathing.c
-
-serverLog.o: ${srcdir}/serverLog.c ${TOP_INCDIR}/afs/dirpath.h ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/serverLog.c
-
-dirpath.o: ${srcdir}/dirpath.c ${TOP_INCDIR}/afs/dirpath.h ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/dirpath.c
-
-fileutil.o: ${srcdir}/fileutil.c ${srcdir}/fileutil.h ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/fileutil.c
-
-netutils.o: ${srcdir}/netutils.c ${srcdir}/netutils.h ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/netutils.c
+       ${TOP_INCDIR}/afs/softsig.h \
+       ${TOP_INCDIR}/afs/work_queue.h \
+       ${TOP_INCDIR}/afs/work_queue_types.h \
+       ${TOP_INCDIR}/afs/thread_pool.h \
+       ${TOP_INCDIR}/afs/thread_pool_types.h \
+       ${TOP_INCDIR}/afs/tabular_output.h \
+       ${TOP_INCDIR}/opr/queue.h
+
+all: ${includes} \
+       ${TOP_LIBDIR}/util.a \
+       ${TOP_LIBDIR}/libafsutil.a \
+       ${TOP_LIBDIR}/libafsutil_pic.a \
+       sys
 
-afs_atomlist.o: ${srcdir}/afs_atomlist.c ${srcdir}/afs_atomlist.h ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/afs_atomlist.c
+buildtools: ${TOP_LIBDIR}/libafsutil.a ${TOP_INCDIR}/afs/afsutil.h
+buildtools_clean: clean
 
-afs_lhash.o: ${srcdir}/afs_lhash.c ${srcdir}/afs_lhash.h ${srcdir}/afs_atomlist.h ${srcdir}/afsutil_prototypes.h
-       ${CC} ${CFLAGS} -c ${srcdir}/afs_lhash.c
-
-#
-# Install targets
-#
-KDIR=../libafs/afs
-UKDIR=../libuafs/afs
-
-install: \
-       ${DESTDIR}${includedir}/afs/dirpath.h \
-       ${DESTDIR}${includedir}/afs/pthread_nosigs.h \
-       ${DESTDIR}${includedir}/afs/assert.h \
-       ${DESTDIR}${includedir}/afs/errors.h \
-       ${DESTDIR}${includedir}/afs/vice.h \
-       ${DESTDIR}${includedir}/afs/remote.h \
-       ${DESTDIR}${includedir}/afs/ktime.h \
-       ${DESTDIR}${includedir}/afs/fileutil.h \
-       ${DESTDIR}${includedir}/afs/netutils.h \
-       ${DESTDIR}${includedir}/afs/packages.h \
-       ${DESTDIR}${includedir}/afs/afsutil.h \
-       ${DESTDIR}${includedir}/afs/afsutil_prototypes.h \
-       ${DESTDIR}${includedir}/afs/pthread_glock.h \
-       ${DESTDIR}${includedir}/afs/afs_atomlist.h \
-       ${DESTDIR}${includedir}/afs/afs_lhash.h \
-       ${DESTDIR}${includedir}/potpourri.h \
-       ${DESTDIR}${libdir}/afs/util.a \
-       ${DESTDIR}${libdir}/afs/libafsutil.a \
-       ${DESTDIR}${bindir}/sys
+depinstall: ${includes}
 
 ${TOP_INCDIR}/afs/dirpath.h: dirpath.h
-       ${INSTALL} $? $@
+       ${INSTALL_DATA} $? $@
 
 ${TOP_INCDIR}/afs/pthread_nosigs.h: ${srcdir}/pthread_nosigs.h
-       ${INSTALL} $? $@
+       ${INSTALL_DATA} $? $@
 
-${TOP_INCDIR}/afs/assert.h: ${srcdir}/assert.h
-       ${INSTALL} $? $@
+${TOP_INCDIR}/afs/afs_assert.h: ${srcdir}/afs_assert.h
+       ${INSTALL_DATA} $? $@
 
 ${TOP_INCDIR}/afs/errors.h: ${srcdir}/errors.h
-       ${INSTALL} $? $@
+       ${INSTALL_DATA} $? $@
 
 ${TOP_INCDIR}/afs/vice.h: ${srcdir}/vice.h
-       ${INSTALL} $? $@
+       ${INSTALL_DATA} $? $@
 
 ${TOP_INCDIR}/afs/remote.h: ${srcdir}/remote.h
-       ${INSTALL} $? $@
+       ${INSTALL_DATA} $? $@
 
 ${TOP_INCDIR}/afs/ktime.h: ${srcdir}/ktime.h
-       ${INSTALL} $? $@
+       ${INSTALL_DATA} $? $@
 
 ${TOP_INCDIR}/afs/fileutil.h: ${srcdir}/fileutil.h
-       ${INSTALL} $? $@
+       ${INSTALL_DATA} $? $@
 
 ${TOP_INCDIR}/afs/netutils.h: ${srcdir}/netutils.h
-       ${INSTALL} $? $@
+       ${INSTALL_DATA} $? $@
 
 ${TOP_INCDIR}/afs/packages.h: ${srcdir}/packages.h
-       ${INSTALL} $? $@
+       ${INSTALL_DATA} $? $@
 
 ${TOP_INCDIR}/afs/afsutil.h: ${srcdir}/afsutil.h
-       ${INSTALL} $? $@
+       ${INSTALL_DATA} $? $@
 
 ${TOP_INCDIR}/afs/afsutil_prototypes.h: ${srcdir}/afsutil_prototypes.h
-       ${INSTALL} $? $@
+       ${INSTALL_DATA} $? $@
 
 ${TOP_INCDIR}/afs/pthread_glock.h: ${srcdir}/pthread_glock.h
-       ${INSTALL} $? $@
+       ${INSTALL_DATA} $? $@
 
 ${TOP_INCDIR}/afs/afs_atomlist.h: ${srcdir}/afs_atomlist.h
-       ${INSTALL} $? $@
+       ${INSTALL_DATA} $? $@
 
 ${TOP_INCDIR}/afs/afs_lhash.h: ${srcdir}/afs_lhash.h
-       ${INSTALL} $? $@
-
-${TOP_INCDIR}/potpourri.h: ${srcdir}/potpourri.h
-       ${INSTALL} $? $@
+       ${INSTALL_DATA} $? $@
 
+${TOP_INCDIR}/afs/softsig.h: ${srcdir}/softsig.h
+       ${INSTALL_DATA} $? $@
 
-${TOP_LIBDIR}/util.a: util.a
-       ${INSTALL} $? $@
+${TOP_INCDIR}/afs/work_queue.h: ${srcdir}/work_queue.h
+       ${INSTALL_DATA} $? $@
 
-${TOP_LIBDIR}/libafsutil.a: util.a
-       ${INSTALL} $? $@
+${TOP_INCDIR}/afs/work_queue_types.h: ${srcdir}/work_queue_types.h
+       ${INSTALL_DATA} $? $@
 
+${TOP_INCDIR}/afs/thread_pool.h: ${srcdir}/thread_pool.h
+       ${INSTALL_DATA} $? $@
 
-${DESTDIR}${includedir}/afs/dirpath.h: dirpath.h
-       ${INSTALL} $? $@
+${TOP_INCDIR}/afs/thread_pool_types.h: ${srcdir}/thread_pool_types.h
+       ${INSTALL_DATA} $? $@
 
-${DESTDIR}${includedir}/afs/pthread_nosigs.h: ${srcdir}/pthread_nosigs.h
-       ${INSTALL} $? $@
+${TOP_INCDIR}/afs/tabular_output.h: ${srcdir}/tabular_output.h
+       ${INSTALL_DATA} $? $@
 
-${DESTDIR}${includedir}/afs/assert.h: ${srcdir}/assert.h
-       ${INSTALL} $? $@
+${TOP_INCDIR}/potpourri.h: ${srcdir}/potpourri.h
+       ${INSTALL_DATA} $? $@
 
-${DESTDIR}${includedir}/afs/errors.h: ${srcdir}/errors.h
-       ${INSTALL} $? $@
+${TOP_INCDIR}/opr/queue.h: ${srcdir}/queue.h
+       ${INSTALL_DATA} $? $@
 
-${DESTDIR}${includedir}/afs/vice.h: ${srcdir}/vice.h
-       ${INSTALL} $? $@
+${TOP_LIBDIR}/util.a: util.a
+       ${INSTALL_DATA} $? $@
 
-${DESTDIR}${includedir}/afs/remote.h: ${srcdir}/remote.h
-       ${INSTALL} $? $@
+${TOP_LIBDIR}/libafsutil.a: util.a
+       ${INSTALL_DATA} $? $@
 
-${DESTDIR}${includedir}/afs/ktime.h: ${srcdir}/ktime.h
-       ${INSTALL} $? $@
+${TOP_LIBDIR}/libafsutil_pic.a: util_pic.a
+       ${INSTALL_DATA} $? $@
 
-${DESTDIR}${includedir}/afs/fileutil.h: ${srcdir}/fileutil.h
-       ${INSTALL} $? $@
+# Use " as the sed boundary character because we lose anyway if that occurs
+# in path names.
+dirpath.h: ${srcdir}/dirpath.hin Makefile
+       ( sed \
+               -e 's"@afsconfdir"${afsconfdir}"' \
+               -e 's"@viceetcdir"${viceetcdir}"' \
+               -e 's"@afssrvbindir"${afssrvbindir}"' \
+               -e 's"@afssrvsbindir"${afssrvsbindir}"' \
+               -e 's"@afssrvlibexecdir"${afssrvlibexecdir}"' \
+               -e 's"@afsdbdir"${afsdbdir}"' \
+               -e 's"@afslogsdir"${afslogsdir}"' \
+               -e 's"@afslocaldir"${afslocaldir}"' \
+               -e 's"@afsbackupdir"${afsbackupdir}"' \
+               -e 's"@afsbosconfigdir"${afsbosconfigdir}"' \
+               -e 's"@afsdatadir"${afsdatadir}"' \
+               ${srcdir}/dirpath.hin >dirpath.h.tmp && \
+               if cmp dirpath.h.tmp dirpath.h >/dev/null ; then : ; else \
+               mv dirpath.h.tmp dirpath.h ; fi)
+       rm -f dirpath.h.tmp
 
-${DESTDIR}${includedir}/afs/netutils.h: ${srcdir}/netutils.h
-       ${INSTALL} $? $@
+util.a: ${objects} AFS_component_version_number.o
+       $(RM) -f util.a
+       $(AR) crv util.a ${objects} AFS_component_version_number.o
+       $(RANLIB) util.a
 
-${DESTDIR}${includedir}/afs/packages.h: ${srcdir}/packages.h
-       ${INSTALL} $? $@
+util_pic.a: ${objects_pic} AFS_component_version_number_pic.o
+       $(RM) -f util_pic.a
+       $(AR) crv util_pic.a ${objects_pic} AFS_component_version_number_pic.o
+       $(RANLIB) util_pic.a
 
-${DESTDIR}${includedir}/afs/afsutil.h: ${srcdir}/afsutil.h
-       ${INSTALL} $? $@
+pthread_glock.o: ${srcdir}/pthread_glock.c ${includes}
+       ${MT_CC} $(COMMON_CFLAGS) ${MT_CFLAGS} -c ${srcdir}/pthread_glock.c
 
-${DESTDIR}${includedir}/afs/afsutil_prototypes.h: ${srcdir}/afsutil_prototypes.h
-       ${INSTALL} $? $@
+${objects}: ${includes}
 
-${DESTDIR}${includedir}/afs/pthread_glock.h: ${srcdir}/pthread_glock.h
-       ${INSTALL} $? $@
+CFLAGS_AFS_component_version_number_pic.o = -fPIC
+AFS_component_version_number_pic.o: AFS_component_version_number.c
+       $(AFS_CCRULE) AFS_component_version_number.c
 
-${DESTDIR}${includedir}/afs/afs_atomlist.h: ${srcdir}/afs_atomlist.h
-       ${INSTALL} $? $@
+config_file.o: ${TOP_SRCDIR}/external/heimdal/krb5/config_file.c krb5_locl.h
+       $(AFS_CCRULE) -c ${TOP_SRCDIR}/external/heimdal/krb5/config_file.c 
 
-${DESTDIR}${includedir}/afs/afs_lhash.h: ${srcdir}/afs_lhash.h
-       ${INSTALL} $? $@
+sys.o: sys.c AFS_component_version_number.c ${includes}
 
-${DESTDIR}${includedir}/potpourri.h: ${srcdir}/potpourri.h
-       ${INSTALL} $? $@
+sys: sys.o 
+       $(AFS_LDRULE) sys.o
 
+# PIC objects build rules
+PICFLAGS = -fPIC
+CFLAGS_assert.o = $(PICFLAGS)
+pic_assert.o: ${srcdir}/assert.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/assert.c
 
-${DESTDIR}${libdir}/afs/util.a: util.a
-       ${INSTALL} $? $@
+CFLAGS_base64.o = $(PICFLAGS)
+pic_base64.o: ${srcdir}/base64.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/base64.c
 
-${DESTDIR}${libdir}/afs/libafsutil.a: util.a
-       ${INSTALL} $? $@
+CFLAGS_casestrcpy.o = $(PICFLAGS)
+pic_casestrcpy.o: ${srcdir}/casestrcpy.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/casestrcpy.c
 
+CFLAGS_config_file.o = $(PICFLAGS)
+pic_config_file.o: ${TOP_SRCDIR}/external/heimdal/krb5/config_file.c krb5_locl.h
+       $(AFS_CCRULE) ${TOP_SRCDIR}/external/heimdal/krb5/config_file.c
 
-${DESTDIR}${bindir}/sys: sys
-       ${INSTALL} $? $@
+CFLAGS_ktime.o = $(PICFLAGS)
+pic_ktime.o: ${srcdir}/ktime.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/ktime.c
 
+CFLAGS_volparse.o = $(PICFLAGS)
+pic_volparse.o: ${srcdir}/volparse.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/volparse.c
 
-${DEST}/include/afs/dirpath.h: dirpath.h
-       ${INSTALL} $? $@
+CFLAGS_hostparse.o = $(PICFLAGS)
+pic_hostparse.o: ${srcdir}/hostparse.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/hostparse.c
 
-${DEST}/include/afs/pthread_nosigs.h: ${srcdir}/pthread_nosigs.h
-       ${INSTALL} $? $@
+CFLAGS_exec.o = $(PICFLAGS)
+pic_exec.o: ${srcdir}/exec.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/exec.c
 
-${DEST}/include/afs/assert.h: ${srcdir}/assert.h
-       ${INSTALL} $? $@
+CFLAGS_hputil.o = $(PICFLAGS)
+pic_hputil.o: ${srcdir}/hputil.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/hputil.c
 
-${DEST}/include/afs/errors.h: ${srcdir}/errors.h
-       ${INSTALL} $? $@
+CFLAGS_kreltime.o = $(PICFLAGS)
+pic_kreltime.o: ${srcdir}/kreltime.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/kreltime.c
 
-${DEST}/include/afs/vice.h: ${srcdir}/vice.h
-       ${INSTALL} $? $@
+CFLAGS_isathing.o = $(PICFLAGS)
+pic_isathing.o: ${srcdir}/isathing.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/isathing.c
 
-${DEST}/include/afs/remote.h: ${srcdir}/remote.h
-       ${INSTALL} $? $@
+CFLAGS_get_krbrlm.o = $(PICFLAGS)
+pic_get_krbrlm.o: ${srcdir}/get_krbrlm.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/get_krbrlm.c
 
-${DEST}/include/afs/ktime.h: ${srcdir}/ktime.h
-       ${INSTALL} $? $@
+CFLAGS_uuid.o = $(PICFLAGS)
+pic_uuid.o: ${srcdir}/uuid.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/uuid.c
 
-${DEST}/include/afs/fileutil.h: ${srcdir}/fileutil.h
-       ${INSTALL} $? $@
+CFLAGS_serverLog.o = $(PICFLAGS)
+pic_serverLog.o: ${srcdir}/serverLog.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/serverLog.c
 
-${DEST}/include/afs/netutils.h: ${srcdir}/netutils.h
-       ${INSTALL} $? $@
+CFLAGS_dirpath.o = $(PICFLAGS)
+pic_dirpath.o: ${srcdir}/dirpath.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/dirpath.c
 
-${DEST}/include/afs/packages.h: ${srcdir}/packages.h
-       ${INSTALL} $? $@
+CFLAGS_fileutil.o = $(PICFLAGS)
+pic_fileutil.o: ${srcdir}/fileutil.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/fileutil.c
 
-${DEST}/include/afs/afsutil.h: ${srcdir}/afsutil.h
-       ${INSTALL} $? $@
+CFLAGS_netutils.o = $(PICFLAGS)
+pic_netutils.o: ${srcdir}/netutils.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/netutils.c
 
-${DEST}/include/afs/afsutil_prototypes.h: ${srcdir}/afsutil_prototypes.h
-       ${INSTALL} $? $@
+CFLAGS_flipbase64.o = $(PICFLAGS)
+pic_flipbase64.o: ${srcdir}/flipbase64.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/flipbase64.c
 
-${DEST}/include/afs/pthread_glock.h: ${srcdir}/pthread_glock.h
-       ${INSTALL} $? $@
+CFLAGS_fstab.o = $(PICFLAGS)
+pic_fstab.o: ${srcdir}/fstab.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/fstab.c
 
-${DEST}/include/afs/afs_atomlist.h: ${srcdir}/afs_atomlist.h
-       ${INSTALL} $? $@
+CFLAGS_afs_atomlist.o = $(PICFLAGS)
+pic_afs_atomlist.o: ${srcdir}/afs_atomlist.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/afs_atomlist.c
 
-${DEST}/include/afs/afs_lhash.h: ${srcdir}/afs_lhash.h
-       ${INSTALL} $? $@
+CFLAGS_afs_lhash.o = $(PICFLAGS)
+pic_afs_lhash.o: ${srcdir}/afs_lhash.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/afs_lhash.c
 
-${DEST}/include/potpourri.h: ${srcdir}/potpourri.h
-       ${INSTALL} $? $@
+CFLAGS_snprintf.o = $(PICFLAGS)
+pic_snprintf.o: ${srcdir}/snprintf.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/snprintf.c
 
+CFLAGS_pthread_glock.o = $(PICFLAGS)
+pic_pthread_glock.o: ${srcdir}/pthread_glock.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/pthread_glock.c
 
-${DEST}/lib/afs/util.a: util.a
-       ${INSTALL} $? $@
+CFLAGS_tabular_output.o = $(PICFLAGS)
+pic_tabular_output.o: ${srcdir}/tabular_output.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/tabular_output.c
 
-${DEST}/lib/afs/libafsutil.a: util.a
-       ${INSTALL} $? $@
+CFLAGS_regex.o = $(PICFLAGS)
+pic_regex.o: ${srcdir}/regex.c ${includes}
+       $(AFS_CCRULE) ${srcdir}/regex.c
 
+#
+# Install targets
+#
+KDIR=../libafs/afs
+UKDIR=../libuafs/afs
 
-${DEST}/bin/sys: sys
-       ${INSTALL} $? $@
+install: dirpath.h util.a util_pic.a sys
+       ${INSTALL} -d ${DESTDIR}${includedir}/afs
+       ${INSTALL} -d ${DESTDIR}${libdir}/afs
+       ${INSTALL} -d ${DESTDIR}${bindir}
+       ${INSTALL_DATA} dirpath.h ${DESTDIR}${includedir}/afs/dirpath.h
+       ${INSTALL_DATA} ${srcdir}/pthread_nosigs.h ${DESTDIR}${includedir}/afs/pthread_nosigs.h
+       ${INSTALL_DATA} ${srcdir}/afs_assert.h ${DESTDIR}${includedir}/afs/afs_assert.h
+       ${INSTALL_DATA} ${srcdir}/errors.h ${DESTDIR}${includedir}/afs/errors.h
+       ${INSTALL_DATA} ${srcdir}/vice.h ${DESTDIR}${includedir}/afs/vice.h
+       ${INSTALL_DATA} ${srcdir}/remote.h ${DESTDIR}${includedir}/afs/remote.h
+       ${INSTALL_DATA} ${srcdir}/ktime.h ${DESTDIR}${includedir}/afs/ktime.h
+       ${INSTALL_DATA} ${srcdir}/fileutil.h ${DESTDIR}${includedir}/afs/fileutil.h
+       ${INSTALL_DATA} ${srcdir}/netutils.h ${DESTDIR}${includedir}/afs/netutils.h
+       ${INSTALL_DATA} ${srcdir}/packages.h ${DESTDIR}${includedir}/afs/packages.h
+       ${INSTALL_DATA} ${srcdir}/afsutil.h ${DESTDIR}${includedir}/afs/afsutil.h
+       ${INSTALL_DATA} ${srcdir}/afsutil_prototypes.h ${DESTDIR}${includedir}/afs/afsutil_prototypes.h
+       ${INSTALL_DATA} ${srcdir}/pthread_glock.h ${DESTDIR}${includedir}/afs/pthread_glock.h
+       ${INSTALL_DATA} ${srcdir}/afs_atomlist.h ${DESTDIR}${includedir}/afs/afs_atomlist.h
+       ${INSTALL_DATA} ${srcdir}/afs_lhash.h ${DESTDIR}${includedir}/afs/afs_lhash.h
+       ${INSTALL_DATA} ${srcdir}/softsig.h ${DESTDIR}${includedir}/afs/softsig.h
+       ${INSTALL_DATA} ${srcdir}/work_queue.h ${DESTDIR}${includedir}/afs/work_queue.h
+       ${INSTALL_DATA} ${srcdir}/work_queue_types.h ${DESTDIR}${includedir}/afs/work_queue_types.h
+       ${INSTALL_DATA} ${srcdir}/thread_pool.h ${DESTDIR}${includedir}/afs/thread_pool.h
+       ${INSTALL_DATA} ${srcdir}/thread_pool_types.h ${DESTDIR}${includedir}/afs/thread_pool_types.h
+       ${INSTALL_DATA} ${srcdir}/tabular_output.h ${DESTDIR}${includedir}/afs/tabular_output.h
+       ${INSTALL_DATA} util.a ${DESTDIR}${libdir}/afs/util.a
+       ${INSTALL_DATA} util.a ${DESTDIR}${libdir}/afs/libafsutil.a
+       ${INSTALL_DATA} util_pic.a ${DESTDIR}${libdir}/afs/libafsutil_pic.a
+       ${INSTALL_PROGRAM} sys ${DESTDIR}${bindir}/sys
+
+dest: dirpath.h util.a util_pic.a sys
+       ${INSTALL} -d ${DEST}/include/afs
+       ${INSTALL} -d ${DEST}/lib/afs
+       ${INSTALL} -d ${DEST}/bin
+       ${INSTALL_DATA} dirpath.h ${DEST}/include/afs/dirpath.h
+       ${INSTALL_DATA} ${srcdir}/pthread_nosigs.h ${DEST}/include/afs/pthread_nosigs.h
+       ${INSTALL_DATA} ${srcdir}/afs_assert.h ${DEST}/include/afs/afs_assert.h
+       ${INSTALL_DATA} ${srcdir}/errors.h ${DEST}/include/afs/errors.h
+       ${INSTALL_DATA} ${srcdir}/vice.h ${DEST}/include/afs/vice.h
+       ${INSTALL_DATA} ${srcdir}/remote.h ${DEST}/include/afs/remote.h
+       ${INSTALL_DATA} ${srcdir}/ktime.h ${DEST}/include/afs/ktime.h
+       ${INSTALL_DATA} ${srcdir}/fileutil.h ${DEST}/include/afs/fileutil.h
+       ${INSTALL_DATA} ${srcdir}/netutils.h ${DEST}/include/afs/netutils.h
+       ${INSTALL_DATA} ${srcdir}/packages.h ${DEST}/include/afs/packages.h
+       ${INSTALL_DATA} ${srcdir}/afsutil.h ${DEST}/include/afs/afsutil.h
+       ${INSTALL_DATA} ${srcdir}/afsutil_prototypes.h ${DEST}/include/afs/afsutil_prototypes.h
+       ${INSTALL_DATA} ${srcdir}/pthread_glock.h ${DEST}/include/afs/pthread_glock.h
+       ${INSTALL_DATA} ${srcdir}/afs_atomlist.h ${DEST}/include/afs/afs_atomlist.h
+       ${INSTALL_DATA} ${srcdir}/afs_lhash.h ${DEST}/include/afs/afs_lhash.h
+       ${INSTALL_DATA} ${srcdir}/softsig.h ${DEST}/include/afs/softsig.h
+       ${INSTALL_DATA} ${srcdir}/work_queue.h ${DEST}/include/afs/work_queue.h
+       ${INSTALL_DATA} ${srcdir}/work_queue_types.h ${DEST}/include/afs/work_queue_types.h
+       ${INSTALL_DATA} ${srcdir}/thread_pool.h ${DEST}/include/afs/thread_pool.h
+       ${INSTALL_DATA} ${srcdir}/thread_pool_types.h ${DEST}/include/afs/thread_pool_types.h
+       ${INSTALL_DATA} ${srcdir}/tabular_output.h ${DEST}/include/afs/tabular_output.h
+       ${INSTALL_DATA} util.a ${DEST}/lib/afs/util.a
+       ${INSTALL_DATA} util.a ${DEST}/lib/afs/libafsutil.a
+       ${INSTALL_DATA} util_pic.a ${DEST}/lib/afs/libafsutil_pic.a
+       ${INSTALL_PROGRAM} sys ${DEST}/bin/sys
 
 #
 # Misc targets
@@ -329,31 +384,16 @@ ${DEST}/bin/sys: sys
 
 clean:
        $(RM) -f ${objects} sys dirpath.h
-       $(RM) -f util.a *.o core AFS_component_version_number.c
+       $(RM) -f util.a util_pic.a *.o core AFS_component_version_number.c
 
 test:
        cd test; $(MAKE)
 
 include ../config/Makefile.version
 
-dest: \
-       ${DEST}/include/afs/dirpath.h \
-       ${DEST}/include/afs/pthread_nosigs.h \
-       ${DEST}/include/afs/assert.h \
-       ${DEST}/include/afs/errors.h \
-       ${DEST}/include/afs/vice.h \
-       ${DEST}/include/afs/remote.h \
-       ${DEST}/include/afs/ktime.h \
-       ${DEST}/include/afs/fileutil.h \
-       ${DEST}/include/afs/netutils.h \
-       ${DEST}/include/afs/packages.h \
-       ${DEST}/include/afs/afsutil.h \
-       ${DEST}/include/afs/afsutil_prototypes.h \
-       ${DEST}/include/afs/pthread_glock.h \
-       ${DEST}/include/afs/afs_atomlist.h \
-       ${DEST}/include/afs/afs_lhash.h \
-       ${DEST}/include/potpourri.h \
-       ${DEST}/lib/afs/util.a \
-       ${DEST}/lib/afs/libafsutil.a \
-       ${DEST}/bin/sys
-
+check-splint:
+       sh $(HELPER_SPLINT) $(CFLAGS) \
+           assert.c base64.c casestrcpy.c ktime.c volparse.c hostparse.c \
+           hputil.c kreltime.c isathing.c get_krbrlm.c uuid.c serverLog.c \
+           dirpath.c fileutil.c netutils.c flipbase64.c \
+           afs_atomlist.c afs_lhash.c snprintf.c fstab.c