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`; \
532 NAME=`echo $$fn | tr [a-z] [A-Z]`; \
533 suf=`eval "echo $$OUTSUFFIX"`; \
534 top=`eval "echo $$OUTTOP"`; \
535 $(PERL) $(SRCDIR)/util/mkdir-p.pl $$top/man$$SEC; \
536 echo "install $$p -> $$top/man$$SEC/$$fn$$suf"; \
537 cat $$p | eval "$$GENERATE" \
538 > $$top/man$$SEC/$$fn$$suf; \
539 names=`cat $$p | $(EXTRACT_NAMES)`; \
540 ( cd $$top/man$$SEC; \
541 for n in $$names; do \
544 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
545 comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
546 comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
549 if [ "$$comp_n" != "$$comp_fn" ]; then \
550 echo "link $$top/man$$SEC/$$n$$suf -> $$top/man$$SEC/$$fn$$suf"; \
551 PLATFORM=$(PLATFORM) $$point $$fn$$suf $$n$$suf; \
558 here=`cd $(SRCDIR); pwd`; \
559 for ds in apps:1 crypto:3 ssl:3; do \
560 defdir=`echo $$ds | cut -f1 -d:`; \
561 defsec=`echo $$ds | cut -f2 -d:`; \
562 for p in $(SRCDIR)/doc/$$defdir/*.pod; do \
563 SEC=`sed -ne 's/^=for *comment *openssl_manual_section: *\([0-9]\) *$$/\1/p' $$p`; \
564 [ -z "$$SEC" ] && SEC=$$defsec; \
565 fn=`basename $$p .pod`; \
566 suf=`eval "echo $$OUTSUFFIX"`; \
567 top=`eval "echo $$OUTTOP"`; \
568 echo "$(RM) $$top/man$$SEC/$$fn$$suf"; \
569 $(RM) $$top/man$$SEC/$$fn$$suf; \
570 names=`cat $$p | $(EXTRACT_NAMES)`; \
571 for n in $$names; do \
574 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
575 comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
576 comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
579 if [ "$$comp_n" != "$$comp_fn" ]; then \
580 echo "$(RM) $$top/man$$SEC/$$n$$suf"; \
581 $(RM) $$top/man$$SEC/$$n$$suf; \
584 ( $(RMDIR) $$top/man$$SEC 2>/dev/null || exit 0 ); \
589 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
590 @echo "*** Installing manpages"
592 OUTSUFFIX='.$${SEC}$(MANSUFFIX)'; \
593 OUTTOP="$(DESTDIR)$(MANDIR)"; \
594 GENERATE='pod2man --name=$$NAME --section=$$SEC --center=OpenSSL --release=$(VERSION)'; \
598 @echo "*** Uninstalling manpages"
600 OUTSUFFIX='.$${SEC}$(MANSUFFIX)'; \
601 OUTTOP="$(DESTDIR)$(MANDIR)"; \
605 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
606 @echo "*** Installing HTML manpages"
608 OUTSUFFIX='.$(HTMLSUFFIX)'; \
609 OUTTOP="$(DESTDIR)$(HTMLDIR)"; \
610 GENERATE="pod2html --podroot=$(SRCDIR)/doc --htmldir=.. \
611 --podpath=apps:crypto:ssl --title=\$$Name \
612 | sed -e 's|href=\"http://man.he.net/man|href=\"../man|g'"; \
616 @echo "*** Uninstalling manpages"
618 OUTSUFFIX='.$(HTMLSUFFIX)'; \
619 OUTTOP="$(DESTDIR)$(HTMLDIR)"; \
623 # Developer targets (note: these are only available on Unix) #########
625 update: generate errors ordinals
627 generate: generate_apps generate_crypto_bn generate_crypto_objects \
628 generate_crypto_conf generate_crypto_asn1
630 # Test coverage is a good idea for the future
631 #coverage: $(PROGRAMS) $(TESTPROGRAMS)
634 # Currently disabled, util/selftest.pl needs a rewrite
636 # SRCDIR=$(SRCDIR) @$(PERL) util/selftest.pl
639 lint -DLINT $(INCLUDES) $(SRCS)
641 {- # because the program apps/openssl has object files as sources, and
642 # they then have the corresponding C files as source, we need to chain
643 # the lookups in %unified_info
644 my $apps_openssl = catfile("apps","openssl");
645 our @openssl_source = map { @{$unified_info{sources}->{$_}} }
646 @{$unified_info{sources}->{$apps_openssl}};
649 ( cd $(SRCDIR); $(PERL) VMS/VMSify-conf.pl \
650 < apps/openssl.cnf > apps/openssl-vms.cnf )
651 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b apps/progs.pl \
652 {- join(" ", @openssl_source) -} \
656 ( cd $(SRCDIR); $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h )
658 generate_crypto_objects:
659 ( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl \
660 crypto/objects/objects.txt \
661 crypto/objects/obj_mac.num \
662 include/openssl/obj_mac.h )
663 ( cd $(SRCDIR); $(PERL) crypto/objects/obj_dat.pl \
664 include/openssl/obj_mac.h \
665 crypto/objects/obj_dat.h )
666 ( cd $(SRCDIR); $(PERL) crypto/objects/objxref.pl \
667 crypto/objects/obj_mac.num \
668 crypto/objects/obj_xref.txt \
669 > crypto/objects/obj_xref.h )
671 generate_crypto_conf:
672 ( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \
673 > crypto/conf/conf_def.h )
675 generate_crypto_asn1:
676 ( cd $(SRCDIR); $(PERL) crypto/asn1/charmap.pl \
677 > crypto/asn1/charmap.h )
680 ( cd $(SRCDIR); $(PERL) util/ck_errf.pl -strict */*.c */*/*.c )
681 ( cd $(SRCDIR); $(PERL) util/mkerr.pl -recurse -write )
682 ( cd $(SRCDIR)/engines; \
684 $(PERL) ../util/mkerr.pl -conf $$e \
685 -nostatic -staticloader -write *.c; \
689 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl crypto update )
690 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl ssl update )
694 SRCTOP=../$(SRCDIR) \
695 BLDTOP=../$(BLDDIR) \
696 $(PERL) ../$(SRCDIR)/test/run_tests.pl test_ordinals )
701 -etags `find . -name '*.[ch]' -o -name '*.pm'`
703 # Release targets (note: only available on Unix) #####################
705 TAR_COMMAND=$(TAR) $(TARFLAGS) --owner 0 --group 0 -cvf -
708 TMPDIR=/var/tmp/openssl-copy.$$$$; \
710 mkdir -p $$TMPDIR/$$DISTDIR; \
712 git ls-tree -r --name-only --full-tree HEAD \
714 mkdir -p $$TMPDIR/$$DISTDIR/`dirname $$F`; \
715 cp $$F $$TMPDIR/$$DISTDIR/$$F; \
719 find $$TMPDIR/$$DISTDIR -type d -print | xargs chmod 755; \
720 find $$TMPDIR/$$DISTDIR -type f -print | xargs chmod a+r; \
721 find $$TMPDIR/$$DISTDIR -type f -perm -0100 -print | xargs chmod a+x; \
722 $(TAR_COMMAND) $$DISTDIR) \
723 | (cd $(SRCDIR); gzip --best > $(TARFILE).gz); \
725 cd $(SRCDIR); ls -l $(TARFILE).gz
728 @$(MAKE) PREPARE_CMD='./Configure dist' tar
730 # Helper targets #####################################################
732 link-utils: $(BLDDIR)/util/opensslwrap.sh $(BLDDIR)/util/shlib_wrap.sh
734 $(BLDDIR)/util/opensslwrap.sh: configdata.pm
735 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
736 mkdir -p "$(BLDDIR)/util"; \
737 ln -sf "../$(SRCDIR)/util/opensslwrap.sh" "$(BLDDIR)/util"; \
739 $(BLDDIR)/util/shlib_wrap.sh: configdata.pm
740 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
741 mkdir -p "$(BLDDIR)/util"; \
742 ln -sf "../$(SRCDIR)/util/shlib_wrap.sh" "$(BLDDIR)/util"; \
746 # Building targets ###################################################
748 libcrypto.pc libssl.pc openssl.pc: configdata.pm $(LIBS)
750 @ ( echo 'prefix=$(INSTALLTOP)'; \
751 echo 'exec_prefix=$${prefix}'; \
752 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
753 echo 'includedir=$${prefix}/include'; \
755 echo 'Name: OpenSSL-libcrypto'; \
756 echo 'Description: OpenSSL cryptography library'; \
757 echo 'Version: '$(VERSION); \
758 echo 'Libs: -L$${libdir} -lcrypto'; \
759 echo 'Libs.private: $(EX_LIBS)'; \
760 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
763 @ ( echo 'prefix=$(INSTALLTOP)'; \
764 echo 'exec_prefix=$${prefix}'; \
765 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
766 echo 'includedir=$${prefix}/include'; \
768 echo 'Name: OpenSSL-libssl'; \
769 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
770 echo 'Version: '$(VERSION); \
771 echo 'Requires.private: libcrypto'; \
772 echo 'Libs: -L$${libdir} -lssl'; \
773 echo 'Libs.private: $(EX_LIBS)'; \
774 echo 'Cflags: -I$${includedir}' ) > libssl.pc
777 @ ( echo 'prefix=$(INSTALLTOP)'; \
778 echo 'exec_prefix=$${prefix}'; \
779 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
780 echo 'includedir=$${prefix}/include'; \
782 echo 'Name: OpenSSL'; \
783 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
784 echo 'Version: '$(VERSION); \
785 echo 'Requires: libssl libcrypto' ) > openssl.pc
787 # Note on the use of $(MFLAGS): this was an older variant of MAKEFLAGS which
788 # wasn't passed down automatically. It's quite safe to use it like we do
789 # below; if it doesn't exist, the result will be empty and 'make' will pick
790 # up $(MAKEFLAGS) which is passed down as an environment variable.
791 configdata.pm: $(SRCDIR)/Configurations/unix-Makefile.tmpl $(SRCDIR)/Configurations/common.tmpl $(SRCDIR)/Configure $(SRCDIR)/config {- join(" ", @{$config{build_infos}}) -}
792 @echo "Detected changed: $?"
793 @echo "Reconfiguring..."
794 $(SRCDIR)/Configure reconf
795 @echo "**************************************************"
797 @echo "*** Please run the same make command again ***"
799 @echo "**************************************************"
804 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
806 # Helper function to figure out dependencies on libraries
807 # It takes a list of library names and outputs a list of dependencies
808 sub compute_lib_depends {
809 if ($disabled{shared}) {
810 return map { $_.$libext } @_;
813 # Depending on shared libraries:
814 # On Windows POSIX layers, we depend on {libname}.dll.a
815 # On Unix platforms, we depend on {shlibname}.so
816 return map { shlib_simple($_) } @_;
821 my $generator = join(" ", @{$args{generator}});
822 my $generator_incs = join("", map { " -I".$_ } @{$args{generator_incs}});
823 my $incs = join("", map { " -I".$_ } @{$args{incs}});
824 my $deps = join(" ", @{$args{generator_deps}}, @{$args{deps}});
826 if ($args{src} !~ /\.[sS]$/) {
828 $args{src}: $args{generator}->[0] $deps
829 \$(PERL)$generator_incs $generator > \$@
832 if ($args{generator}->[0] =~ /\.pl$/) {
833 $generator = 'CC="$(CC)" $(PERL)'.$generator_incs.' '.$generator;
834 } elsif ($args{generator}->[0] =~ /\.m4$/) {
835 $generator = 'm4 -B 8192'.$generator_incs.' '.$generator.' >'
836 } elsif ($args{generator}->[0] =~ /\.S$/) {
839 die "Generator type for $args{src} unknown: $generator\n";
842 if (defined($generator)) {
843 # If the target is named foo.S in build.info, we want to
844 # end up generating foo.s in two steps.
845 if ($args{src} =~ /\.S$/) {
846 (my $target = $args{src}) =~ s|\.S$|.s|;
848 $target: $args{generator}->[0] $deps
849 ( trap "rm -f \$@.*" INT 0; \\
851 \$(CC) \$(CFLAGS) $incs -E \$@.S | \\
852 \$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@.i && \\
858 $args{src}: $args{generator}->[0] $deps
863 $args{src}: $args{generator}->[0] $deps
864 \$(CC) \$(CFLAGS) $incs -E \$< | \\
865 \$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@
870 # Should one wonder about the end of the Perl snippet, it's because this
871 # second regexp eats up line endings as well, if the removed path is the
872 # last in the line. We may therefore need to put back a line ending.
875 my $obj = $args{obj};
876 my @srcs = map { if ($unified_info{generate}->{$_}) {
877 (my $x = $_) =~ s/\.S$/.s/; $x
881 } ( @{$args{srcs}} );
882 my $srcs = join(" ", @srcs);
883 my $deps = join(" ", @srcs, @{$args{deps}});
884 my $incs = join("", map { " -I".$_ } @{$args{incs}});
885 unless ($disabled{zlib}) {
886 if ($withargs{zlib_include}) {
887 $incs .= " -I".$withargs{zlib_include};
890 my $ecflags = { lib => '$(LIB_CFLAGS)',
891 dso => '$(DSO_CFLAGS)',
892 bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
893 my $makedepprog = $config{makedepprog};
895 if (!$disabled{makedepend} && $makedepprog =~ /\/makedepend/) {
898 -\$(MAKEDEPEND) -f- -o"|$obj$objext" -- \$(CFLAGS) $ecflags$incs -- $srcs \\
899 >\$\@.tmp 2>/dev/null
900 -\$(PERL) -i -pe 's/^.*\\|//; s/ \\/(\\\\.|[^ ])*//; \$\$_ = undef if (/: *\$\$/ || /^(#.*| *)\$\$/); \$\$_.="\\n" unless !defined(\$\$_) or /\\R\$\$/g;' \$\@.tmp
901 \@if cmp \$\@.tmp \$\@ > /dev/null 2> /dev/null; then \\
907 $deps = $obj.$depext;
909 if ($disabled{makedepend} || $makedepprog =~ /\/makedepend/) {
912 \$(CC) \$(CFLAGS) $ecflags$incs -c -o \$\@ $srcs
915 if (!$disabled{makedepend} && $makedepprog !~ /\/makedepend/) {
918 \$(CC) \$(CFLAGS) $ecflags$incs -MMD -MF $obj$depext.tmp -MT \$\@ -c -o \$\@ $srcs
919 \@touch $obj$depext.tmp
920 \@if cmp $obj$depext.tmp $obj$depext > /dev/null 2> /dev/null; then \\
921 rm -f $obj$depext.tmp; \\
923 mv $obj$depext.tmp $obj$depext; \\
929 # On Unix, we build shlibs from static libs, so we're ignoring the
930 # object file array. We *know* this routine is only called when we've
931 # configure 'shared'.
934 my $lib = $args{lib};
935 my $shlib = $args{shlib};
936 my $libd = dirname($lib);
937 my $libn = basename($lib);
938 (my $libname = $libn) =~ s/^lib//;
939 my $linklibs = join("", map { my $d = dirname($_);
940 my $f = basename($_);
941 (my $l = $f) =~ s/^lib//;
942 " -L$d -l$l" } @{$args{deps}});
943 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
944 my $shlib_target = $target{shared_target};
945 my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : "";
946 my $target = shlib_simple($lib);
948 # With a build on a Windows POSIX layer (Cygwin or Mingw), we know for a fact
949 # that two files get produced, {shlibname}.dll and {libname}.dll.a.
950 # With all other Unix platforms, we often build a shared library with the
951 # SO version built into the file name and a symlink without the SO version
952 # It's not necessary to have both as targets. The choice falls on the
953 # simplest, {libname}$shlibextimport for Windows POSIX layers and
954 # {libname}$shlibextsimple for the Unix platforms.
955 $target: $lib$libext $deps $ordinalsfile
956 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
957 PLATFORM=\$(PLATFORM) \\
958 PERL=\$(PERL) SRCDIR='\$(SRCDIR)' DSTDIR="$libd" \\
959 INSTALLTOP='\$(INSTALLTOP)' LIBDIR='\$(LIBDIR)' \\
960 LIBDEPS='\$(PLIB_LDFLAGS) '"$linklibs"' \$(EX_LIBS)' \\
961 LIBNAME=$libname LIBVERSION=\$(SHLIB_MAJOR).\$(SHLIB_MINOR) \\
962 LIBCOMPATVERSIONS=';\$(SHLIB_VERSION_HISTORY)' \\
963 CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(LIB_CFLAGS)' \\
964 LDFLAGS='\$(LDFLAGS)' \\
965 SHARED_LDFLAGS='\$(LIB_LDFLAGS)' SHLIB_EXT=$shlibext \\
966 RC='\$(RC)' SHARED_RCFLAGS='\$(RCFLAGS)' \\
967 link_shlib.$shlib_target
969 . (windowsdll() ? <<"EOF" : "");
970 rm -f apps/$shlib$shlibext
971 rm -f test/$shlib$shlibext
972 cp -p $shlib$shlibext apps/
973 cp -p $shlib$shlibext test/
978 my $lib = $args{lib};
979 my $libd = dirname($lib);
980 my $libn = basename($lib);
981 (my $libname = $libn) =~ s/^lib//;
982 my $shlibdeps = join("", map { my $d = dirname($_);
983 my $f = basename($_);
984 (my $l = $f) =~ s/^lib//;
985 " -L$d -l$l" } @{$args{deps}});
986 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
987 my $shlib_target = $target{shared_target};
988 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
989 my $target = dso($lib);
992 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
993 PLATFORM=\$(PLATFORM) \\
994 PERL=\$(PERL) SRCDIR='\$(SRCDIR)' DSTDIR="$libd" \\
995 LIBDEPS='\$(PLIB_LDFLAGS) '"$shlibdeps"' \$(EX_LIBS)' \\
996 LIBNAME=$libname LDFLAGS='\$(LDFLAGS)' \\
997 CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(DSO_CFLAGS)' \\
998 SHARED_LDFLAGS='\$(DSO_LDFLAGS)' \\
1000 LIBEXTRAS="$objs" \\
1001 link_dso.$shlib_target
1006 my $lib = $args{lib};
1007 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
1011 \$(RANLIB) \$\@ || echo Never mind.
1016 my $bin = $args{bin};
1017 my $bind = dirname($bin);
1018 my $binn = basename($bin);
1019 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
1020 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
1021 my $linklibs = join("", map { my $d = dirname($_);
1022 my $f = basename($_);
1023 $d = "." if $d eq $f;
1024 (my $l = $f) =~ s/^lib//;
1025 " -L$d -l$l" } @{$args{deps}});
1026 my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
1028 $bin$exeext: $objs $deps
1030 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
1031 PERL=\$(PERL) SRCDIR=\$(SRCDIR) \\
1032 APPNAME=$bin$exeext OBJECTS="$objs" \\
1033 LIBDEPS='\$(PLIB_LDFLAGS) '"$linklibs"' \$(EX_LIBS)' \\
1034 CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(BIN_CFLAGS)' \\
1035 LDFLAGS='\$(LDFLAGS)' LIBRPATH='\$(INSTALLTOP)/\$(LIBDIR)' \\
1036 link_app.$shlib_target
1041 my $script = $args{script};
1042 my $sources = join(" ", @{$args{sources}});
1043 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
1044 "util", "dofile.pl")),
1045 rel2abs($config{builddir}));
1048 \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
1049 "-o$target{build_file}" $sources > "$script"
1053 "" # Important! This becomes part of the template result.