Fix tarball production to keep test/bctest and util/pod2mantest
[openssl.git] / Makefile.org
index b7a3f96c9f4ab5ad779fb50604fde25c0ebaa58b..76fdbdf6ac5c2a015a387e6671e4bc532ab188b9 100644 (file)
@@ -180,12 +180,11 @@ SHARED_LDFLAGS=
 GENERAL=        Makefile
 BASENAME=       openssl
 NAME=           $(BASENAME)-$(VERSION)
-TARFILE=        $(NAME).tar
-WTARFILE=       $(NAME)-win.tar
+TARFILE=        ../$(NAME).tar
 EXHEADER=       e_os2.h
 HEADER=         e_os.h
 
-all: Makefile build_all openssl.pc libssl.pc libcrypto.pc
+all: Makefile build_all
 
 # as we stick to -e, CLEARENV ensures that local variables in lower
 # Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
@@ -203,7 +202,9 @@ CLEARENV=   TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS}     \
                $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS}     \
                $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
 
-BUILDENV=      PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
+# LC_ALL=C ensures that error [and other] messages are delivered in
+# same language for uniform treatment.
+BUILDENV=      LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
                CC='$(CC)' CFLAG='$(CFLAG)'                     \
                AS='$(CC)' ASFLAG='$(CFLAG) -c'                 \
                AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)'        \
@@ -269,21 +270,25 @@ reflect:
        @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
 
 sub_all: build_all
+
 build_all: build_libs build_apps build_tests build_tools
 
-build_libs: build_crypto build_ssl build_engines
+build_libs: build_libcrypto build_libssl openssl.pc
+
+build_libcrypto: build_crypto build_engines libcrypto.pc
+build_libssl: build_ssl libssl.pc
 
 build_crypto:
        @dir=crypto; target=all; $(BUILD_ONE_CMD)
-build_ssl:
+build_ssl: build_crypto
        @dir=ssl; target=all; $(BUILD_ONE_CMD)
-build_engines:
+build_engines: build_crypto
        @dir=engines; target=all; $(BUILD_ONE_CMD)
-build_apps:
+build_apps: build_libs
        @dir=apps; target=all; $(BUILD_ONE_CMD)
-build_tests:
+build_tests: build_libs
        @dir=test; target=all; $(BUILD_ONE_CMD)
-build_tools:
+build_tools: build_libs
        @dir=tools; target=all; $(BUILD_ONE_CMD)
 
 all_testapps: build_libs build_testapps
@@ -457,6 +462,9 @@ tests: rehash
 report:
        @$(PERL) util/selftest.pl
 
+update: errors stacks util/libeay.num util/ssleay.num TABLE
+       @set -e; target=update; $(RECURSIVE_BUILD_CMD)
+
 depend:
        @set -e; target=depend; $(RECURSIVE_BUILD_CMD)
 
@@ -481,60 +489,44 @@ util/libeay.num::
 util/ssleay.num::
        $(PERL) util/mkdef.pl ssl update
 
-crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
-       $(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
-crypto/objects/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 crypto/objects/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
        (echo 'Output of `Configure 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
 # 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
 # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
 # tar does not support the --files-from option.
-tar:
+TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from $(TARFILE).list \
+                              --owner 0 --group 0 \
+                              --transform 's|^|$(NAME)/|' \
+                              -cvf -
+
+$(TARFILE).list:
+       find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \
+              \! -name '*.so' \! -name '*.so.*'  \! -name 'openssl' \
+              \( \! -name '*test' -o -name bctest -o -name pod2mantest \) \
+              \! -name '.#*' \! -name '*~' \! -type l \
+           | sort > $(TARFILE).list
+
+tar: $(TARFILE).list
        find . -type d -print | xargs chmod 755
        find . -type f -print | xargs chmod a+r
        find . -type f -perm -0100 -print | xargs chmod a+x
-       find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
-       $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
-       tardy --user_number=0  --user_name=openssl \
-             --group_number=0 --group_name=openssl \
-             --prefix=openssl-$(VERSION) - |\
-       gzip --best >../$(TARFILE).gz; \
-       rm -f ../$(TARFILE).list; \
-       ls -l ../$(TARFILE).gz
-
-tar-snap:
-       @$(TAR) $(TARFLAGS) -cvf - \
-               `find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*'  \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\
-       tardy --user_number=0  --user_name=openssl \
-             --group_number=0 --group_name=openssl \
-             --prefix=openssl-$(VERSION) - > ../$(TARFILE);\
-       ls -l ../$(TARFILE)
+       $(TAR_COMMAND) | gzip --best > $(TARFILE).gz
+       rm -f $(TARFILE).list
+       ls -l $(TARFILE).gz
+
+tar-snap: $(TARFILE).list
+       $(TAR_COMMAND) > $(TARFILE)
+       rm -f $(TARFILE).list
+       ls -l $(TARFILE)
 
 dist:   
        $(PERL) Configure dist
-       @$(MAKE) dist_pem_h
        @$(MAKE) SDIRS='$(SDIRS)' clean
-       @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' tar
-
-dist_pem_h:
-       (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean)
+       @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar
 
 install: all install_docs install_sw