2 ## Makefile for OpenSSL
4 ## {- join("\n## ", @autowarntext) -}
6 our $objext = $target{obj_extension} || ".o";
7 our $depext = $target{dep_extension} || ".d";
8 our $exeext = $target{exe_extension} || "";
9 our $libext = $target{lib_extension} || ".a";
10 our $shlibext = $target{shared_extension} || ".so";
11 our $shlibextsimple = $target{shared_extension_simple} || ".so";
12 our $shlibextimport = $target{shared_import_extension} || "";
13 our $dsoext = $target{dso_extension} || ".so";
15 sub windowsdll { $config{target} =~ /^(?:Cygwin|mingw)/ }
17 # shlib and shlib_simple both take a static library name and figure
18 # out what the shlib name should be.
20 # When OpenSSL is configured "no-shared", these functions will just
21 # return empty lists, making them suitable to join().
23 # With Windows DLL producers, shlib($libname) will return the shared
24 # library name (which usually is different from the static library
25 # name) with the default shared extension appended to it, while
26 # shlib_simple($libname) will return the static library name with
27 # the shared extension followed by ".a" appended to it. The former
28 # result is used as the runtime shared library while the latter is
29 # used as the DLL import library.
31 # On all Unix systems, shlib($libname) will return the library name
32 # with the default shared extension, while shlib_simple($libname)
33 # will return the name from shlib($libname) with any SO version number
34 # removed. On some systems, they may therefore return the exact same
37 return () if $disabled{shared};
39 return $unified_info{sharednames}->{$lib} . $shlibext;
42 return () if $disabled{shared};
46 return $lib . $shlibextimport;
48 return $lib . $shlibextsimple;
51 # dso is a complement to shlib / shlib_simple that returns the
52 # given libname with the simple shared extension (possible SO version
53 # removed). This differs from shlib_simple() by being unconditional.
57 return $engine . $dsoext;
61 PLATFORM={- $config{target} -}
62 OPTIONS={- $config{options} -}
63 CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -})
64 SRCDIR={- $config{sourcedir} -}
65 BLDDIR={- $config{builddir} -}
67 VERSION={- $config{version} -}
68 MAJOR={- $config{major} -}
69 MINOR={- $config{minor} -}
70 SHLIB_VERSION_NUMBER={- $config{shlib_version_number} -}
71 SHLIB_VERSION_HISTORY={- $config{shlib_version_history} -}
72 SHLIB_MAJOR={- $config{shlib_major} -}
73 SHLIB_MINOR={- $config{shlib_minor} -}
74 SHLIB_TARGET={- $target{shared_target} -}
76 LIBS={- join(" ", map { $_.$libext } @{$unified_info{libraries}}) -}
77 SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{libraries}}) -}
78 ENGINES={- join(" ", map { dso($_) } @{$unified_info{engines}}) -}
79 PROGRAMS={- join(" ", map { $_.$exeext } grep { !m|^test/| } @{$unified_info{programs}}) -}
80 TESTPROGS={- join(" ", map { $_.$exeext } grep { m|^test/| } @{$unified_info{programs}}) -}
81 SCRIPTS={- join(" ", @{$unified_info{scripts}}) -}
82 {- output_off() if $disabled{makedepend}; "" -}
83 DEPS={- join(" ", map { (my $x = $_) =~ s|\.o$|$depext|; $x; }
84 grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
85 keys %{$unified_info{sources}}); -}
86 {- output_on() if $disabled{makedepend}; "" -}
87 GENERATED={- join(" ", map { (my $x = $_) =~ s|\.S$|\.s|; $x } keys %{$unified_info{generate}}) -}
89 BIN_SCRIPTS=$(BLDDIR)/tools/c_rehash
90 MISC_SCRIPTS=$(SRCDIR)/tools/c_hash $(SRCDIR)/tools/c_info \
91 $(SRCDIR)/tools/c_issuer $(SRCDIR)/tools/c_name \
92 $(BLDDIR)/apps/CA.pl $(SRCDIR)/apps/tsget
94 SHLIB_INFO={- join(" ", map { "\"".shlib($_).";".shlib_simple($_)."\"" } @{$unified_info{libraries}}) -}
96 # DESTDIR is for package builders so that they can configure for, say,
97 # /usr/ and yet have everything installed to /tmp/somedir/usr/.
98 # Normally it is left empty.
101 # Do not edit these manually. Use Configure with --prefix or --openssldir
102 # to change this! Short explanation in the top comment in Configure
103 INSTALLTOP={- # $prefix is used in the OPENSSLDIR perl snippet
105 our $prefix = $config{prefix} || "/usr/local";
108 # The logic here is that if no --openssldir was given,
109 # OPENSSLDIR will get the value from $prefix plus "/ssl".
110 # If --openssldir was given and the value is an absolute
111 # path, OPENSSLDIR will get its value without change.
112 # If the value from --openssldir is a relative path,
113 # OPENSSLDIR will get $prefix with the --openssldir
114 # value appended as a subdirectory.
116 use File::Spec::Functions;
118 $config{openssldir} ?
119 (file_name_is_absolute($config{openssldir}) ?
121 : catdir($prefix, $config{openssldir}))
122 : catdir($prefix, "ssl");
125 # if $prefix/lib$target{multilib} is not an existing
126 # directory, then assume that it's not searched by linker
127 # automatically, in which case adding $target{multilib} suffix
128 # causes more grief than we're ready to tolerate, so don't...
130 -d "$prefix/lib$target{multilib}" ? $target{multilib} : "";
131 our $libdir = $config{libdir} || "lib$multilib";
133 ENGINESDIR={- use File::Spec::Functions;
134 catdir($prefix,$libdir,"engines") -}
136 MANDIR=$(INSTALLTOP)/share/man
137 DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME)
138 HTMLDIR=$(DOCDIR)/html
140 # MANSUFFIX is for the benefit of anyone who may want to have a suffix
141 # appended after the manpage file section number. "ssl" is popular,
142 # resulting in files such as config.5ssl rather than config.5.
148 CROSS_COMPILE= {- $config{cross_compile_prefix} -}
149 CC= $(CROSS_COMPILE){- $target{cc} -}
150 CFLAGS={- our $cflags2 = join(" ",(map { "-D".$_} @{$target{defines}}, @{$config{defines}}),"-DOPENSSLDIR=\"\\\"\$(OPENSSLDIR)\\\"\"","-DENGINESDIR=\"\\\"\$(ENGINESDIR)\\\"\"") -} {- $target{cflags} -} {- $config{cflags} -}
151 CFLAGS_Q={- $cflags2 =~ s|([\\"])|\\$1|g; $cflags2 -} {- $config{cflags} -}
152 LDFLAGS= {- $target{lflags} -}
153 PLIB_LDFLAGS= {- $target{plib_lflags} -}
154 EX_LIBS= {- $target{ex_libs} -} {- $config{ex_libs} -}
155 LIB_CFLAGS={- $target{shared_cflag} || "" -}
156 LIB_LDFLAGS={- $target{shared_ldflag}." ".$config{shared_ldflag}
157 # Unlike other OSes (like Solaris, Linux, Tru64,
158 # IRIX) BSD run-time linkers (tested OpenBSD, NetBSD
159 # and FreeBSD) "demand" RPATH set on .so objects.
160 # Apparently application RPATH is not global and
161 # does not apply to .so linked with other .so.
162 # Problem manifests itself when libssl.so fails to
163 # load libcrypto.so. One can argue that we should
164 # engrave this into Makefile.shared rules or into
165 # BSD-* config lines above. Meanwhile let's try to
166 # be cautious and pass -rpath to linker only when
167 # $prefix is not /usr.
168 . ($config{target} =~ m|^BSD-| && $prefix !~ m|^/usr/.*$|
169 ? " -Wl,-rpath,\$\$(LIBRPATH)" : "") -}
170 RCFLAGS={- $target{shared_rcflag} -}
171 DSO_CFLAGS={- $target{shared_cflag} || "" -}
172 DSO_LDFLAGS=$(LIB_LDFLAGS)
175 PERL={- $config{perl} -}
177 ARFLAGS= {- $target{arflags} -}
178 AR=$(CROSS_COMPILE){- $target{ar} || "ar" -} $(ARFLAGS) r
179 RANLIB= {- $target{ranlib} -}
180 NM= $(CROSS_COMPILE){- $target{nm} || "nm" -}
183 TAR= {- $target{tar} || "tar" -}
184 TARFLAGS= {- $target{tarflags} -}
185 MAKEDEPEND={- $config{makedepprog} -}
188 NAME= $(BASENAME)-$(VERSION)
189 TARFILE= ../$(NAME).tar
191 # We let the C compiler driver to take care of .s files. This is done in
192 # order to be excused from maintaining a separate set of architecture
193 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
194 # gcc, then the driver will automatically translate it to -xarch=v8plus
195 # and pass it down to assembler.
198 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
200 # For x86 assembler: Set PROCESSOR to 386 if you want to support
202 PROCESSOR= {- $config{processor} -}
204 # The main targets ###################################################
206 all: configdata.pm build_libs_nodep build_engines_nodep build_apps_nodep \
209 build_libs: configdata.pm build_libs_nodep depend
210 build_libs_nodep: libcrypto.pc libssl.pc openssl.pc
211 build_engines: configdata.pm build_engines_nodep depend
212 build_engines_nodep: $(ENGINES)
213 build_apps: configdata.pm build_apps_nodep depend
214 build_apps_nodep: $(PROGRAMS) $(SCRIPTS)
215 build_tests: configdata.pm build_tests_nodep depend
216 build_tests_nodep: $(TESTPROGS)
218 test tests: build_tests_nodep build_apps_nodep build_engines_nodep depend
220 SRCTOP=../$(SRCDIR) \
221 BLDTOP=../$(BLDDIR) \
222 EXE_EXT={- $exeext -} \
223 $(PERL) ../$(SRCDIR)/test/run_tests.pl $(TESTS) )
226 @TOP=$(SRCDIR) PERL=$(PERL) $(PERL) $(SRCDIR)/test/run_tests.pl list
229 @set -e; for s in $(SHLIB_INFO); do \
230 s1=`echo "$$s" | cut -f1 -d";"`; \
231 s2=`echo "$$s" | cut -f2 -d";"`; \
234 if [ "$$s1" != "$$s2" ]; then \
241 install: install_sw install_ssldirs install_docs
243 uninstall: uninstall_docs uninstall_sw
246 rm -f $(PROGRAMS) $(TESTPROGS) $(ENGINES) $(SCRIPTS)
248 -rm -f `find . -name '*{- $depext -}'`
249 -rm -f `find . -name '*{- $objext -}'`
252 rm -f openssl.pc libcrypto.pc libssl.pc
253 -rm -f `find . -type l`
256 # This exists solely for those who still type 'make depend'
258 # We check if any depfile is newer than Makefile and decide to
259 # concatenate only if that is true, or if 'test' (a.k.a [ )
260 # doesn't have the option to figure it out (-nt).
262 # To check if test has the file age comparison operator, we
263 # simply try, and rely test to exit with 0 if the comparison
264 # was true, 1 if false, and most importantly, 2 if it doesn't
265 # recognise the operator.
267 @: {- output_off() if $disabled{makedepend}; "" -}
269 if [ Makefile -nt Makefile ] 2>/dev/null || [ $$? = 1 ]; then \
270 for d in $(DEPS); do \
271 if [ $$d -nt Makefile ]; then \
279 if [ $$catdepends = true ]; then \
280 ( sed -e '/^# DO NOT DELETE THIS LINE.*/,$$d' < Makefile; \
281 echo '# DO NOT DELETE THIS LINE -- make depend depends on it.'; \
283 for d in $(DEPS); do \
284 if [ -f $$d ]; then cat $$d; fi; \
285 done ) > Makefile.new; \
286 if cmp Makefile.new Makefile >/dev/null 2>&1; then \
287 rm -f Makefile.new; \
289 mv -f Makefile.new Makefile; \
292 @: {- output_on() if $disabled{makedepend}; "" -}
294 # Install helper targets #############################################
296 install_sw: all install_dev install_engines install_runtime
298 uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
300 install_docs: install_man_docs install_html_docs
302 uninstall_docs: uninstall_man_docs uninstall_html_docs
303 $(RM) -r -v $(DESTDIR)$(DOCDIR)
306 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/certs
307 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/private
310 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
311 @echo "*** Installing development files"
312 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/include/openssl
313 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
314 $(BLDDIR)/include/openssl/*.h; do \
316 echo "install $$i -> $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
317 cp $$i $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
318 chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
320 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
321 @set -e; for l in $(LIBS); do \
323 echo "install $$l -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn"; \
324 cp $$l $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
325 $(RANLIB) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
326 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
327 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new \
328 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn; \
330 @ : {- output_off() if $disabled{shared}; "" -}
331 @set -e; for s in $(SHLIB_INFO); do \
332 s1=`echo "$$s" | cut -f1 -d";"`; \
333 s2=`echo "$$s" | cut -f2 -d";"`; \
334 fn1=`basename $$s1`; \
335 fn2=`basename $$s2`; \
336 : {- output_off() if windowsdll(); "" -}; \
337 echo "install $$s1 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
338 cp $$s1 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new; \
339 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new; \
340 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new \
341 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1; \
342 if [ "$$fn1" != "$$fn2" ]; then \
343 echo "link $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
344 ln -sf $$fn1 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
346 : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
347 echo "install $$s2 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
348 cp $$s2 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new; \
349 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new; \
350 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new \
351 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
352 : {- output_on() unless windowsdll(); "" -}; \
354 @ : {- output_on() if $disabled{shared}; "" -}
355 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
356 @echo "install libcrypto.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc"
357 @cp libcrypto.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
358 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
359 @echo "install libssl.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc"
360 @cp libssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
361 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
362 @echo "install openssl.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc"
363 @cp openssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
364 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
367 @echo "*** Uninstalling development files"
368 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
369 $(BLDDIR)/include/openssl/*.h; do \
371 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
372 $(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
374 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include/openssl
375 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include
376 @set -e; for l in $(LIBS); do \
378 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn"; \
379 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn; \
381 @ : {- output_off() if $disabled{shared}; "" -}
382 @set -e; for s in $(SHLIB_INFO); do \
383 s1=`echo "$$s" | cut -f1 -d";"`; \
384 s2=`echo "$$s" | cut -f2 -d";"`; \
385 fn1=`basename $$s1`; \
386 fn2=`basename $$s2`; \
387 : {- output_off() if windowsdll(); "" -}; \
388 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
389 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1; \
390 if [ "$$fn1" != "$$fn2" ]; then \
391 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
392 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
394 : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
395 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
396 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
397 : {- output_on() unless windowsdll(); "" -}; \
399 @ : {- output_on() if $disabled{shared}; "" -}
400 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
401 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
402 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
403 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
404 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
407 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
408 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/
409 @echo "*** Installing engines"
410 @set -e; for e in $(ENGINES); do \
412 if [ "$$fn" = '{- dso("ossltest") -}' ]; then \
415 echo "install $$e -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn"; \
416 cp $$e $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new; \
417 chmod 755 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new; \
418 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new \
419 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn; \
423 @echo "*** Uninstalling engines"
424 @set -e; for e in $(ENGINES); do \
426 if [ "$$fn" = '{- dso("ossltest") -}' ]; then \
429 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn"; \
430 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn; \
432 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines
435 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
436 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
437 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/misc
438 @echo "*** Installing runtime files"
439 : {- output_off() unless windowsdll(); "" -};
440 @set -e; for s in $(SHLIBS); do \
442 echo "install $$s -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
443 cp $$s $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
444 chmod 644 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
445 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
446 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
448 : {- output_on() unless windowsdll(); "" -};
449 @set -e; for x in $(PROGRAMS); do \
451 echo "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
452 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
453 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
454 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
455 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
457 @set -e; for x in $(BIN_SCRIPTS); do \
459 echo "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
460 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
461 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
462 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
463 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
465 @set -e; for x in $(MISC_SCRIPTS); do \
467 echo "install $$x -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
468 cp $$x $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
469 chmod 755 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
470 mv -f $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new \
471 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
473 @echo "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf"
474 @cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
475 @chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
476 @mv -f $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
479 @echo "*** Uninstalling runtime files"
480 @set -e; for x in $(PROGRAMS); \
483 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
484 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
486 @set -e; for x in $(BIN_SCRIPTS); \
489 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
490 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
492 @set -e; for x in $(MISC_SCRIPTS); \
495 echo "$(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
496 $(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
498 : {- output_off() unless windowsdll(); "" -};
499 @set -e; for s in $(SHLIBS); do \
501 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
502 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
504 : {- output_on() unless windowsdll(); "" -};
505 $(RM) $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
506 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
507 -$(RMDIR) $(DESTDIR)$(OPENSSLDIR)/misc
509 # A method to extract all names from a .pod file
510 # The first sed extracts everything between "=head1 NAME" and the next =head1
511 # The second sed joins all the lines into one
512 # The third sed removes the description and turns all commas into spaces
513 # Voilà , you have a space separated list of names!
514 EXTRACT_NAMES=sed -e '1,/^=head1 *NAME *$$/d;/^=head1/,$$d' | \
515 sed -e ':a;{N;s/\n/ /;ba}' | \
516 sed -e 's/ - .*$$//;s/,/ /g'
519 here=`cd $(SRCDIR); pwd`; \
520 point=$$here/util/point.sh; \
521 for ds in apps:1 crypto:3 ssl:3; do \
522 defdir=`echo $$ds | cut -f1 -d:`; \
523 defsec=`echo $$ds | cut -f2 -d:`; \
524 for p in $(SRCDIR)/doc/$$defdir/*.pod; do \
525 SEC=`sed -ne 's/^=for *comment *openssl_manual_section: *\([0-9]\) *$$/\1/p' $$p`; \
526 [ -z "$$SEC" ] && SEC=$$defsec; \
527 fn=`basename $$p .pod`; \
528 NAME=`echo $$fn | tr [a-z] [A-Z]`; \
529 suf=`eval "echo $$OUTSUFFIX"`; \
530 top=`eval "echo $$OUTTOP"`; \
531 $(PERL) $(SRCDIR)/util/mkdir-p.pl $$top/man$$SEC; \
532 echo "install $$p -> $$top/man$$SEC/$$fn$$suf"; \
533 cat $$p | eval "$$GENERATE" \
534 > $$top/man$$SEC/$$fn$$suf; \
535 names=`cat $$p | $(EXTRACT_NAMES)`; \
536 ( cd $$top/man$$SEC; \
537 for n in $$names; do \
540 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
541 comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
542 comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
545 if [ "$$comp_n" != "$$comp_fn" ]; then \
546 echo "link $$top/man$$SEC/$$n$$suf -> $$top/man$$SEC/$$fn$$suf"; \
547 PLATFORM=$(PLATFORM) $$point $$fn$$suf $$n$$suf; \
554 here=`cd $(SRCDIR); pwd`; \
555 for ds in apps:1 crypto:3 ssl:3; do \
556 defdir=`echo $$ds | cut -f1 -d:`; \
557 defsec=`echo $$ds | cut -f2 -d:`; \
558 for p in $(SRCDIR)/doc/$$defdir/*.pod; do \
559 SEC=`sed -ne 's/^=for *comment *openssl_manual_section: *\([0-9]\) *$$/\1/p' $$p`; \
560 [ -z "$$SEC" ] && SEC=$$defsec; \
561 fn=`basename $$p .pod`; \
562 suf=`eval "echo $$OUTSUFFIX"`; \
563 top=`eval "echo $$OUTTOP"`; \
564 echo "$(RM) $$top/man$$SEC/$$fn$$suf"; \
565 $(RM) $$top/man$$SEC/$$fn$$suf; \
566 names=`cat $$p | $(EXTRACT_NAMES)`; \
567 for n in $$names; do \
570 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
571 comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
572 comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
575 if [ "$$comp_n" != "$$comp_fn" ]; then \
576 echo "$(RM) $$top/man$$SEC/$$n$$suf"; \
577 $(RM) $$top/man$$SEC/$$n$$suf; \
580 ( $(RMDIR) $$top/man$$SEC 2>/dev/null || exit 0 ); \
585 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
586 @echo "*** Installing manpages"
588 OUTSUFFIX='.$${SEC}$(MANSUFFIX)'; \
589 OUTTOP="$(DESTDIR)$(MANDIR)"; \
590 GENERATE='pod2man --name=$$NAME --section=$$SEC --center=OpenSSL --release=$(VERSION)'; \
594 @echo "*** Uninstalling manpages"
596 OUTSUFFIX='.$${SEC}$(MANSUFFIX)'; \
597 OUTTOP="$(DESTDIR)$(MANDIR)"; \
601 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
602 @echo "*** Installing HTML manpages"
604 OUTSUFFIX='.$(HTMLSUFFIX)'; \
605 OUTTOP="$(DESTDIR)$(HTMLDIR)"; \
606 GENERATE="pod2html --podroot=$(SRCDIR)/doc --htmldir=.. \
607 --podpath=apps:crypto:ssl \
608 | sed -e 's|href=\"http://man.he.net/man|href=\"../man|g'"; \
612 @echo "*** Uninstalling manpages"
614 OUTSUFFIX='.$(HTMLSUFFIX)'; \
615 OUTTOP="$(DESTDIR)$(HTMLDIR)"; \
619 # Developer targets (note: these are only available on Unix) #########
621 update: generate errors ordinals
623 generate: generate_apps generate_crypto_bn generate_crypto_objects
625 # Test coverage is a good idea for the future
626 #coverage: $(PROGRAMS) $(TESTPROGRAMS)
629 # Currently disabled, util/selftest.pl needs a rewrite
631 # SRCDIR=$(SRCDIR) @$(PERL) util/selftest.pl
634 lint -DLINT $(INCLUDES) $(SRCS)
636 generate_apps: $(SRCDIR)/apps/openssl-vms.cnf $(SRCDIR)/apps/progs.h
638 generate_crypto_bn: $(SRCDIR)/crypto/bn/bn_prime.h
640 generate_crypto_objects: $(SRCDIR)/crypto/objects/obj_dat.h \
641 $(SRCDIR)/include/openssl/obj_mac.h \
642 $(SRCDIR)/crypto/objects/obj_xref.h
645 ( cd $(SRCDIR); $(PERL) util/ck_errf.pl -strict */*.c */*/*.c )
646 ( cd $(SRCDIR); $(PERL) util/mkerr.pl -recurse -write )
647 ( cd $(SRCDIR)/engines; \
649 $(PERL) ../util/mkerr.pl -conf $$e \
650 -nostatic -staticloader -write *.c; \
654 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl crypto update )
655 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl ssl update )
659 SRCTOP=../$(SRCDIR) \
660 BLDTOP=../$(BLDDIR) \
661 $(PERL) ../$(SRCDIR)/test/run_tests.pl test_ordinals )
666 -etags `find . -name '*.[ch]' -o -name '*.pm'`
668 # Release targets (note: only available on Unix) #####################
670 TAR_COMMAND=$(TAR) $(TARFLAGS) --owner 0 --group 0 -cvf -
673 TMPDIR=/var/tmp/openssl-copy.$$$$; \
675 mkdir -p $$TMPDIR/$$DISTDIR; \
677 git ls-tree -r --name-only --full-tree HEAD \
679 mkdir -p $$TMPDIR/$$DISTDIR/`dirname $$F`; \
680 cp $$F $$TMPDIR/$$DISTDIR/$$F; \
684 find $$TMPDIR/$$DISTDIR -type d -print | xargs chmod 755; \
685 find $$TMPDIR/$$DISTDIR -type f -print | xargs chmod a+r; \
686 find $$TMPDIR/$$DISTDIR -type f -perm -0100 -print | xargs chmod a+x; \
687 $(TAR_COMMAND) $$DISTDIR) \
688 | (cd $(SRCDIR); gzip --best > $(TARFILE).gz); \
690 cd $(SRCDIR); ls -l $(TARFILE).gz
693 @$(MAKE) PREPARE_CMD='./Configure dist' tar
695 # Helper targets #####################################################
697 link-utils: $(BLDDIR)/util/opensslwrap.sh $(BLDDIR)/util/shlib_wrap.sh
699 $(BLDDIR)/util/opensslwrap.sh: configdata.pm
700 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
701 mkdir -p "$(BLDDIR)/util"; \
702 ln -sf "../$(SRCDIR)/util/opensslwrap.sh" "$(BLDDIR)/util"; \
704 $(BLDDIR)/util/shlib_wrap.sh: configdata.pm
705 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
706 mkdir -p "$(BLDDIR)/util"; \
707 ln -sf "../$(SRCDIR)/util/shlib_wrap.sh" "$(BLDDIR)/util"; \
710 $(SRCDIR)/apps/openssl-vms.cnf: $(SRCDIR)/apps/openssl.cnf
711 $(PERL) $(SRCDIR)/VMS/VMSify-conf.pl \
712 < $(SRCDIR)/apps/openssl.cnf > $(SRCDIR)/apps/openssl-vms.cnf
714 {- # because the program apps/openssl has object files as sources, and
715 # they then have the corresponding C files as source, we need to chain
716 # the lookups in %unified_info
717 my $apps_openssl = catfile("apps","openssl");
718 our @openssl_source = map { @{$unified_info{sources}->{$_}} }
719 @{$unified_info{sources}->{$apps_openssl}};
721 $(SRCDIR)/apps/progs.h:
723 $(PERL) $(SRCDIR)/apps/progs.pl {- join(" ", @openssl_source) -} > $@
725 $(SRCDIR)/crypto/bn/bn_prime.h: $(SRCDIR)/crypto/bn/bn_prime.pl
726 $(PERL) $(SRCDIR)/crypto/bn/bn_prime.pl > $(SRCDIR)/crypto/bn/bn_prime.h
728 $(SRCDIR)/crypto/objects/obj_dat.h: $(SRCDIR)/crypto/objects/obj_dat.pl \
729 $(SRCDIR)/include/openssl/obj_mac.h
730 $(PERL) $(SRCDIR)/crypto/objects/obj_dat.pl \
731 $(SRCDIR)/include/openssl/obj_mac.h \
732 $(SRCDIR)/crypto/objects/obj_dat.h
734 # objects.pl both reads and writes obj_mac.num
735 $(SRCDIR)/include/openssl/obj_mac.h: $(SRCDIR)/crypto/objects/objects.pl \
736 $(SRCDIR)/crypto/objects/objects.txt \
737 $(SRCDIR)/crypto/objects/obj_mac.num
738 $(PERL) $(SRCDIR)/crypto/objects/objects.pl \
739 $(SRCDIR)/crypto/objects/objects.txt \
740 $(SRCDIR)/crypto/objects/obj_mac.num \
741 $(SRCDIR)/include/openssl/obj_mac.h
742 @sleep 1; touch $(SRCDIR)/include/openssl/obj_mac.h; sleep 1
744 $(SRCDIR)/crypto/objects/obj_xref.h: $(SRCDIR)/crypto/objects/objxref.pl \
745 $(SRCDIR)/crypto/objects/obj_xref.txt \
746 $(SRCDIR)/crypto/objects/obj_mac.num
747 $(PERL) $(SRCDIR)/crypto/objects/objxref.pl \
748 $(SRCDIR)/crypto/objects/obj_mac.num \
749 $(SRCDIR)/crypto/objects/obj_xref.txt \
750 > $(SRCDIR)/crypto/objects/obj_xref.h
751 @sleep 1; touch $(SRCDIR)/crypto/objects/obj_xref.h; sleep 1
755 # Building targets ###################################################
757 libcrypto.pc libssl.pc openssl.pc: configdata.pm $(LIBS)
759 @ ( echo 'prefix=$(INSTALLTOP)'; \
760 echo 'exec_prefix=$${prefix}'; \
761 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
762 echo 'includedir=$${prefix}/include'; \
764 echo 'Name: OpenSSL-libcrypto'; \
765 echo 'Description: OpenSSL cryptography library'; \
766 echo 'Version: '$(VERSION); \
767 echo 'Libs: -L$${libdir} -lcrypto'; \
768 echo 'Libs.private: $(EX_LIBS)'; \
769 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
772 @ ( echo 'prefix=$(INSTALLTOP)'; \
773 echo 'exec_prefix=$${prefix}'; \
774 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
775 echo 'includedir=$${prefix}/include'; \
777 echo 'Name: OpenSSL-libssl'; \
778 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
779 echo 'Version: '$(VERSION); \
780 echo 'Requires.private: libcrypto'; \
781 echo 'Libs: -L$${libdir} -lssl'; \
782 echo 'Libs.private: $(EX_LIBS)'; \
783 echo 'Cflags: -I$${includedir}' ) > libssl.pc
786 @ ( echo 'prefix=$(INSTALLTOP)'; \
787 echo 'exec_prefix=$${prefix}'; \
788 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
789 echo 'includedir=$${prefix}/include'; \
791 echo 'Name: OpenSSL'; \
792 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
793 echo 'Version: '$(VERSION); \
794 echo 'Requires: libssl libcrypto' ) > openssl.pc
796 # Note on the use of $(MFLAGS): this was an older variant of MAKEFLAGS which
797 # wasn't passed down automatically. It's quite safe to use it like we do
798 # below; if it doesn't exist, the result will be empty and 'make' will pick
799 # up $(MAKEFLAGS) which is passed down as an environment variable.
800 configdata.pm: {- $config{build_file_template} -} $(SRCDIR)/Configurations/common.tmpl $(SRCDIR)/Configure $(SRCDIR)/config {- join(" ", @{$config{build_infos}}) -}
801 @echo "Detected changed: $?"
802 @echo "Reconfiguring..."
803 $(SRCDIR)/Configure reconf
804 @echo "**************************************************"
806 @echo "*** Please run the same make command again ***"
808 @echo "**************************************************"
813 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
815 # Helper function to figure out dependencies on libraries
816 # It takes a list of library names and outputs a list of dependencies
817 sub compute_lib_depends {
818 if ($disabled{shared}) {
819 return map { $_.$libext } @_;
822 # Depending on shared libraries:
823 # On Windows POSIX layers, we depend on {libname}.dll.a
824 # On Unix platforms, we depend on {shlibname}.so
825 return map { shlib_simple($_) } @_;
830 my $generator = join(" ", @{$args{generator}});
831 my $incs = join("", map { " -I".$_ } @{$args{incs}});
833 if ($args{src} !~ /\.[sS]$/) {
835 $args{src}: $args{generator}->[0]
836 \$(PERL) $generator > \$@
839 if ($args{generator}->[0] =~ /\.pl$/) {
840 $generator = 'CC="$(CC)" $(PERL) '.$generator;
841 } elsif ($args{generator}->[0] =~ /\.m4$/) {
842 $generator = 'm4 -B 8192 '.$generator.' >'
843 } elsif ($args{generator}->[0] =~ /\.S$/) {
846 die "Generator type for $args{src} unknown: $generator\n";
849 if (defined($generator)) {
850 # If the target is named foo.S in build.info, we want to
851 # end up generating foo.s in two steps.
852 if ($args{src} =~ /\.S$/) {
853 (my $target = $args{src}) =~ s|\.S$|.s|;
855 $target: $args{generator}->[0]
856 ( trap "rm -f \$@.*" INT 0; \\
858 \$(CC) \$(CFLAGS) $incs -E -P \$@.S > \$@.i && mv -f \$@.i \$@ )
863 $args{src}: $args{generator}->[0]
868 $args{src}: $args{generator}->[0]
869 \$(CC) \$(CFLAGS) $incs -E -P \$< > \$@
874 # Should one wonder about the end of the Perl snippet, it's because this
875 # second regexp eats up line endings as well, if the removed path is the
876 # last in the line. We may therefore need to put back a line ending.
879 my $obj = $args{obj};
880 my @srcs = map { (my $x = $_) =~ s/\.S$/.s/; $x } ( @{$args{srcs}} );
881 my $srcs = join(" ", @srcs);
882 my $deps = join(" ", @srcs, @{$args{deps}});
883 my $incs = join("", map { " -I".$_ } @{$args{incs}});
884 my $ecflags = { lib => '$(LIB_CFLAGS)',
885 dso => '$(DSO_CFLAGS)',
886 bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
887 my $makedepprog = $config{makedepprog};
889 if (!$disabled{makedepend} && $makedepprog =~ /\/makedepend/) {
892 rm -f \$\@.tmp; touch \$\@.tmp
893 -\$(MAKEDEPEND) -f\$\@.tmp -o"|$obj$objext" -- \$(CFLAGS) $ecflags$incs -- $srcs \\
895 perl -i -pe 's/^.*\\|//; s/ \\/(\\\\.|[^ ])*//; \$\$_ = undef if (/: *\$\$/ || /^(#.*| *)\$\$/); \$\$_.="\\n" unless !defined(\$\$_) or /\\R\$\$/g;' \$\@.tmp
896 \@if cmp \$\@.tmp \$\@ > /dev/null 2> /dev/null; then \\
902 $deps = $obj.$depext;
904 if ($disabled{makedepend} || $makedepprog =~ /\/makedepend/) {
907 \$(CC) \$(CFLAGS) $ecflags$incs -c -o \$\@ $srcs
910 if (!$disabled{makedepend} && $makedepprog !~ /\/makedepend/) {
913 \$(CC) \$(CFLAGS) $ecflags$incs -MMD -MF $obj$depext.tmp -MT \$\@ -c -o \$\@ $srcs
914 \@touch $obj$depext.tmp
915 \@if cmp $obj$depext.tmp $obj$depext > /dev/null 2> /dev/null; then \\
916 rm -f $obj$depext.tmp; \\
918 mv $obj$depext.tmp $obj$depext; \\
924 # On Unix, we build shlibs from static libs, so we're ignoring the
925 # object file array. We *know* this routine is only called when we've
926 # configure 'shared'.
929 my $lib = $args{lib};
930 my $shlib = $args{shlib};
931 my $libd = dirname($lib);
932 my $libn = basename($lib);
933 (my $libname = $libn) =~ s/^lib//;
934 my $linklibs = join("", map { my $d = dirname($_);
935 my $f = basename($_);
936 (my $l = $f) =~ s/^lib//;
937 " -L$d -l$l" } @{$args{deps}});
938 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
939 my $shlib_target = $target{shared_target};
940 my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : "";
941 my $target = shlib_simple($lib);
943 # With a build on a Windows POSIX layer (Cygwin or Mingw), we know for a fact
944 # that two files get produced, {shlibname}.dll and {libname}.dll.a.
945 # With all other Unix platforms, we often build a shared library with the
946 # SO version built into the file name and a symlink without the SO version
947 # It's not necessary to have both as targets. The choice falls on the
948 # simplest, {libname}$shlibextimport for Windows POSIX layers and
949 # {libname}$shlibextsimple for the Unix platforms.
950 $target: $lib$libext $deps $ordinalsfile
951 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
952 PLATFORM=\$(PLATFORM) \\
953 PERL=\$(PERL) SRCDIR='\$(SRCDIR)' DSTDIR="$libd" \\
954 INSTALLTOP='\$(INSTALLTOP)' LIBDIR='\$(LIBDIR)' \\
955 LIBDEPS='\$(PLIB_LDFLAGS) '"$linklibs"' \$(EX_LIBS)' \\
956 LIBNAME=$libname LIBVERSION=\$(SHLIB_MAJOR).\$(SHLIB_MINOR) \\
957 LIBCOMPATVERSIONS=';\$(SHLIB_VERSION_HISTORY)' \\
958 CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(LIB_CFLAGS)' \\
959 CROSS_COMPILE='\$(CROSS_COMPILE)' LDFLAGS='\$(LDFLAGS)' \\
960 SHARED_LDFLAGS='\$(LIB_LDFLAGS)' SHLIB_EXT=$shlibext \\
961 SHARED_RCFLAGS='\$(RCFLAGS)' \\
962 link_shlib.$shlib_target
964 . (windowsdll() ? <<"EOF" : "");
965 rm -f apps/$shlib$shlibext
966 rm -f test/$shlib$shlibext
967 cp -p $shlib$shlibext apps/
968 cp -p $shlib$shlibext test/
973 my $lib = $args{lib};
974 my $libd = dirname($lib);
975 my $libn = basename($lib);
976 (my $libname = $libn) =~ s/^lib//;
977 my $shlibdeps = join("", map { my $d = dirname($_);
978 my $f = basename($_);
979 (my $l = $f) =~ s/^lib//;
980 " -L$d -l$l" } @{$args{deps}});
981 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
982 my $shlib_target = $target{shared_target};
983 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
984 my $target = dso($lib);
987 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
988 PLATFORM=\$(PLATFORM) \\
989 PERL=\$(PERL) SRCDIR='\$(SRCDIR)' DSTDIR="$libd" \\
990 LIBDEPS='\$(PLIB_LDFLAGS) '"$shlibdeps"' \$(EX_LIBS)' \\
991 LIBNAME=$libname LDFLAGS='\$(LDFLAGS)' \\
992 CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(DSO_CFLAGS)' \\
993 SHARED_LDFLAGS='\$(DSO_LDFLAGS)' \\
996 link_dso.$shlib_target
1001 my $lib = $args{lib};
1002 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
1006 \$(RANLIB) \$\@ || echo Never mind.
1011 my $bin = $args{bin};
1012 my $bind = dirname($bin);
1013 my $binn = basename($bin);
1014 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
1015 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
1016 my $linklibs = join("", map { my $d = dirname($_);
1017 my $f = basename($_);
1018 $d = "." if $d eq $f;
1019 (my $l = $f) =~ s/^lib//;
1020 " -L$d -l$l" } @{$args{deps}});
1021 my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
1023 $bin$exeext: $objs $deps
1025 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
1026 PERL=\$(PERL) SRCDIR=\$(SRCDIR) \\
1027 APPNAME=$bin$exeext OBJECTS="$objs" \\
1028 LIBDEPS='\$(PLIB_LDFLAGS) '"$linklibs"' \$(EX_LIBS)' \\
1029 CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(BIN_CFLAGS)' \\
1030 LDFLAGS='\$(LDFLAGS)' LIBRPATH='\$(INSTALLTOP)/\$(LIBDIR)' \\
1031 link_app.$shlib_target
1036 my $script = $args{script};
1037 my $sources = join(" ", @{$args{sources}});
1038 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
1039 "util", "dofile.pl")),
1040 rel2abs($config{builddir}));
1043 \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
1044 "-o$target{build_file}" $sources > "$script"
1048 "" # Important! This becomes part of the template result.