3 # unix.pl - the standard unix makefile stuff.
16 { $cflags="-g2 -ggdb"; }
18 { $cflags="-O3 -fomit-frame-pointer"; }
38 # static library stuff
41 $ranlib=&which("ranlib") or $ranlib="true";
57 'md5-x86_64' => 'crypto/md5',
58 'x86_64-mont' => 'crypto/bn',
59 'x86_64-mont5' => 'crypto/bn',
60 'x86_64-gf2m' => 'crypto/bn',
61 'modexp512-x86_64' => 'crypto/bn',
62 'aes-x86_64' => 'crypto/aes',
63 'vpaes-x86_64' => 'crypto/aes',
64 'bsaes-x86_64' => 'crypto/aes',
65 'aesni-x86_64' => 'crypto/aes',
66 'aesni-sha1-x86_64' => 'crypto/aes',
67 'sha1-x86_64' => 'crypto/sha',
68 'e_padlock-x86_64' => 'engines',
69 'rc4-x86_64' => 'crypto/rc4',
70 'rc4-md5-x86_64' => 'crypto/rc4',
71 'ghash-x86_64' => 'crypto/modes',
74 # If I were feeling more clever, these could probably be extracted
76 sub platform_perlasm_compile_target
78 local($target, $source, $bname) = @_;
82 if ($target eq "\$(OBJ_D)/$p.o")
85 \$(TMP_D)/$p.s: $perl1{$p}/asm/$p.pl
86 \$(PERL) $perl1{$p}/asm/$p.pl \$(PERLASM_SCHEME) > \$@
90 if ($target eq '$(OBJ_D)/x86_64cpuid.o')
93 $(TMP_D)/x86_64cpuid.s: crypto/x86_64cpuid.pl
94 $(PERL) crypto/x86_64cpuid.pl $(PERLASM_SCHEME) > $@
97 elsif ($target eq '$(OBJ_D)/sha256-x86_64.o')
100 $(TMP_D)/sha256-x86_64.s: crypto/sha/asm/sha512-x86_64.pl
101 $(PERL) crypto/sha/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
104 elsif ($target eq '$(OBJ_D)/sha512-x86_64.o')
107 $(TMP_D)/sha512-x86_64.s: crypto/sha/asm/sha512-x86_64.pl
108 $(PERL) crypto/sha/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
111 elsif ($target eq '$(OBJ_D)/sha512-x86_64.o')
114 $(TMP_D)/sha512-x86_64.s: crypto/sha/asm/sha512-x86_64.pl
115 $(PERL) crypto/sha/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
122 sub special_compile_target
126 if ($target eq 'crypto/bn/x86_64-gcc')
129 \$(TMP_D)/x86_64-gcc.o: crypto/bn/asm/x86_64-gcc.c
130 \$(CC) \$(CFLAGS) -c -o \$@ crypto/bn/asm/x86_64-gcc.c
138 local($obj,$target,$name,$shlib)=@_;
139 local($ret,$_,$Name);
141 $target =~ s/\//$o/g if $o ne '/';
143 ($Name=$name) =~ tr/a-z/A-Z/;
145 $ret.="$target: \$(${Name}OBJ)\n";
146 $ret.="\t\$(RM) $target\n";
147 $ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
148 $ret.="\t\$(RANLIB) $target\n\n";
153 local($target,$files,$dep_libs,$libs)=@_;
156 $file =~ s/\//$o/g if $o ne '/';
158 $ret.="$target: $files $dep_libs\n";
159 $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n";
167 foreach $path (split /:/, $ENV{PATH})
169 if (-x "$path/$name")
171 return "$path/$name";