X509_cmp_time: only return 1, 0, -1.
[openssl.git] / crypto / Makefile
index 15ef1d945bbc3972dc4fddb48c690d4787789a11..7869996a9c074a470853fb278a5b2c524dd86b7e 100644 (file)
@@ -31,6 +31,7 @@ CPUID_OBJ=mem_clr.o
 LIBS=
 
 GENERAL=Makefile README crypto-lib.com install.com
+TEST=constant_time_test.c
 
 LIB= $(TOP)/libcrypto.a
 SHARED_LIB= libcrypto$(SHLIB_EXT)
@@ -43,7 +44,8 @@ SRC= $(LIBSRC)
 
 EXHEADER= crypto.h opensslv.h opensslconf.h ebcdic.h symhacks.h \
        ossl_typ.h
-HEADER=        cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h $(EXHEADER)
+HEADER=        cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h \
+       constant_time_locl.h $(EXHEADER)
 
 ALL=    $(GENERAL) $(SRC) $(HEADER)
 
@@ -53,12 +55,7 @@ top:
 all: shared
 
 buildinf.h: ../Makefile
-       ( echo "#ifndef MK1MF_BUILD"; \
-       echo '  /* auto-generated by crypto/Makefile for crypto/cversion.c */'; \
-       echo '  #define CFLAGS "$(CC) $(CFLAG)"'; \
-       echo '  #define PLATFORM "$(PLATFORM)"'; \
-       echo "  #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \
-       echo '#endif' ) >buildinf.h
+       $(PERL) $(TOP)/util/mkbuildinf.pl "$(CC) $(CFLAGS)" "$(PLATFORM)" >buildinf.h
 
 x86cpuid.s:    x86cpuid.pl perlasm/x86asm.pl
        $(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
@@ -77,9 +74,9 @@ ia64cpuid.s: ia64cpuid.S;     $(CC) $(CFLAGS) -E ia64cpuid.S > $@
 ppccpuid.s:    ppccpuid.pl;    $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@
 pariscid.s:    pariscid.pl;    $(PERL) pariscid.pl $(PERLASM_SCHEME) $@
 alphacpuid.s:  alphacpuid.pl
-       (preproc=/tmp/$$$$.$@; trap "rm $$preproc" INT; \
+       (preproc=$$$$.$@.S; trap "rm $$preproc" INT; \
        $(PERL) alphacpuid.pl > $$preproc && \
-       $(CC) -E $$preproc > $@ && rm $$preproc)
+       $(CC) -E -P $$preproc > $@ && rm $$preproc)
 
 testapps:
        [ -z "$(THIS)" ] || (   if echo $(SDIRS) | fgrep ' des '; \
@@ -105,7 +102,7 @@ lib:        $(LIB)
        @touch lib
 $(LIB):        $(LIBOBJ)
        $(AR) $(LIB) $(LIBOBJ)
-       [ -z "$(FIPSLIBDIR)" ] || $(AR) $(LIB) $(FIPSLIBDIR)fipscanister.o
+       test -z "$(FIPSLIBDIR)" || $(AR) $(LIB) $(FIPSLIBDIR)fipscanister.o
        $(RANLIB) $(LIB) || echo Never mind.
 
 shared: buildinf.h lib subdirs
@@ -128,12 +125,17 @@ install:
 lint:
        @target=lint; $(RECURSIVE_MAKE)
 
-depend:
+update: local_depend
+       @[ -z "$(THIS)" ] || (set -e; target=update; $(RECURSIVE_MAKE) )
+       @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
+
+depend: local_depend
+       @[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
+       @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
+local_depend:
        @[ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist
        @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
        @[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
-       @[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
-       @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
 
 clean:
        rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff