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 {- output_off() if $disabled{apps}; "" -}
90 BIN_SCRIPTS=$(BLDDIR)/tools/c_rehash
91 MISC_SCRIPTS=$(SRCDIR)/tools/c_hash $(SRCDIR)/tools/c_info \
92 $(SRCDIR)/tools/c_issuer $(SRCDIR)/tools/c_name \
93 $(BLDDIR)/apps/CA.pl $(BLDDIR)/apps/tsget
94 {- output_on() if $disabled{apps}; "" -}
96 SHLIB_INFO={- join(" ", map { "\"".shlib($_).";".shlib_simple($_)."\"" } @{$unified_info{libraries}}) -}
98 # DESTDIR is for package builders so that they can configure for, say,
99 # /usr/ and yet have everything installed to /tmp/somedir/usr/.
100 # Normally it is left empty.
103 # Do not edit these manually. Use Configure with --prefix or --openssldir
104 # to change this! Short explanation in the top comment in Configure
105 INSTALLTOP={- # $prefix is used in the OPENSSLDIR perl snippet
107 our $prefix = $config{prefix} || "/usr/local";
110 # The logic here is that if no --openssldir was given,
111 # OPENSSLDIR will get the value from $prefix plus "/ssl".
112 # If --openssldir was given and the value is an absolute
113 # path, OPENSSLDIR will get its value without change.
114 # If the value from --openssldir is a relative path,
115 # OPENSSLDIR will get $prefix with the --openssldir
116 # value appended as a subdirectory.
118 use File::Spec::Functions;
120 $config{openssldir} ?
121 (file_name_is_absolute($config{openssldir}) ?
123 : catdir($prefix, $config{openssldir}))
124 : catdir($prefix, "ssl");
127 # if $prefix/lib$target{multilib} is not an existing
128 # directory, then assume that it's not searched by linker
129 # automatically, in which case adding $target{multilib} suffix
130 # causes more grief than we're ready to tolerate, so don't...
132 -d "$prefix/lib$target{multilib}" ? $target{multilib} : "";
133 our $libdir = $config{libdir} || "lib$multilib";
135 ENGINESDIR={- use File::Spec::Functions;
136 catdir($prefix,$libdir,"engines") -}
138 MANDIR=$(INSTALLTOP)/share/man
139 DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME)
140 HTMLDIR=$(DOCDIR)/html
142 # MANSUFFIX is for the benefit of anyone who may want to have a suffix
143 # appended after the manpage file section number. "ssl" is popular,
144 # resulting in files such as config.5ssl rather than config.5.
150 CROSS_COMPILE= {- $config{cross_compile_prefix} -}
151 CC= $(CROSS_COMPILE){- $target{cc} -}
152 CFLAGS={- our $cflags2 = join(" ",(map { "-D".$_} @{$target{defines}}, @{$config{defines}}),"-DOPENSSLDIR=\"\\\"\$(OPENSSLDIR)\\\"\"","-DENGINESDIR=\"\\\"\$(ENGINESDIR)\\\"\"") -} {- $target{cflags} -} {- $config{cflags} -}
153 CFLAGS_Q={- $cflags2 =~ s|([\\"])|\\$1|g; $cflags2 -} {- $config{cflags} -}
154 LDFLAGS= {- $target{lflags} -}
155 PLIB_LDFLAGS= {- $target{plib_lflags} -}
156 EX_LIBS= {- $target{ex_libs} -} {- $config{ex_libs} -}
157 LIB_CFLAGS={- $target{shared_cflag} || "" -}
158 LIB_LDFLAGS={- $target{shared_ldflag}." ".$config{shared_ldflag}
159 # Unlike other OSes (like Solaris, Linux, Tru64,
160 # IRIX) BSD run-time linkers (tested OpenBSD, NetBSD
161 # and FreeBSD) "demand" RPATH set on .so objects.
162 # Apparently application RPATH is not global and
163 # does not apply to .so linked with other .so.
164 # Problem manifests itself when libssl.so fails to
165 # load libcrypto.so. One can argue that we should
166 # engrave this into Makefile.shared rules or into
167 # BSD-* config lines above. Meanwhile let's try to
168 # be cautious and pass -rpath to linker only when
169 # $prefix is not /usr.
170 . ($config{target} =~ m|^BSD-| && $prefix !~ m|^/usr/.*$|
171 ? " -Wl,-rpath,\$\$(LIBRPATH)" : "") -}
172 DSO_CFLAGS={- $target{shared_cflag} || "" -}
173 DSO_LDFLAGS=$(LIB_LDFLAGS)
174 BIN_CFLAGS={- $target{bin_cflags} -}
176 PERL={- $config{perl} -}
178 ARFLAGS= {- $target{arflags} -}
179 AR=$(CROSS_COMPILE){- $target{ar} || "ar" -} $(ARFLAGS) r
180 RANLIB= {- $target{ranlib} -}
181 NM= $(CROSS_COMPILE){- $target{nm} || "nm" -}
182 RCFLAGS={- $target{shared_rcflag} -}
183 RC= $(CROSS_COMPILE){- $target{rc} || "windres" -}
186 TAR= {- $target{tar} || "tar" -}
187 TARFLAGS= {- $target{tarflags} -}
188 MAKEDEPEND={- $config{makedepprog} -}
191 NAME= $(BASENAME)-$(VERSION)
192 TARFILE= ../$(NAME).tar
194 # We let the C compiler driver to take care of .s files. This is done in
195 # order to be excused from maintaining a separate set of architecture
196 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
197 # gcc, then the driver will automatically translate it to -xarch=v8plus
198 # and pass it down to assembler.
201 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
203 # For x86 assembler: Set PROCESSOR to 386 if you want to support
205 PROCESSOR= {- $config{processor} -}
207 # The main targets ###################################################
209 all: configdata.pm build_libs_nodep build_engines_nodep build_apps_nodep \
212 build_libs: configdata.pm build_libs_nodep depend
213 build_libs_nodep: libcrypto.pc libssl.pc openssl.pc
214 build_engines: configdata.pm build_engines_nodep depend
215 build_engines_nodep: $(ENGINES)
216 build_apps: configdata.pm build_apps_nodep depend
217 build_apps_nodep: $(PROGRAMS) $(SCRIPTS)
218 build_tests: configdata.pm build_tests_nodep depend
219 build_tests_nodep: $(TESTPROGS)
222 tests: build_tests_nodep build_apps_nodep build_engines_nodep \
224 @ : {- output_off() if $disabled{tests}; "" -}
226 SRCTOP=../$(SRCDIR) \
227 BLDTOP=../$(BLDDIR) \
228 EXE_EXT={- $exeext -} \
229 OPENSSL_ENGINES=../$(BLDDIR)/engines \
230 $(PERL) ../$(SRCDIR)/test/run_tests.pl $(TESTS) )
231 @ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
232 @echo "Tests are not supported with your chosen Configure options"
233 @ : {- output_on() if !$disabled{tests}; "" -}
236 @TOP=$(SRCDIR) PERL=$(PERL) $(PERL) $(SRCDIR)/test/run_tests.pl list
239 @set -e; for s in $(SHLIB_INFO); do \
240 s1=`echo "$$s" | cut -f1 -d";"`; \
241 s2=`echo "$$s" | cut -f2 -d";"`; \
244 if [ "$$s1" != "$$s2" ]; then \
251 install: install_sw install_ssldirs install_docs
253 uninstall: uninstall_docs uninstall_sw
256 rm -f $(PROGRAMS) $(TESTPROGS) $(ENGINES) $(SCRIPTS)
258 -rm -f `find . -name '*{- $depext -}'`
259 -rm -f `find . -name '*{- $objext -}'`
262 rm -f openssl.pc libcrypto.pc libssl.pc
263 -rm -f `find . -type l -a \! -path "./.git/*"`
266 # This exists solely for those who still type 'make depend'
268 # We check if any depfile is newer than Makefile and decide to
269 # concatenate only if that is true.
271 @: {- output_off() if $disabled{makedepend}; "" -}
272 @if [ -n "`find $(DEPS) -newer Makefile 2>/dev/null; exit 0`" ]; then \
273 ( sed -e '/^# DO NOT DELETE THIS LINE.*/,$$d' < Makefile; \
274 echo '# DO NOT DELETE THIS LINE -- make depend depends on it.'; \
276 for f in $(DEPS); do \
277 if [ -f $$f ]; then cat $$f; fi; \
278 done ) > Makefile.new; \
279 if cmp Makefile.new Makefile >/dev/null 2>&1; then \
280 rm -f Makefile.new; \
282 mv -f Makefile.new Makefile; \
285 @: {- output_on() if $disabled{makedepend}; "" -}
287 # Install helper targets #############################################
289 install_sw: all install_dev install_engines install_runtime
291 uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
293 install_docs: install_man_docs install_html_docs
295 uninstall_docs: uninstall_man_docs uninstall_html_docs
296 $(RM) -r -v $(DESTDIR)$(DOCDIR)
299 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/certs
300 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/private
303 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
304 @echo "*** Installing development files"
305 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/include/openssl
306 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
307 $(BLDDIR)/include/openssl/*.h; do \
309 echo "install $$i -> $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
310 cp $$i $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
311 chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
313 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
314 @set -e; for l in $(LIBS); do \
316 echo "install $$l -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn"; \
317 cp $$l $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
318 $(RANLIB) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
319 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
320 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new \
321 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn; \
323 @ : {- output_off() if $disabled{shared}; "" -}
324 @set -e; for s in $(SHLIB_INFO); do \
325 s1=`echo "$$s" | cut -f1 -d";"`; \
326 s2=`echo "$$s" | cut -f2 -d";"`; \
327 fn1=`basename $$s1`; \
328 fn2=`basename $$s2`; \
329 : {- output_off() if windowsdll(); "" -}; \
330 echo "install $$s1 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
331 cp $$s1 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new; \
332 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new; \
333 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new \
334 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1; \
335 if [ "$$fn1" != "$$fn2" ]; then \
336 echo "link $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
337 ln -sf $$fn1 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
339 : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
340 echo "install $$s2 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
341 cp $$s2 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new; \
342 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new; \
343 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new \
344 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
345 : {- output_on() unless windowsdll(); "" -}; \
347 @ : {- output_on() if $disabled{shared}; "" -}
348 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
349 @echo "install libcrypto.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc"
350 @cp libcrypto.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
351 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
352 @echo "install libssl.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc"
353 @cp libssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
354 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
355 @echo "install openssl.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc"
356 @cp openssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
357 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
360 @echo "*** Uninstalling development files"
361 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
362 $(BLDDIR)/include/openssl/*.h; do \
364 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
365 $(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
367 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include/openssl
368 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include
369 @set -e; for l in $(LIBS); do \
371 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn"; \
372 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn; \
374 @ : {- output_off() if $disabled{shared}; "" -}
375 @set -e; for s in $(SHLIB_INFO); do \
376 s1=`echo "$$s" | cut -f1 -d";"`; \
377 s2=`echo "$$s" | cut -f2 -d";"`; \
378 fn1=`basename $$s1`; \
379 fn2=`basename $$s2`; \
380 : {- output_off() if windowsdll(); "" -}; \
381 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
382 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1; \
383 if [ "$$fn1" != "$$fn2" ]; then \
384 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
385 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
387 : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
388 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
389 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
390 : {- output_on() unless windowsdll(); "" -}; \
392 @ : {- output_on() if $disabled{shared}; "" -}
393 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
394 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
395 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
396 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
397 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
400 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
401 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/
402 @echo "*** Installing engines"
403 @set -e; for e in dummy $(ENGINES); do \
404 if [ "$$e" = "dummy" ]; then continue; fi; \
406 if [ "$$fn" = '{- dso("ossltest") -}' ]; then \
409 echo "install $$e -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn"; \
410 cp $$e $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new; \
411 chmod 755 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new; \
412 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new \
413 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn; \
417 @echo "*** Uninstalling engines"
418 @set -e; for e in dummy $(ENGINES); do \
419 if [ "$$e" = "dummy" ]; then continue; fi; \
421 if [ "$$fn" = '{- dso("ossltest") -}' ]; then \
424 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn"; \
425 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn; \
427 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines
430 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
431 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
432 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/misc
433 @echo "*** Installing runtime files"
434 : {- output_off() unless windowsdll(); "" -};
435 @set -e; for s in dummy $(SHLIBS); do \
436 if [ "$$s" = "dummy" ]; then continue; fi; \
438 echo "install $$s -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
439 cp $$s $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
440 chmod 644 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
441 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
442 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
444 : {- output_on() unless windowsdll(); "" -};
445 @set -e; for x in dummy $(PROGRAMS); do \
446 if [ "$$x" = "dummy" ]; then continue; fi; \
448 echo "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
449 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
450 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
451 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
452 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
454 @set -e; for x in dummy $(BIN_SCRIPTS); do \
455 if [ "$$x" = "dummy" ]; then continue; fi; \
457 echo "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
458 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
459 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
460 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
461 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
463 @set -e; for x in dummy $(MISC_SCRIPTS); do \
464 if [ "$$x" = "dummy" ]; then continue; fi; \
466 echo "install $$x -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
467 cp $$x $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
468 chmod 755 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
469 mv -f $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new \
470 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
472 @echo "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf"
473 @cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
474 @chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
475 @mv -f $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
478 @echo "*** Uninstalling runtime files"
479 @set -e; for x in dummy $(PROGRAMS); \
481 if [ "$$x" = "dummy" ]; then continue; fi; \
483 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
484 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
486 @set -e; for x in dummy $(BIN_SCRIPTS); \
488 if [ "$$x" = "dummy" ]; then continue; fi; \
490 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
491 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
493 @set -e; for x in dummy $(MISC_SCRIPTS); \
495 if [ "$$x" = "dummy" ]; then continue; fi; \
497 echo "$(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
498 $(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
500 : {- output_off() unless windowsdll(); "" -};
501 @set -e; for s in dummy $(SHLIBS); do \
502 if [ "$$s" = "dummy" ]; then continue; fi; \
504 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
505 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
507 : {- output_on() unless windowsdll(); "" -};
508 $(RM) $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
509 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
510 -$(RMDIR) $(DESTDIR)$(OPENSSLDIR)/misc
512 # A method to extract all names from a .pod file
513 # The first sed extracts everything between "=head1 NAME" and the next =head1
514 # The perl command joins all the lines into one
515 # The second sed removes the description and turns all commas into spaces
516 # Voilà , you have a space separated list of names!
517 EXTRACT_NAMES=sed -e '1,/^=head1 *NAME *$$/d;/^=head1/,$$d' | \
518 $(PERL) -p -0 -e 's/\n/ /g; END {print "\n"}' | \
519 sed -e 's/ - .*$$//;s/,/ /g'
522 here=`cd $(SRCDIR); pwd`; \
523 point=$$here/util/point.sh; \
524 for ds in apps:1 crypto:3 ssl:3; do \
525 defdir=`echo $$ds | cut -f1 -d:`; \
526 defsec=`echo $$ds | cut -f2 -d:`; \
527 for p in $(SRCDIR)/doc/$$defdir/*.pod; do \
528 SEC=`sed -ne 's/^=for *comment *openssl_manual_section: *\([0-9]\) *$$/\1/p' $$p`; \
529 [ -z "$$SEC" ] && SEC=$$defsec; \
530 fn=`basename $$p .pod`; \
531 NAME=`echo $$fn | tr [a-z] [A-Z]`; \
532 suf=`eval "echo $$OUTSUFFIX"`; \
533 top=`eval "echo $$OUTTOP"`; \
534 $(PERL) $(SRCDIR)/util/mkdir-p.pl $$top/man$$SEC; \
535 echo "install $$p -> $$top/man$$SEC/$$fn$$suf"; \
536 cat $$p | eval "$$GENERATE" \
537 > $$top/man$$SEC/$$fn$$suf; \
538 names=`cat $$p | $(EXTRACT_NAMES)`; \
539 ( cd $$top/man$$SEC; \
540 for n in $$names; do \
543 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
544 comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
545 comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
548 if [ "$$comp_n" != "$$comp_fn" ]; then \
549 echo "link $$top/man$$SEC/$$n$$suf -> $$top/man$$SEC/$$fn$$suf"; \
550 PLATFORM=$(PLATFORM) $$point $$fn$$suf $$n$$suf; \
557 here=`cd $(SRCDIR); pwd`; \
558 for ds in apps:1 crypto:3 ssl:3; do \
559 defdir=`echo $$ds | cut -f1 -d:`; \
560 defsec=`echo $$ds | cut -f2 -d:`; \
561 for p in $(SRCDIR)/doc/$$defdir/*.pod; do \
562 SEC=`sed -ne 's/^=for *comment *openssl_manual_section: *\([0-9]\) *$$/\1/p' $$p`; \
563 [ -z "$$SEC" ] && SEC=$$defsec; \
564 fn=`basename $$p .pod`; \
565 suf=`eval "echo $$OUTSUFFIX"`; \
566 top=`eval "echo $$OUTTOP"`; \
567 echo "$(RM) $$top/man$$SEC/$$fn$$suf"; \
568 $(RM) $$top/man$$SEC/$$fn$$suf; \
569 names=`cat $$p | $(EXTRACT_NAMES)`; \
570 for n in $$names; do \
573 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
574 comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
575 comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
578 if [ "$$comp_n" != "$$comp_fn" ]; then \
579 echo "$(RM) $$top/man$$SEC/$$n$$suf"; \
580 $(RM) $$top/man$$SEC/$$n$$suf; \
583 ( $(RMDIR) $$top/man$$SEC 2>/dev/null || exit 0 ); \
588 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
589 @echo "*** Installing manpages"
591 OUTSUFFIX='.$${SEC}$(MANSUFFIX)'; \
592 OUTTOP="$(DESTDIR)$(MANDIR)"; \
593 GENERATE='pod2man --name=$$NAME --section=$$SEC --center=OpenSSL --release=$(VERSION)'; \
597 @echo "*** Uninstalling manpages"
599 OUTSUFFIX='.$${SEC}$(MANSUFFIX)'; \
600 OUTTOP="$(DESTDIR)$(MANDIR)"; \
604 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
605 @echo "*** Installing HTML manpages"
607 OUTSUFFIX='.$(HTMLSUFFIX)'; \
608 OUTTOP="$(DESTDIR)$(HTMLDIR)"; \
609 GENERATE="pod2html --podroot=$(SRCDIR)/doc --htmldir=.. \
610 --podpath=apps:crypto:ssl \
611 | sed -e 's|href=\"http://man.he.net/man|href=\"../man|g'"; \
615 @echo "*** Uninstalling manpages"
617 OUTSUFFIX='.$(HTMLSUFFIX)'; \
618 OUTTOP="$(DESTDIR)$(HTMLDIR)"; \
622 # Developer targets (note: these are only available on Unix) #########
624 update: generate errors ordinals
626 generate: generate_apps generate_crypto_bn generate_crypto_objects \
627 generate_crypto_conf generate_crypto_asn1
629 # Test coverage is a good idea for the future
630 #coverage: $(PROGRAMS) $(TESTPROGRAMS)
633 # Currently disabled, util/selftest.pl needs a rewrite
635 # SRCDIR=$(SRCDIR) @$(PERL) util/selftest.pl
638 lint -DLINT $(INCLUDES) $(SRCS)
640 {- # because the program apps/openssl has object files as sources, and
641 # they then have the corresponding C files as source, we need to chain
642 # the lookups in %unified_info
643 my $apps_openssl = catfile("apps","openssl");
644 our @openssl_source = map { @{$unified_info{sources}->{$_}} }
645 @{$unified_info{sources}->{$apps_openssl}};
648 ( cd $(SRCDIR); $(PERL) VMS/VMSify-conf.pl \
649 < apps/openssl.cnf > apps/openssl-vms.cnf )
650 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b apps/progs.pl \
651 {- join(" ", @openssl_source) -} \
655 ( cd $(SRCDIR); $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h )
657 generate_crypto_objects:
658 ( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl \
659 crypto/objects/objects.txt \
660 crypto/objects/obj_mac.num \
661 include/openssl/obj_mac.h )
662 ( cd $(SRCDIR); $(PERL) crypto/objects/obj_dat.pl \
663 include/openssl/obj_mac.h \
664 crypto/objects/obj_dat.h )
665 ( cd $(SRCDIR); $(PERL) crypto/objects/objxref.pl \
666 crypto/objects/obj_mac.num \
667 crypto/objects/obj_xref.txt \
668 > crypto/objects/obj_xref.h )
670 generate_crypto_conf:
671 ( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \
672 > crypto/conf/conf_def.h )
674 generate_crypto_asn1:
675 ( cd $(SRCDIR); $(PERL) crypto/asn1/charmap.pl \
676 > crypto/asn1/charmap.h )
679 ( cd $(SRCDIR); $(PERL) util/ck_errf.pl -strict */*.c */*/*.c )
680 ( cd $(SRCDIR); $(PERL) util/mkerr.pl -recurse -write )
681 ( cd $(SRCDIR)/engines; \
683 $(PERL) ../util/mkerr.pl -conf $$e \
684 -nostatic -staticloader -write *.c; \
688 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl crypto update )
689 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl ssl update )
693 SRCTOP=../$(SRCDIR) \
694 BLDTOP=../$(BLDDIR) \
695 $(PERL) ../$(SRCDIR)/test/run_tests.pl test_ordinals )
700 -etags `find . -name '*.[ch]' -o -name '*.pm'`
702 # Release targets (note: only available on Unix) #####################
704 TAR_COMMAND=$(TAR) $(TARFLAGS) --owner 0 --group 0 -cvf -
707 TMPDIR=/var/tmp/openssl-copy.$$$$; \
709 mkdir -p $$TMPDIR/$$DISTDIR; \
711 git ls-tree -r --name-only --full-tree HEAD \
713 mkdir -p $$TMPDIR/$$DISTDIR/`dirname $$F`; \
714 cp $$F $$TMPDIR/$$DISTDIR/$$F; \
718 find $$TMPDIR/$$DISTDIR -type d -print | xargs chmod 755; \
719 find $$TMPDIR/$$DISTDIR -type f -print | xargs chmod a+r; \
720 find $$TMPDIR/$$DISTDIR -type f -perm -0100 -print | xargs chmod a+x; \
721 $(TAR_COMMAND) $$DISTDIR) \
722 | (cd $(SRCDIR); gzip --best > $(TARFILE).gz); \
724 cd $(SRCDIR); ls -l $(TARFILE).gz
727 @$(MAKE) PREPARE_CMD='./Configure dist' tar
729 # Helper targets #####################################################
731 link-utils: $(BLDDIR)/util/opensslwrap.sh $(BLDDIR)/util/shlib_wrap.sh
733 $(BLDDIR)/util/opensslwrap.sh: configdata.pm
734 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
735 mkdir -p "$(BLDDIR)/util"; \
736 ln -sf "../$(SRCDIR)/util/opensslwrap.sh" "$(BLDDIR)/util"; \
738 $(BLDDIR)/util/shlib_wrap.sh: configdata.pm
739 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
740 mkdir -p "$(BLDDIR)/util"; \
741 ln -sf "../$(SRCDIR)/util/shlib_wrap.sh" "$(BLDDIR)/util"; \
745 # Building targets ###################################################
747 libcrypto.pc libssl.pc openssl.pc: configdata.pm $(LIBS)
749 @ ( echo 'prefix=$(INSTALLTOP)'; \
750 echo 'exec_prefix=$${prefix}'; \
751 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
752 echo 'includedir=$${prefix}/include'; \
754 echo 'Name: OpenSSL-libcrypto'; \
755 echo 'Description: OpenSSL cryptography library'; \
756 echo 'Version: '$(VERSION); \
757 echo 'Libs: -L$${libdir} -lcrypto'; \
758 echo 'Libs.private: $(EX_LIBS)'; \
759 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
762 @ ( echo 'prefix=$(INSTALLTOP)'; \
763 echo 'exec_prefix=$${prefix}'; \
764 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
765 echo 'includedir=$${prefix}/include'; \
767 echo 'Name: OpenSSL-libssl'; \
768 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
769 echo 'Version: '$(VERSION); \
770 echo 'Requires.private: libcrypto'; \
771 echo 'Libs: -L$${libdir} -lssl'; \
772 echo 'Libs.private: $(EX_LIBS)'; \
773 echo 'Cflags: -I$${includedir}' ) > libssl.pc
776 @ ( echo 'prefix=$(INSTALLTOP)'; \
777 echo 'exec_prefix=$${prefix}'; \
778 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
779 echo 'includedir=$${prefix}/include'; \
781 echo 'Name: OpenSSL'; \
782 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
783 echo 'Version: '$(VERSION); \
784 echo 'Requires: libssl libcrypto' ) > openssl.pc
786 # Note on the use of $(MFLAGS): this was an older variant of MAKEFLAGS which
787 # wasn't passed down automatically. It's quite safe to use it like we do
788 # below; if it doesn't exist, the result will be empty and 'make' will pick
789 # up $(MAKEFLAGS) which is passed down as an environment variable.
790 configdata.pm: $(SRCDIR)/Configurations/unix-Makefile.tmpl $(SRCDIR)/Configurations/common.tmpl $(SRCDIR)/Configure $(SRCDIR)/config {- join(" ", @{$config{build_infos}}) -}
791 @echo "Detected changed: $?"
792 @echo "Reconfiguring..."
793 $(SRCDIR)/Configure reconf
794 @echo "**************************************************"
796 @echo "*** Please run the same make command again ***"
798 @echo "**************************************************"
803 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
805 # Helper function to figure out dependencies on libraries
806 # It takes a list of library names and outputs a list of dependencies
807 sub compute_lib_depends {
808 if ($disabled{shared}) {
809 return map { $_.$libext } @_;
812 # Depending on shared libraries:
813 # On Windows POSIX layers, we depend on {libname}.dll.a
814 # On Unix platforms, we depend on {shlibname}.so
815 return map { shlib_simple($_) } @_;
820 my $generator = join(" ", @{$args{generator}});
821 my $generator_incs = join("", map { " -I".$_ } @{$args{generator_incs}});
822 my $incs = join("", map { " -I".$_ } @{$args{incs}});
823 my $deps = join(" ", @{$args{generator_deps}}, @{$args{deps}});
825 if ($args{src} !~ /\.[sS]$/) {
827 $args{src}: $args{generator}->[0] $deps
828 \$(PERL)$generator_incs $generator > \$@
831 if ($args{generator}->[0] =~ /\.pl$/) {
832 $generator = 'CC="$(CC)" $(PERL)'.$generator_incs.' '.$generator;
833 } elsif ($args{generator}->[0] =~ /\.m4$/) {
834 $generator = 'm4 -B 8192'.$generator_incs.' '.$generator.' >'
835 } elsif ($args{generator}->[0] =~ /\.S$/) {
838 die "Generator type for $args{src} unknown: $generator\n";
841 if (defined($generator)) {
842 # If the target is named foo.S in build.info, we want to
843 # end up generating foo.s in two steps.
844 if ($args{src} =~ /\.S$/) {
845 (my $target = $args{src}) =~ s|\.S$|.s|;
847 $target: $args{generator}->[0] $deps
848 ( trap "rm -f \$@.*" INT 0; \\
850 \$(CC) \$(CFLAGS) $incs -E \$@.S | \\
851 \$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@.i && \\
857 $args{src}: $args{generator}->[0] $deps
862 $args{src}: $args{generator}->[0] $deps
863 \$(CC) \$(CFLAGS) $incs -E \$< | \\
864 \$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@
869 # Should one wonder about the end of the Perl snippet, it's because this
870 # second regexp eats up line endings as well, if the removed path is the
871 # last in the line. We may therefore need to put back a line ending.
874 my $obj = $args{obj};
875 my @srcs = map { if ($unified_info{generate}->{$_}) {
876 (my $x = $_) =~ s/\.S$/.s/; $x
880 } ( @{$args{srcs}} );
881 my $srcs = join(" ", @srcs);
882 my $deps = join(" ", @srcs, @{$args{deps}});
883 my $incs = join("", map { " -I".$_ } @{$args{incs}});
884 unless ($disabled{zlib}) {
885 if ($withargs{zlib_include}) {
886 $incs .= " -I".$withargs{zlib_include};
889 my $ecflags = { lib => '$(LIB_CFLAGS)',
890 dso => '$(DSO_CFLAGS)',
891 bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
892 my $makedepprog = $config{makedepprog};
894 if (!$disabled{makedepend} && $makedepprog =~ /\/makedepend/) {
897 -\$(MAKEDEPEND) -f- -o"|$obj$objext" -- \$(CFLAGS) $ecflags$incs -- $srcs \\
898 >\$\@.tmp 2>/dev/null
899 -\$(PERL) -i -pe 's/^.*\\|//; s/ \\/(\\\\.|[^ ])*//; \$\$_ = undef if (/: *\$\$/ || /^(#.*| *)\$\$/); \$\$_.="\\n" unless !defined(\$\$_) or /\\R\$\$/g;' \$\@.tmp
900 \@if cmp \$\@.tmp \$\@ > /dev/null 2> /dev/null; then \\
906 $deps = $obj.$depext;
908 if ($disabled{makedepend} || $makedepprog =~ /\/makedepend/) {
911 \$(CC) \$(CFLAGS) $ecflags$incs -c -o \$\@ $srcs
914 if (!$disabled{makedepend} && $makedepprog !~ /\/makedepend/) {
917 \$(CC) \$(CFLAGS) $ecflags$incs -MMD -MF $obj$depext.tmp -MT \$\@ -c -o \$\@ $srcs
918 \@touch $obj$depext.tmp
919 \@if cmp $obj$depext.tmp $obj$depext > /dev/null 2> /dev/null; then \\
920 rm -f $obj$depext.tmp; \\
922 mv $obj$depext.tmp $obj$depext; \\
928 # On Unix, we build shlibs from static libs, so we're ignoring the
929 # object file array. We *know* this routine is only called when we've
930 # configure 'shared'.
933 my $lib = $args{lib};
934 my $shlib = $args{shlib};
935 my $libd = dirname($lib);
936 my $libn = basename($lib);
937 (my $libname = $libn) =~ s/^lib//;
938 my $linklibs = join("", map { my $d = dirname($_);
939 my $f = basename($_);
940 (my $l = $f) =~ s/^lib//;
941 " -L$d -l$l" } @{$args{deps}});
942 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
943 my $shlib_target = $target{shared_target};
944 my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : "";
945 my $target = shlib_simple($lib);
947 # With a build on a Windows POSIX layer (Cygwin or Mingw), we know for a fact
948 # that two files get produced, {shlibname}.dll and {libname}.dll.a.
949 # With all other Unix platforms, we often build a shared library with the
950 # SO version built into the file name and a symlink without the SO version
951 # It's not necessary to have both as targets. The choice falls on the
952 # simplest, {libname}$shlibextimport for Windows POSIX layers and
953 # {libname}$shlibextsimple for the Unix platforms.
954 $target: $lib$libext $deps $ordinalsfile
955 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
956 PLATFORM=\$(PLATFORM) \\
957 PERL=\$(PERL) SRCDIR='\$(SRCDIR)' DSTDIR="$libd" \\
958 INSTALLTOP='\$(INSTALLTOP)' LIBDIR='\$(LIBDIR)' \\
959 LIBDEPS='\$(PLIB_LDFLAGS) '"$linklibs"' \$(EX_LIBS)' \\
960 LIBNAME=$libname LIBVERSION=\$(SHLIB_MAJOR).\$(SHLIB_MINOR) \\
961 LIBCOMPATVERSIONS=';\$(SHLIB_VERSION_HISTORY)' \\
962 CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(LIB_CFLAGS)' \\
963 LDFLAGS='\$(LDFLAGS)' \\
964 SHARED_LDFLAGS='\$(LIB_LDFLAGS)' SHLIB_EXT=$shlibext \\
965 RC='\$(RC)' SHARED_RCFLAGS='\$(RCFLAGS)' \\
966 link_shlib.$shlib_target
968 . (windowsdll() ? <<"EOF" : "");
969 rm -f apps/$shlib$shlibext
970 rm -f test/$shlib$shlibext
971 cp -p $shlib$shlibext apps/
972 cp -p $shlib$shlibext test/
977 my $lib = $args{lib};
978 my $libd = dirname($lib);
979 my $libn = basename($lib);
980 (my $libname = $libn) =~ s/^lib//;
981 my $shlibdeps = join("", map { my $d = dirname($_);
982 my $f = basename($_);
983 (my $l = $f) =~ s/^lib//;
984 " -L$d -l$l" } @{$args{deps}});
985 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
986 my $shlib_target = $target{shared_target};
987 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
988 my $target = dso($lib);
991 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
992 PLATFORM=\$(PLATFORM) \\
993 PERL=\$(PERL) SRCDIR='\$(SRCDIR)' DSTDIR="$libd" \\
994 LIBDEPS='\$(PLIB_LDFLAGS) '"$shlibdeps"' \$(EX_LIBS)' \\
995 LIBNAME=$libname LDFLAGS='\$(LDFLAGS)' \\
996 CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(DSO_CFLAGS)' \\
997 SHARED_LDFLAGS='\$(DSO_LDFLAGS)' \\
1000 link_dso.$shlib_target
1005 my $lib = $args{lib};
1006 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
1010 \$(RANLIB) \$\@ || echo Never mind.
1015 my $bin = $args{bin};
1016 my $bind = dirname($bin);
1017 my $binn = basename($bin);
1018 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
1019 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
1020 my $linklibs = join("", map { my $d = dirname($_);
1021 my $f = basename($_);
1022 $d = "." if $d eq $f;
1023 (my $l = $f) =~ s/^lib//;
1024 " -L$d -l$l" } @{$args{deps}});
1025 my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
1027 $bin$exeext: $objs $deps
1029 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
1030 PERL=\$(PERL) SRCDIR=\$(SRCDIR) \\
1031 APPNAME=$bin$exeext OBJECTS="$objs" \\
1032 LIBDEPS='\$(PLIB_LDFLAGS) '"$linklibs"' \$(EX_LIBS)' \\
1033 CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(BIN_CFLAGS)' \\
1034 LDFLAGS='\$(LDFLAGS)' LIBRPATH='\$(INSTALLTOP)/\$(LIBDIR)' \\
1035 link_app.$shlib_target
1040 my $script = $args{script};
1041 my $sources = join(" ", @{$args{sources}});
1042 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
1043 "util", "dofile.pl")),
1044 rel2abs($config{builddir}));
1047 \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
1048 "-o$target{build_file}" $sources > "$script"
1052 "" # Important! This becomes part of the template result.