summaryrefslogtreecommitdiffstats
path: root/Configurations/unix-Makefile.tmpl
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-03-07 14:38:54 +0100
committerRichard Levitte <levitte@openssl.org>2016-03-07 18:25:56 +0100
commit66ddf178b4eaac6d65f8ba56821f69b598556cec (patch)
tree3751e8f7350f251bff93893bed5e08ee4c109e37 /Configurations/unix-Makefile.tmpl
parentae4c7450754ea13265edd69e6ff74d87c89401cd (diff)
Unified - Adapt the Unix and VMS templates to support GENERATE
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'Configurations/unix-Makefile.tmpl')
-rw-r--r--Configurations/unix-Makefile.tmpl37
1 files changed, 37 insertions, 0 deletions
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index 50dafd284a..226f5bdfa8 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -816,6 +816,43 @@ configdata.pm: {- $config{build_file_template} -} $(SRCDIR)/Configurations/commo
return map { shlib_simple($_) } @_;
}
+ sub generatesrc {
+ my %args = @_;
+ my $generator = join(" ", @{$args{generator}});
+
+ if ($args{src} !~ /\.[sS]$/) {
+ return <<"EOF";
+$args{src}: $args{generator}->[0]
+ \$(PERL) $generator > \$@
+EOF
+ } else {
+ if ($args{generator}->[0] =~ /\.[sS]$/) {
+ return <<"EOF";
+$args{src}: $args{generator}->[0]
+ \$(CC) \$(CFLAGS) -E \$< > \$@
+EOF
+ } elsif ($args{generator}->[0] =~ /\.pl$/) {
+ return <<"EOF";
+$args{src}: $args{generator}->[0]
+ ( trap "rm -f \$@.S" INT; \\
+ CC="\$(CC)" \$(PERL) $generator \$@.S; \\
+ if grep '^#' \$@.S >/dev/null; then \\
+ \$(CC) -E -P \$@.S > \$@ && rm -f \$@.S; \\
+ else \\
+ mv \$@.S \$@; \\
+ fi )
+EOF
+ } elsif ($args{generator}->[0] =~ /\.m4$/) {
+ return <<"EOF";
+$args{src}: $args{generator}->[0]
+ m4 -B 8192 $generator > \$@
+EOF
+ } else {
+ die "Generator type for $args{src} unknown: $args{generator}\n";
+ }
+ }
+ }
+
sub src2obj {
my %args = @_;
my $obj = $args{obj};