o_time.c: use gmtime_s with MSVC
[openssl.git] / crypto / Makefile
index 44248087a1e5cadc77cbb27b736e203477a93211..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) > $@
@@ -69,16 +66,17 @@ applink.o:  $(TOP)/ms/applink.c
 uplink.o:      $(TOP)/ms/uplink.c applink.o
        $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/uplink.c
 
-uplink-cof.s:  $(TOP)/ms/uplink.pl
-       $(PERL) $(TOP)/ms/uplink.pl coff > $@
+uplink-x86.s:  $(TOP)/ms/uplink-x86.pl
+       $(PERL) $(TOP)/ms/uplink-x86.pl $(PERLASM_SCHEME) > $@
 
-x86_64cpuid.s: x86_64cpuid.pl
-       $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@
-ia64cpuid.s: ia64cpuid.S
-       $(CC) $(CFLAGS) -E ia64cpuid.S > $@
+x86_64cpuid.s: x86_64cpuid.pl; $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@
+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
-       $(PERL) $< | $(CC) -E - | tee $@ > /dev/null
+       (preproc=$$$$.$@.S; trap "rm $$preproc" INT; \
+       $(PERL) alphacpuid.pl > $$preproc && \
+       $(CC) -E -P $$preproc > $@ && rm $$preproc)
 
 testapps:
        [ -z "$(THIS)" ] || (   if echo $(SDIRS) | fgrep ' des '; \
@@ -90,7 +88,7 @@ subdirs:
        @target=all; $(RECURSIVE_MAKE)
 
 files:
-       $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
+       $(PERL) $(TOP)/util/files.pl "CPUID_OBJ=$(CPUID_OBJ)" Makefile >> $(TOP)/MINFO
        @target=files; $(RECURSIVE_MAKE)
 
 links:
@@ -104,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
@@ -127,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