hcrypto: Cleanup all build products
[openafs.git] / src / crypto / hcrypto / Makefile.in
index 10a2aea..c2c5773 100644 (file)
@@ -10,13 +10,11 @@ LIBMINOR=1
 
 srcdir=@srcdir@
 include @TOP_OBJDIR@/src/config/Makefile.config
+include @TOP_OBJDIR@/src/config/Makefile.shared
 
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 
-CC=${MT_CC}
-CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS} ${SHLIB_CFLAGS}
-
 HEADERS= ${TOP_INCDIR}/hcrypto/aes.h \
         ${TOP_INCDIR}/hcrypto/des.h \
         ${TOP_INCDIR}/hcrypto/engine.h \
@@ -33,9 +31,15 @@ HEADERS= ${TOP_INCDIR}/hcrypto/aes.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: ${HEADERS} ${TOP_LIBDIR}/${SHLIBOBJ} ${TOP_LIBDIR}/libafshcrypto.a
+all: ${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} \
@@ -48,20 +52,22 @@ dest: libafshcrypto.a ${SHLIBOBJ}
        ${INSTALL_DATA} libafshcrypto.a ${DEST}/lib/libafshcrypto.a
 
 clean:
-       $(RM) -f ${OBJECTS} ${SHLIBOBJ} libafshcrypto.a libafshcrypto.exp \
-                test_cipher test_cipher.o hex.o
+       $(RM) -f ${OBJECTS} ${SHLIBOBJ} rand-fortuna_lwp.o \
+               libafshcrypto.a libafshcrypto.exp \
+               test_cipher test_cipher.o
 
-# Ignore for now : rand-egd.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
 
-OBJECTS= 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-fortuna.o rand-timer.o rand-unix.o rand.o \
-        rc2.o rc4.o rijndael-alg-fst.o rnd_keys.o sha.o sha256.o ui.o \
-        cloexec.o ct.o issuid.o net_read.o net_write.o strlcpy.o
+OBJECTS = $(COMMON_OBJS) rand-fortuna.o
 
-UPSTREAM= ${TOP_SRCDIR}/external/heimdal
+LWP_OBJS = $(COMMON_OBJS) rand-fortuna_lwp.o
 
-CCRULE = ${CC} -I${TOP_INCDIR}/hcrypto ${CFLAGS} -I${UPSTREAM}/hcrypto -c $?
+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} \
@@ -70,15 +76,20 @@ ${TOP_LIBDIR}/${SHLIBOBJ}: ${SHLIBOBJ}
 ${SHLIBOBJ}: ${OBJECTS} libafshcrypto.map
        ${TOP_OBJDIR}/src/config/shlib-build -d $(srcdir) -l libafshcrypto \
                -M ${LIBMAJOR} -m ${LIBMINOR} -- \
-               ${OBJECTS} ${MT_LIBS}
+               ${OBJECTS} -L$(TOP_LIBDIR) -lrokenafs ${MT_LIBS}
 
 libafshcrypto.a: ${OBJECTS}
        $(RM) -f $@
        $(AR) crv $@ ${OBJECTS}
        $(RANLIB) $@
 
-test_cipher: test_cipher.o hex.o libafshcrypto.a
-       ${CC} ${LDFLAGS} -o test_cipher test_cipher.o hex.o libafshcrypto.a
+libafshcrypto_lwp.a: $(LWP_OBJS)
+       $(RM) -f $@
+       $(AR) crv $@ $(LWP_OBJS)
+       $(RANLIB) $@
+
+test_cipher: test_cipher.o libafshcrypto.a
+       $(AFS_LDRULE) test_cipher.o libafshcrypto.a $(LIB_roken)
 
 ${TOP_INCDIR}/hcrypto/aes.h: ${UPSTREAM}/hcrypto/aes.h
        ${INSTALL_DATA} $? $@
@@ -143,123 +154,101 @@ ${TOP_INCDIR}/hcrypto/ui.h: ${UPSTREAM}/hcrypto/ui.h
 ${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
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/aes.c
 
 bn.o: ${UPSTREAM}/hcrypto/bn.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/bn.c
 
 camellia.o: ${UPSTREAM}/hcrypto/camellia.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/camellia.c
 
 camellia-ntt.o: ${UPSTREAM}/hcrypto/camellia-ntt.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/camellia-ntt.c
 
 des.o: ${UPSTREAM}/hcrypto/des.c
-       ${CCRULE}
-
-dh-imath.o: ${UPSTREAM}/hcrypto/dh-imath.c
-       ${CCRULE}
-
-dsa.o: ${UPSTREAM}/hcrypto/dsa.c
-       ${CCRULE}
-
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/des.c
+       
 evp.o: ${UPSTREAM}/hcrypto/evp.c
-       ${CCRULE}
-
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp.c
+       
 evp-hcrypto.o: ${UPSTREAM}/hcrypto/evp-hcrypto.c
-       ${CCRULE}
-
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp-hcrypto.c
+       
 evp-cc.o: ${UPSTREAM}/hcrypto/evp-cc.c
-       ${CCRULE}
-
-engine.o: engine.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/evp-cc.c
 
 hmac.o: ${UPSTREAM}/hcrypto/hmac.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/hmac.c
 
 md2.o: ${UPSTREAM}/hcrypto/md2.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md2.c
 
 md4.o: ${UPSTREAM}/hcrypto/md4.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md4.c
 
 md5.o: ${UPSTREAM}/hcrypto/md5.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/md5.c
 
 pkcs5.o: ${UPSTREAM}/hcrypto/pkcs5.c
-       ${CCRULE}
-
-pkcs12.o: ${UPSTREAM}/hcrypto/pkcs12.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/pkcs5.c
 
 rand-egd.o: ${UPSTREAM}/hcrypto/rand-egd.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-egd.c
 
 rand-fortuna.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-fortuna.c
 
 rand-timer.o: ${UPSTREAM}/hcrypto/rand-timer.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-timer.c
 
-# The upstream code has a const pointer warning, which we need to suppress */
 rand-unix.o: ${UPSTREAM}/hcrypto/rand-unix.c
-       ${CCRULE} @CFLAGS_NOERROR@
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand-unix.c
 
 rand.o: ${UPSTREAM}/hcrypto/rand.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rand.c
 
 rc2.o: ${UPSTREAM}/hcrypto/rc2.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rc2.c
 
 rc4.o: ${UPSTREAM}/hcrypto/rc4.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rc4.c
 
 rijndael-alg-fst.o: ${UPSTREAM}/hcrypto/rijndael-alg-fst.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rijndael-alg-fst.c
 
 rnd_keys.o: ${UPSTREAM}/hcrypto/rnd_keys.c
-       ${CCRULE}
-
-rsa.o: ${UPSTREAM}/hcrypto/rsa.c
-       ${CCRULE}
-
-rsa-gmp.o: ${UPSTREAM}/hcrypto/rsa-gmp.c
-       ${CCRULE}
-
-rsa-imath.o: ${UPSTREAM}/hcrypto/rsa-imath.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/rnd_keys.c
 
 sha.o: ${UPSTREAM}/hcrypto/sha.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/sha.c
 
 sha256.o: ${UPSTREAM}/hcrypto/sha256.c
-       ${CCRULE}
-
-ui.o: ${UPSTREAM}/hcrypto/ui.c
-       ${CCRULE}
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/sha256.c
 
-test_cipher.o: ${UPSTREAM}/hcrypto/test_cipher.c
-       ${CCRULE} -I${UPSTREAM}/roken/
+sha512.o: ${UPSTREAM}/hcrypto/sha512.c
+       ${AFS_CCRULE} $(UPSTREAM)/hcrypto/sha512.c
 
-cloexec.o: ${UPSTREAM}/roken/cloexec.c
-       ${CCRULE}
-
-ct.o: ${UPSTREAM}/roken/ct.c
-       ${CCRULE}
+ui.o: ${UPSTREAM}/hcrypto/ui.c
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/ui.c
 
-hex.o: ${UPSTREAM}/roken/hex.c
-       ${CCRULE}
+validate.o: ${UPSTREAM}/hcrypto/validate.c
+       ${AFS_CCRULE} ${UPSTREAM}/hcrypto/validate.c
 
-issuid.o: ${UPSTREAM}/roken/issuid.c
-       ${CCRULE}
+test_cipher.o: ${UPSTREAM}/hcrypto/test_cipher.c
+       $(AFS_CCRULE) $(UPSTREAM)/hcrypto/test_cipher.c
 
-net_read.o: ${UPSTREAM}/roken/net_read.c
-       ${CCRULE}
+# LWP Targets
 
-net_write.o: ${UPSTREAM}/roken/net_write.c
-       ${CCRULE}
+rand-fortuna_lwp.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
+       ${LWPRULE} -o rand-fortuna_lwp.o
 
-strlcpy.o: ${UPSTREAM}/roken/strlcpy.c
-       ${CCRULE}