do not remove links found in .git directory
[openssl.git] / Configurations / unix-Makefile.tmpl
index e0ad21b683872c8610a373c8a4fa87521eda56cf..a31867ed3203947d9ba70cdee5d9eeed88a46a0a 100644 (file)
@@ -86,10 +86,12 @@ DEPS={- join(" ", map { (my $x = $_) =~ s|\.o$|$depext|; $x; }
 {- output_on() if $disabled{makedepend}; "" -}
 GENERATED={- join(" ", map { (my $x = $_) =~ s|\.S$|\.s|; $x } keys %{$unified_info{generate}}) -}
 
+{- output_off() if $disabled{apps}; "" -}
 BIN_SCRIPTS=$(BLDDIR)/tools/c_rehash
 MISC_SCRIPTS=$(SRCDIR)/tools/c_hash $(SRCDIR)/tools/c_info \
             $(SRCDIR)/tools/c_issuer $(SRCDIR)/tools/c_name \
             $(BLDDIR)/apps/CA.pl $(BLDDIR)/apps/tsget
+{- output_on() if $disabled{apps}; "" -}
 
 SHLIB_INFO={- join(" ", map { "\"".shlib($_).";".shlib_simple($_)."\"" } @{$unified_info{libraries}}) -}
 
@@ -170,7 +172,7 @@ LIB_LDFLAGS={- $target{shared_ldflag}." ".$config{shared_ldflag}
 RCFLAGS={- $target{shared_rcflag} -}
 DSO_CFLAGS={- $target{shared_cflag} || "" -}
 DSO_LDFLAGS=$(LIB_LDFLAGS)
-BIN_CFLAGS={- "" -}
+BIN_CFLAGS={- $target{bin_cflags} -}
 
 PERL={- $config{perl} -}
 
@@ -215,8 +217,9 @@ build_apps_nodep: $(PROGRAMS) $(SCRIPTS)
 build_tests: configdata.pm build_tests_nodep depend
 build_tests_nodep: $(TESTPROGS)
 
-test tests: build_tests_nodep build_apps_nodep build_engines_nodep \
-            depend link-utils
+test: tests
+tests: build_tests_nodep build_apps_nodep build_engines_nodep \
+       depend link-utils
        @ : {- output_off() if $disabled{tests}; "" -}
        ( cd test; \
          SRCTOP=../$(SRCDIR) \
@@ -256,7 +259,7 @@ clean: libclean
        rm -f core
        rm -f tags TAGS
        rm -f openssl.pc libcrypto.pc libssl.pc
-       -rm -f `find . -type l`
+       -rm -f `find . -type l -a \! -path "./.git/*"`
        rm -f $(TARFILE)
 
 # This exists solely for those who still type 'make depend'
@@ -619,7 +622,8 @@ uninstall_html_docs:
 
 update: generate errors ordinals
 
-generate: generate_apps generate_crypto_bn generate_crypto_objects
+generate: generate_apps generate_crypto_bn generate_crypto_objects \
+          generate_crypto_conf generate_crypto_asn1
 
 # Test coverage is a good idea for the future
 #coverage: $(PROGRAMS) $(TESTPROGRAMS)
@@ -650,18 +654,26 @@ generate_crypto_bn:
        ( cd $(SRCDIR); $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h )
 
 generate_crypto_objects:
-       ( cd $(SRCDIR); $(PERL) crypto/objects/obj_dat.pl \
-                               include/openssl/obj_mac.h \
-                               crypto/objects/obj_dat.h )
        ( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl \
                                crypto/objects/objects.txt \
                                crypto/objects/obj_mac.num \
                                include/openssl/obj_mac.h )
+       ( cd $(SRCDIR); $(PERL) crypto/objects/obj_dat.pl \
+                               include/openssl/obj_mac.h \
+                               crypto/objects/obj_dat.h )
        ( cd $(SRCDIR); $(PERL) crypto/objects/objxref.pl \
                                crypto/objects/obj_mac.num \
                                crypto/objects/obj_xref.txt \
                                > crypto/objects/obj_xref.h )
 
+generate_crypto_conf:
+       ( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \
+                               > crypto/conf/conf_def.h )
+
+generate_crypto_asn1:
+       ( cd $(SRCDIR); $(PERL) crypto/asn1/charmap.pl \
+                               > crypto/asn1/charmap.h )
+
 errors:
        ( cd $(SRCDIR); $(PERL) util/ck_errf.pl -strict */*.c */*/*.c )
        ( cd $(SRCDIR); $(PERL) util/mkerr.pl -recurse -write )
@@ -805,19 +817,20 @@ configdata.pm: $(SRCDIR)/Configurations/unix-Makefile.tmpl $(SRCDIR)/Configurati
   sub generatesrc {
       my %args = @_;
       my $generator = join(" ", @{$args{generator}});
+      my $generator_incs = join("", map { " -I".$_ } @{$args{generator_incs}});
       my $incs = join("", map { " -I".$_ } @{$args{incs}});
-      my $deps = join(" ", @{$args{deps}});
+      my $deps = join(" ", @{$args{generator_deps}}, @{$args{deps}});
 
       if ($args{src} !~ /\.[sS]$/) {
           return <<"EOF";
 $args{src}: $args{generator}->[0] $deps
-       \$(PERL) $generator > \$@
+       \$(PERL)$generator_incs $generator > \$@
 EOF
       } else {
           if ($args{generator}->[0] =~ /\.pl$/) {
-              $generator = 'CC="$(CC)" $(PERL) '.$generator;
+              $generator = 'CC="$(CC)" $(PERL)'.$generator_incs.' '.$generator;
           } elsif ($args{generator}->[0] =~ /\.m4$/) {
-              $generator = 'm4 -B 8192 '.$generator.' >'
+              $generator = 'm4 -B 8192'.$generator_incs.' '.$generator.' >'
           } elsif ($args{generator}->[0] =~ /\.S$/) {
               $generator = undef;
           } else {
@@ -833,7 +846,9 @@ EOF
 $target: $args{generator}->[0] $deps
        ( trap "rm -f \$@.*" INT 0; \\
          $generator \$@.S; \\
-         \$(CC) \$(CFLAGS) $incs -E -P \$@.S > \$@.i && mv -f \$@.i \$@ )
+         \$(CC) \$(CFLAGS) $incs -E \$@.S | \\
+         \$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@.i && \\
+         mv -f \$@.i \$@ )
 EOF
               }
               # Otherwise....
@@ -844,7 +859,8 @@ EOF
           }
           return <<"EOF";
 $args{src}: $args{generator}->[0] $deps
-       \$(CC) \$(CFLAGS) $incs -E -P \$< > \$@
+       \$(CC) \$(CFLAGS) $incs -E \$< | \\
+       \$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@
 EOF
       }
   }