# Copyright 2010, Your File System Inc # All rights reserved # # This software has been released under the terms of the BSD License # For details, see the LICENSE file in the top level source directory # API version. Must be incremented whenever something changes. LIBMAJOR=1 LIBMINOR=1 srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config include @TOP_OBJDIR@/src/config/Makefile.shared INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ HEADERS= ${TOP_INCDIR}/hcrypto/aes.h \ ${TOP_INCDIR}/hcrypto/des.h \ ${TOP_INCDIR}/hcrypto/engine.h \ ${TOP_INCDIR}/hcrypto/evp.h \ ${TOP_INCDIR}/hcrypto/evp-hcrypto.h \ ${TOP_INCDIR}/hcrypto/evp-cc.h \ ${TOP_INCDIR}/hcrypto/hmac.h \ ${TOP_INCDIR}/hcrypto/md2.h \ ${TOP_INCDIR}/hcrypto/md4.h \ ${TOP_INCDIR}/hcrypto/md5.h \ ${TOP_INCDIR}/hcrypto/rand.h \ ${TOP_INCDIR}/hcrypto/rc2.h \ ${TOP_INCDIR}/hcrypto/rc4.h \ ${TOP_INCDIR}/hcrypto/sha.h \ ${TOP_INCDIR}/hcrypto/ui.h UPSTREAM= ${TOP_SRCDIR}/external/heimdal MODULE_INCLUDE=-I${srcdir} -I${TOP_INCDIR}/hcrypto -I$(UPSTREAM)/hcrypto SHLIBOBJ= libafshcrypto.${SHLIB_SUFFIX}.${LIBMAJOR}.${LIBMINOR} all: $(ROKEN_HEADERS) ${HEADERS} ${TOP_LIBDIR}/${SHLIBOBJ} \ ${TOP_LIBDIR}/libafshcrypto.a \ ${TOP_LIBDIR}/libafshcrypto_lwp.a install: libafshcrypto.a ${SHLIBOBJ} ${TOP_OBJDIR}/src/config/shlib-install -d ${DESTDIR}${libdir} \ -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR} ${INSTALL_DATA} libafshcrypto.a ${DESTDIR}${libdir}/libafshcrypto.a dest: libafshcrypto.a ${SHLIBOBJ} ${TOP_OBJDIR}/src/config/shlib-install -d ${DEST}/lib \ -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR} ${INSTALL_DATA} libafshcrypto.a ${DEST}/lib/libafshcrypto.a clean: $(RM) -f ${OBJECTS} ${SHLIBOBJ} libafshcrypto.a libafshcrypto.exp \ test_cipher test_cipher.o hex.o COMMON_OBJS= aes.o camellia.o camellia-ntt.o des.o engine.o evp.o \ evp-hcrypto.o evp-cc.o hmac.o md2.o md4.o md5.o pkcs5.o \ rand-egd.o rand-timer.o rand-unix.o rand.o rc2.o rc4.o \ rijndael-alg-fst.o rnd_keys.o sha.o sha256.o sha512.o ui.o \ validate.o \ cloexec.o ct.o issuid.o net_read.o net_write.o warnerr.o OBJECTS = $(COMMON_OBJS) rand-fortuna.o $(ROKEN_LIBOBJS) LWP_OBJS = $(COMMON_OBJS) rand-fortuna_lwp.o $(ROKEN_LIBOBJS) LWPRULE=$(CC) $(AFS_CPPFLAGS) $(COMMON_CFLAGS) $(XCFLAGS) $(ARCHFLAGS) \ -I$(TOP_INCDIR)/hcrypto -I$(UPSTREAM)/hcrypto -c $? ${TOP_LIBDIR}/${SHLIBOBJ}: ${SHLIBOBJ} ${TOP_OBJDIR}/src/config/shlib-install -d ${TOP_LIBDIR} \ -l libafshcrypto -M ${LIBMAJOR} -m ${LIBMINOR} ${SHLIBOBJ}: ${OBJECTS} libafshcrypto.map ${TOP_OBJDIR}/src/config/shlib-build -d $(srcdir) -l libafshcrypto \ -M ${LIBMAJOR} -m ${LIBMINOR} -- \ ${OBJECTS} ${MT_LIBS} libafshcrypto.a: ${OBJECTS} $(RM) -f $@ $(AR) crv $@ ${OBJECTS} $(RANLIB) $@ libafshcrypto_lwp.a: $(LWP_OBJS) $(RM) -f $@ $(AR) crv $@ $(LWP_OBJS) $(RANLIB) $@ test_cipher: test_cipher.o hex.o libafshcrypto.a $(AFS_LDRULE) test_cipher.o hex.o libafshcrypto.a ${TOP_INCDIR}/hcrypto/aes.h: ${UPSTREAM}/hcrypto/aes.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/bn.h: ${UPSTREAM}/hcrypto/bn.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/des.h: ${UPSTREAM}/hcrypto/des.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/dh.h: ${UPSTREAM}/hcrypto/dh.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/dsa.h: ${UPSTREAM}/hcrypto/dsa.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/engine.h: engine.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/evp.h: ${UPSTREAM}/hcrypto/evp.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/evp-hcrypto.h: ${UPSTREAM}/hcrypto/evp-hcrypto.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/evp-cc.h: ${UPSTREAM}/hcrypto/evp-cc.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/hmac.h: ${UPSTREAM}/hcrypto/hmac.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/md2.h: ${UPSTREAM}/hcrypto/md2.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/md4.h: ${UPSTREAM}/hcrypto/md4.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/md5.h: ${UPSTREAM}/hcrypto/md5.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/pkcs12.h: ${UPSTREAM}/hcrypto/pkcs12.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/rand.h: ${UPSTREAM}/hcrypto/rand.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/rc2.h: ${UPSTREAM}/hcrypto/rc2.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/rc4.h: ${UPSTREAM}/hcrypto/rc4.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/rsa.h: ${UPSTREAM}/hcrypto/rsa.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/sha.h: ${UPSTREAM}/hcrypto/sha.h ${INSTALL_DATA} $? $@ ${TOP_INCDIR}/hcrypto/ui.h: ${UPSTREAM}/hcrypto/ui.h ${INSTALL_DATA} $? $@ ${TOP_LIBDIR}/libafshcrypto.a: libafshcrypto.a ${INSTALL_DATA} $? $@ ${TOP_LIBDIR}/libafshcrypto_lwp.a: libafshcrypto_lwp.a ${INSTALL_DATA} $? $@ # Pthread Targets CFLAGS_test_cipher.o= -I${UPSTREAM}/roken/ CFLAGS_rand-unix.o=@CFLAGS_NOERROR@ CFLAGS_evp.o=-DHAVE_CONFIG_H aes.o: ${UPSTREAM}/hcrypto/aes.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/aes.c bn.o: ${UPSTREAM}/hcrypto/bn.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/bn.c camellia.o: ${UPSTREAM}/hcrypto/camellia.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/camellia.c camellia-ntt.o: ${UPSTREAM}/hcrypto/camellia-ntt.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/camellia-ntt.c des.o: ${UPSTREAM}/hcrypto/des.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/des.c evp.o: ${UPSTREAM}/hcrypto/evp.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp.c evp-hcrypto.o: ${UPSTREAM}/hcrypto/evp-hcrypto.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp-hcrypto.c evp-cc.o: ${UPSTREAM}/hcrypto/evp-cc.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp-cc.c hmac.o: ${UPSTREAM}/hcrypto/hmac.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/hmac.c md2.o: ${UPSTREAM}/hcrypto/md2.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md2.c md4.o: ${UPSTREAM}/hcrypto/md4.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md4.c md5.o: ${UPSTREAM}/hcrypto/md5.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md5.c pkcs5.o: ${UPSTREAM}/hcrypto/pkcs5.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/pkcs5.c rand-egd.o: ${UPSTREAM}/hcrypto/rand-egd.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-egd.c rand-fortuna.o: ${UPSTREAM}/hcrypto/rand-fortuna.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-fortuna.c rand-timer.o: ${UPSTREAM}/hcrypto/rand-timer.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-timer.c rand-unix.o: ${UPSTREAM}/hcrypto/rand-unix.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-unix.c rand.o: ${UPSTREAM}/hcrypto/rand.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand.c rc2.o: ${UPSTREAM}/hcrypto/rc2.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rc2.c rc4.o: ${UPSTREAM}/hcrypto/rc4.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rc4.c rijndael-alg-fst.o: ${UPSTREAM}/hcrypto/rijndael-alg-fst.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rijndael-alg-fst.c rnd_keys.o: ${UPSTREAM}/hcrypto/rnd_keys.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rnd_keys.c sha.o: ${UPSTREAM}/hcrypto/sha.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/sha.c sha256.o: ${UPSTREAM}/hcrypto/sha256.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/sha256.c sha512.o: ${UPSTREAM}/hcrypto/sha512.c ${AFS_CCRULE} $(UPSTREAM)/hcrypto/sha512.c ui.o: ${UPSTREAM}/hcrypto/ui.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/ui.c validate.o: ${UPSTREAM}/hcrypto/validate.c ${AFS_CCRULE} ${UPSTREAM}/hcrypto/validate.c test_cipher.o: ${UPSTREAM}/hcrypto/test_cipher.c $(AFS_CCRULE) $(UPSTREAM)/hcrypto/test_cipher.c # These bits of libroken are new functionality, rather than compatibility # code. Where they should go eventually is unclear. cloexec.o: ${UPSTREAM}/roken/cloexec.c $(AFS_CCRULE) $(UPSTREAM)/roken/cloexec.c ct.o: ${UPSTREAM}/roken/ct.c $(AFS_CCRULE) $(UPSTREAM)/roken/ct.c hex.o: ${UPSTREAM}/roken/hex.c $(AFS_CCRULE) $(UPSTREAM)/roken/hex.c issuid.o: ${UPSTREAM}/roken/issuid.c $(AFS_CCRULE) $(UPSTREAM)/roken/issuid.c net_read.o: ${UPSTREAM}/roken/net_read.c $(AFS_CCRULE) $(UPSTREAM)/roken/net_read.c net_write.o: ${UPSTREAM}/roken/net_write.c $(AFS_CCRULE) $(UPSTREAM)/roken/net_write.c # These bits of libroken are compatibility functions. They should get moved # out into a new libroken top level target, which allows the use of an # existing libroken, if one is available. daemon.o: ${UPSTREAM}/roken/daemon.c $(AFS_CCRULE) $(UPSTREAM)/roken/daemon.c ecalloc.o: ${UPSTREAM}/roken/ecalloc.c $(AFS_CCRULE) $(UPSTREAM)/roken/ecalloc.c emalloc.o: ${UPSTREAM}/roken/emalloc.c $(AFS_CCRULE) $(UPSTREAM)/roken/emalloc.c erealloc.o: ${UPSTREAM}/roken/erealloc.c $(AFS_CCRULE) $(UPSTREAM)/roken/erealloc.c err.h: ${UPSTREAM}/roken/err.hin cp $? $@ err.o: ${UPSTREAM}/roken/err.c $(AFS_CCRULE) $(UPSTREAM)/roken/err.c errx.o: ${UPSTREAM}/roken/errx.c $(AFS_CCRULE) $(UPSTREAM)/roken/errx.c getopt.o: ${UPSTREAM}/roken/getopt.c $(AFS_CCRULE) $(UPSTREAM)/roken/getopt.c getprogname.o: ${UPSTREAM}/roken/getprogname.c $(AFS_CCRULE) $(UPSTREAM)/roken/getprogname.c socket.o: ${UPSTREAM}/roken/socket.c $(AFS_CCRULE) $(UPSTREAM)/roken/socket.c strlcat.o: ${UPSTREAM}/roken/strlcat.c $(AFS_CCRULE) $(UPSTREAM)/roken/strlcat.c strlcpy.o: ${UPSTREAM}/roken/strlcpy.c $(AFS_CCRULE) $(UPSTREAM)/roken/strlcpy.c strnlen.o: ${UPSTREAM}/roken/strnlen.c $(AFS_CCRULE) $(UPSTREAM)/roken/strnlen.c verr.o: ${UPSTREAM}/roken/verr.c $(AFS_CCRULE) $(UPSTREAM)/roken/verr.c verrx.o: ${UPSTREAM}/roken/verrx.c $(AFS_CCRULE) $(UPSTREAM)/roken/verrx.c vwarn.o: ${UPSTREAM}/roken/vwarn.c $(AFS_CCRULE) $(UPSTREAM)/roken/vwarn.c vwarnx.o: ${UPSTREAM}/roken/vwarnx.c $(AFS_CCRULE) $(UPSTREAM)/roken/vwarnx.c warn.o: ${UPSTREAM}/roken/warn.c $(AFS_CCRULE) $(UPSTREAM)/roken/warn.c warnerr.o: ${UPSTREAM}/roken/warnerr.c $(AFS_CCRULE) $(UPSTREAM)/roken/warnerr.c warnx.o: ${UPSTREAM}/roken/warnx.c $(AFS_CCRULE) $(UPSTREAM)/roken/warnx.c # LWP Targets rand-fortuna_lwp.o: ${UPSTREAM}/hcrypto/rand-fortuna.c ${LWPRULE} -o rand-fortuna_lwp.o