Commit 0f539dc1 authored by Richard Levitte's avatar Richard Levitte
Browse files

Fix the update target and remove duplicate file updates



We had updates of certain header files in both Makefile.org and the
Makefile in the directory the header file lived in.  This is error
prone and also sometimes generates slightly different results (usually
just a comment that differs) depending on which way the update was
done.

This removes the file update targets from the top level Makefile, adds
an update: target in all Makefiles and has it depend on the depend: or
local_depend: targets, whichever is appropriate, so we don't get a
double run through the whole file tree.

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
parent 8757bf83
Loading
Loading
Loading
Loading
+3 −16
Original line number Original line Diff line number Diff line
@@ -439,6 +439,9 @@ tests: rehash
report:
report:
	@$(PERL) util/selftest.pl
	@$(PERL) util/selftest.pl


update: errors stacks util/libeay.num util/ssleay.num apps/openssl-vms.cnf TABLE
	@set -e; target=update; $(RECURSIVE_BUILD_CMD)

depend:
depend:
	@set -e; target=depend; $(RECURSIVE_BUILD_CMD)
	@set -e; target=depend; $(RECURSIVE_BUILD_CMD)


@@ -466,26 +469,10 @@ util/libeay.num::
util/ssleay.num::
util/ssleay.num::
	$(PERL) util/mkdef.pl ssl update
	$(PERL) util/mkdef.pl ssl update


crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl include/openssl/obj_mac.h
	$(PERL) crypto/objects/obj_dat.pl include/openssl/obj_mac.h crypto/objects/obj_dat.h
include/openssl/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
	$(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num include/openssl/obj_mac.h
crypto/objects/obj_xref.h: crypto/objects/objxref.pl crypto/objects/obj_xref.txt crypto/objects/obj_mac.num
	$(PERL) crypto/objects/objxref.pl crypto/objects/obj_mac.num crypto/objects/obj_xref.txt >crypto/objects/obj_xref.h

apps/openssl-vms.cnf: apps/openssl.cnf
	$(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf

crypto/bn/bn_prime.h: crypto/bn/bn_prime.pl
	$(PERL) crypto/bn/bn_prime.pl >crypto/bn/bn_prime.h


TABLE: Configure Configurations/*.conf
TABLE: Configure Configurations/*.conf
	(echo 'Output of `Configure TABLE'"':"; \
	(echo 'Output of `Configure TABLE'"':"; \
	$(PERL) Configure TABLE) > TABLE
	$(PERL) Configure TABLE) > TABLE


update: errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h crypto/objects/obj_xref.h apps/openssl-vms.cnf crypto/bn/bn_prime.h TABLE depend

# Build distribution tar-file. As the list of files returned by "find" is
# Build distribution tar-file. As the list of files returned by "find" is
# pretty long, on several platforms a "too many arguments" error or similar
# pretty long, on several platforms a "too many arguments" error or similar
# would occur. Therefore the list of files is temporarily stored into a file
# would occur. Therefore the list of files is temporarily stored into a file
+5 −0
Original line number Original line Diff line number Diff line
@@ -76,6 +76,9 @@ all: exe


exe:	$(EXE)
exe:	$(EXE)


openssl-vms.cnf: openssl.cnf
	$(PERL) $(TOP)/VMS/VMSify-conf.pl < openssl.cnf > openssl-vms.cnf

files:
files:
	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO


@@ -120,6 +123,8 @@ tests:
lint:
lint:
	echo nope >fluff
	echo nope >fluff


update: openssl-vms.cnf depend

depend:
depend:
	@if [ -z "$(THIS)" ]; then \
	@if [ -z "$(THIS)" ]; then \
	    $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; \
	    $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; \
+8 −3
Original line number Original line Diff line number Diff line
@@ -110,12 +110,17 @@ libs:
lint:
lint:
	@target=lint; $(RECURSIVE_MAKE)
	@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)" -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)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
	@[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
	@[ -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:
clean:
	rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
	rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
+2 −0
Original line number Original line Diff line number Diff line
@@ -108,6 +108,8 @@ tests:
lint:
lint:
	lint -DLINT $(INCLUDES) $(SRC)>fluff
	lint -DLINT $(INCLUDES) $(SRC)>fluff


update: depend

depend:
depend:
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
+2 −0
Original line number Original line Diff line number Diff line
@@ -79,6 +79,8 @@ tests:
lint:
lint:
	lint -DLINT $(INCLUDES) $(SRC)>fluff
	lint -DLINT $(INCLUDES) $(SRC)>fluff


update: depend

depend:
depend:
	@[ -n "$(MAKEDEPEND)" ] # should be set by top Makefile...
	@[ -n "$(MAKEDEPEND)" ] # should be set by top Makefile...
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
Loading