]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - Configurations/unix-Makefile.tmpl
Revert (most of) "Makefile: Generate crypto objects only as far as needed"
[thirdparty/openssl.git] / Configurations / unix-Makefile.tmpl
index bf53cbcec5dbba329e87f6f3a73418d842051a11..56ce7e98f7dcb87b6f84e377c1d63efee5d1fc76 100644 (file)
@@ -582,7 +582,7 @@ clean: libclean
        $(RM) $(MANDOCS3)
        $(RM) $(MANDOCS5)
        $(RM) $(MANDOCS7)
-       $(RM) $(PROGRAMS) $(TESTPROGS) $(MODULES) $(SCRIPTS)
+       $(RM) $(PROGRAMS) $(TESTPROGS) $(MODULES) $(FIPSMODULE) $(SCRIPTS)
        $(RM) $(GENERATED_MANDATORY) $(GENERATED)
        -find . -name '*{- platform->depext() -}' \! -name '.*' \! -type d -exec $(RM) {} \;
        -find . -name '*{- platform->objext() -}' \! -name '.*' \! -type d -exec $(RM) {} \;
@@ -594,12 +594,13 @@ clean: libclean
        -find . -type l \! -name '.*' -exec $(RM) {} \;
 
 distclean: clean
+       $(RM) include/openssl/configuration.h
        $(RM) configdata.pm
        $(RM) Makefile
 
 # We check if any depfile is newer than Makefile and decide to
 # concatenate only if that is true.
-depend:
+depend: Makefile
        @: {- output_off() if $disabled{makedepend}; "" -}
        @$(PERL) $(SRCDIR)/util/add-depends.pl "{- $makedep_scheme -}"
        @: {- output_on() if $disabled{makedepend}; "" -}
@@ -693,11 +694,11 @@ install_dev: install_runtime_libs
        @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
        @$(ECHO) "*** Installing development files"
        @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/include/openssl
-       @ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
+       @ : {- output_off() if $disabled{uplink}; "" -}
        @$(ECHO) "install $(SRCDIR)/ms/applink.c -> $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
        @cp $(SRCDIR)/ms/applink.c $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
        @chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
