]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/Makefile
Merge 1.0.2 setuid calls to getenv(3) safety.
[thirdparty/openssl.git] / crypto / Makefile
index 5259aef7b431d7643f3a8f2f1af00d972ecb478d..72c96f6ddee93a7e1ea94d97afc062e1a6c63377 100644 (file)
@@ -31,19 +31,23 @@ 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)
 LIBSRC=        cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c \
-       ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c
+       ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c \
+       getenv.c
 LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o \
-       uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o $(CPUID_OBJ)
+       uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o getenv.o \
+       $(CPUID_OBJ)
 
 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 bn_int.h $(EXHEADER)
 
 ALL=    $(GENERAL) $(SRC) $(HEADER)
 
@@ -53,12 +57,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) > $@
@@ -70,14 +69,16 @@ uplink.o:   $(TOP)/ms/uplink.c applink.o
        $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/uplink.c
 
 uplink-x86.s:  $(TOP)/ms/uplink-x86.pl
-       $(PERL) $(TOP)/ms/uplink-x64.pl $(PERLASM_SCHEME) > $@
+       $(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 > $@
 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 '; \
@@ -89,7 +90,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:
@@ -103,7 +104,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
@@ -126,12 +127,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