-       @ : {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
+       @ : {- output_on() if $disabled{uplink}; "" -}
        @set -e; for i in $(SRCDIR)/include/openssl/*.h \
                          $(BLDDIR)/include/openssl/*.h; do \
                fn=`basename $$i`; \
@@ -767,10 +768,10 @@ install_dev: install_runtime_libs
 
 uninstall_dev: uninstall_runtime_libs
        @$(ECHO) "*** Uninstalling development files"
-       @ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
+       @ : {- output_off() if $disabled{uplink}; "" -}
        @$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
        @$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
-       @ : {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
+       @ : {- output_on() if $disabled{uplink}; "" -}
        @set -e; for i in $(SRCDIR)/include/openssl/*.h \
                          $(BLDDIR)/include/openssl/*.h; do \
                fn=`basename $$i`; \
@@ -1104,9 +1105,12 @@ uninstall_image_docs:
 # is sensitive to build.info changes.
 update: generate errors ordinals generate_buildinfo
 
+.PHONY: generate generate_apps generate_crypto_bn generate_crypto_objects \
+          generate_crypto_conf generate_crypto_asn1 generate_fuzz_oids
 generate: generate_apps generate_crypto_bn generate_crypto_objects \
           generate_crypto_conf generate_crypto_asn1 generate_fuzz_oids
 
+.PHONY: generate_buildinfo generate_doc_buildinfo
 generate_buildinfo: generate_doc_buildinfo
 
 .PHONY: doc-nits md-nits
@@ -1153,7 +1157,7 @@ generate_crypto_objects:
                                crypto/objects/obj_mac.num \
                                crypto/objects/obj_xref.txt \
                                > crypto/objects/obj_xref.h )
-       ( cd $(SRCDIR); cat crypto/objects/obj_compat.h >> include/openssl/obj_mac.h )
+       ( cd $(SRCDIR); sed -e '1,8d' crypto/objects/obj_compat.h >> include/openssl/obj_mac.h )
 
 generate_crypto_conf:
        ( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \
@@ -1256,6 +1260,7 @@ errors:
            include/openssl/tls1.h
            include/openssl/dtls1.h
            include/openssl/srtp.h
+           include/openssl/quic.h
            include/openssl/sslerr_legacy.h );
    my @cryptoheaders_tmpl =
        qw( include/internal/dso.h
@@ -1318,15 +1323,18 @@ renumber: build_generated
                 --renumber \
                 $(SSLHEADERS)
 
-ordinals: build_generated
+$(SRCDIR)/util/libcrypto.num: $(CRYPTOHEADERS) $(SRCDIR)/include/openssl/symhacks.h
        $(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION_NUMBER) --no-warnings \
                 --ordinals $(SRCDIR)/util/libcrypto.num \
                 --symhacks $(SRCDIR)/include/openssl/symhacks.h \
                 $(CRYPTOHEADERS)
+$(SRCDIR)/util/libssl.num: $(SSLHEADERS) $(SRCDIR)/include/openssl/symhacks.h
        $(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION_NUMBER) --no-warnings \
                 --ordinals $(SRCDIR)/util/libssl.num \
                 --symhacks $(SRCDIR)/include/openssl/symhacks.h \
                 $(SSLHEADERS)
+.PHONY: ordinals
+ordinals: build_generated $(SRCDIR)/util/libcrypto.num $(SRCDIR)/util/libssl.num
 
 test_ordinals:
        $(MAKE) run_tests TESTS=test_ordinals
@@ -1371,13 +1379,13 @@ tar:
 
 link-utils: $(BLDDIR)/util/opensslwrap.sh $(BLDDIR)/apps/openssl.cnf
 
-$(BLDDIR)/util/opensslwrap.sh: configdata.pm
+$(BLDDIR)/util/opensslwrap.sh: Makefile
        @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
            mkdir -p "$(BLDDIR)/util"; \
            ln -sf "../$(SRCDIR)/util/`basename "$@"`" "$(BLDDIR)/util"; \
        fi
 
-$(BLDDIR)/apps/openssl.cnf: configdata.pm
+$(BLDDIR)/apps/openssl.cnf: Makefile
        @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
            mkdir -p "$(BLDDIR)/apps"; \
            ln -sf "../$(SRCDIR)/apps/`basename "$@"`" "$(BLDDIR)/apps"; \
@@ -1387,7 +1395,8 @@ FORCE:
 
 # Building targets ###################################################
 
-libcrypto.pc libssl.pc openssl.pc: configdata.pm $(LIBS) {- join(" ",map { platform->sharedlib_simple($_) // platform->sharedlib_import($_) // platform->sharedlib($_) // () } @{$unified_info{libraries}}) -}
+libcrypto.pc libssl.pc openssl.pc: Makefile $(LIBS) {- join(" ",map { platform->sharedlib_simple($_) // platform->sharedlib_import($_) // platform->sharedlib($_) // () } @{$unified_info{libraries}}) -}
+
 libcrypto.pc:
        @ ( echo 'prefix=$(INSTALLTOP)'; \
            echo 'exec_prefix=$${prefix}'; \
@@ -1398,6 +1407,7 @@ libcrypto.pc:
            fi; \
            echo 'includedir=$${prefix}/include'; \
            echo 'enginesdir=$${libdir}/engines-{- $sover_dirname -}'; \
+           echo 'modulesdir=$${libdir}/ossl-modules'; \
            echo ''; \
            echo 'Name: OpenSSL-libcrypto'; \
            echo 'Description: OpenSSL cryptography library'; \
@@ -1438,10 +1448,22 @@ openssl.pc:
            echo 'Version: '$(VERSION); \
            echo 'Requires: libssl libcrypto' ) > openssl.pc
 
+Makefile: configdata.pm \
+          {- join(" \\\n" . ' ' x 10,
+                  fill_lines(" ", $COLUMNS - 10,
+                             @{$config{build_file_templates}})) -}
+       @echo "Detected changed: $?"
+       $(PERL) configdata.pm
+       @echo "**************************************************"
+       @echo "***                                            ***"
+       @echo "***   Please run the same make command again   ***"
+       @echo "***                                            ***"
+       @echo "**************************************************"
+       @false
+
 configdata.pm: $(SRCDIR)/Configure $(SRCDIR)/config \
                {- join(" \\\n" . ' ' x 15,
                        fill_lines(" ", $COLUMNS - 15,
-                                  @{$config{build_file_templates}},
                                   @{$config{build_infos}},
                                   @{$config{conf_files}})) -}
        @echo "Detected changed: $?"
@@ -1535,7 +1557,7 @@ EOF
           my $ord_name = $args{generator}->[1] || $args{product};
           return <<"EOF";
 $target: $gen0 $deps \$(SRCDIR)/util/mkdef.pl
-       \$(PERL) \$(SRCDIR)/util/mkdef.pl$ord_ver --ordinals $gen0  --name $ord_name --OS $mkdef_os > $target
+       \$(PERL) \$(SRCDIR)/util/mkdef.pl$ord_ver --type $args{intent} --ordinals $gen0  --name $ord_name --OS $mkdef_os > $target
 EOF
       } elsif (platform->isasm($args{src})) {
           #