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}; "" -}
88 BIN_SCRIPTS=$(BLDDIR)/tools/c_rehash
89 MISC_SCRIPTS=$(SRCDIR)/tools/c_hash $(SRCDIR)/tools/c_info \
90 $(SRCDIR)/tools/c_issuer $(SRCDIR)/tools/c_name \
91 $(BLDDIR)/apps/CA.pl $(SRCDIR)/apps/tsget
93 SHLIB_INFO={- join(" ", map { "\"".shlib($_).";".shlib_simple($_)."\"" } @{$unified_info{libraries}}) -}
95 # DESTDIR is for package builders so that they can configure for, say,
96 # /usr/ and yet have everything installed to /tmp/somedir/usr/.
97 # Normally it is left empty.
100 # Do not edit these manually. Use Configure with --prefix or --openssldir
101 # to change this! Short explanation in the top comment in Configure
102 INSTALLTOP={- # $prefix is used in the OPENSSLDIR perl snippet
104 our $prefix = $config{prefix} || "/usr/local";
107 # The logic here is that if no --openssldir was given,
108 # OPENSSLDIR will get the value from $prefix plus "/ssl".
109 # If --openssldir was given and the value is an absolute
110 # path, OPENSSLDIR will get its value without change.
111 # If the value from --openssldir is a relative path,
112 # OPENSSLDIR will get $prefix with the --openssldir
113 # value appended as a subdirectory.
115 use File::Spec::Functions;
117 $config{openssldir} ?
118 (file_name_is_absolute($config{openssldir}) ?
120 : catdir($prefix, $config{openssldir}))
121 : catdir($prefix, "ssl");
124 # if $prefix/lib$target{multilib} is not an existing
125 # directory, then assume that it's not searched by linker
126 # automatically, in which case adding $target{multilib} suffix
127 # causes more grief than we're ready to tolerate, so don't...
129 -d "$prefix/lib$target{multilib}" ? $target{multilib} : "";
130 our $libdir = $config{libdir} || "lib$multilib";
132 ENGINESDIR={- use File::Spec::Functions;
133 catdir($prefix,$libdir,"engines") -}
135 MANDIR=$(INSTALLTOP)/share/man
136 DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME)
137 HTMLDIR=$(DOCDIR)/html
139 # MANSUFFIX is for the benefit of anyone who may want to have a suffix
140 # appended after the manpage file section number. "ssl" is popular,
141 # resulting in files such as config.5ssl rather than config.5.
147 CROSS_COMPILE= {- $config{cross_compile_prefix} -}
148 CC= $(CROSS_COMPILE){- $target{cc} -}
149 CFLAGS={- our $cflags2 = join(" ",(map { "-D".$_} @{$target{defines}}, @{$config{defines}}),"-DOPENSSLDIR=\"\\\"\$(OPENSSLDIR)\\\"\"","-DENGINESDIR=\"\\\"\$(ENGINESDIR)\\\"\"") -} {- $target{cflags} -} {- $config{cflags} -}
150 CFLAGS_Q={- $cflags2 =~ s|([\\"])|\\$1|g; $cflags2 -} {- $config{cflags} -}
151 LDFLAGS= {- $target{lflags} -}
152 PLIB_LDFLAGS= {- $target{plib_lflags} -}
153 EX_LIBS= {- $target{ex_libs} -} {- $config{ex_libs} -}
154 LIB_CFLAGS={- $target{shared_cflag} || "" -}
155 LIB_LDFLAGS={- $target{shared_ldflag}." ".$config{shared_ldflag}
156 # Unlike other OSes (like Solaris, Linux, Tru64,
157 # IRIX) BSD run-time linkers (tested OpenBSD, NetBSD
158 # and FreeBSD) "demand" RPATH set on .so objects.
159 # Apparently application RPATH is not global and
160 # does not apply to .so linked with other .so.
161 # Problem manifests itself when libssl.so fails to
162 # load libcrypto.so. One can argue that we should
163 # engrave this into Makefile.shared rules or into
164 # BSD-* config lines above. Meanwhile let's try to
165 # be cautious and pass -rpath to linker only when
166 # $prefix is not /usr.
167 . ($config{target} =~ m|^BSD-| && $prefix !~ m|^/usr/.*$|
168 ? " -Wl,-rpath,\$\$(LIBRPATH)" : "") -}
169 RCFLAGS={- $target{shared_rcflag} -}
170 DSO_CFLAGS={- $target{shared_cflag} || "" -}
171 DSO_LDFLAGS=$(LIB_LDFLAGS)
174 PERL={- $config{perl} -}
176 ARFLAGS= {- $target{arflags} -}
177 AR=$(CROSS_COMPILE){- $target{ar} || "ar" -} $(ARFLAGS) r
178 RANLIB= {- $target{ranlib} -}
179 NM= $(CROSS_COMPILE){- $target{nm} || "nm" -}
182 TAR= {- $target{tar} || "tar" -}
183 TARFLAGS= {- $target{tarflags} -}
184 MAKEDEPEND={- $config{makedepprog} -}
187 NAME= $(BASENAME)-$(VERSION)
188 TARFILE= ../$(NAME).tar
190 # We let the C compiler driver to take care of .s files. This is done in
191 # order to be excused from maintaining a separate set of architecture
192 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
193 # gcc, then the driver will automatically translate it to -xarch=v8plus
194 # and pass it down to assembler.
197 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
199 # For x86 assembler: Set PROCESSOR to 386 if you want to support
201 PROCESSOR= {- $config{processor} -}
203 # The main targets ###################################################
205 all: configdata.pm build_libs_nodep build_engines_nodep build_apps_nodep \
208 build_libs: configdata.pm build_libs_nodep depend
209 build_libs_nodep: libcrypto.pc libssl.pc openssl.pc
210 build_engines: configdata.pm build_engines_nodep depend
211 build_engines_nodep: $(ENGINES)
212 build_apps: configdata.pm build_apps_nodep depend
213 build_apps_nodep: $(PROGRAMS) $(SCRIPTS)
214 build_tests: configdata.pm build_tests_nodep depend
215 build_tests_nodep: $(TESTPROGS)
217 test tests: build_tests_nodep build_apps_nodep build_engines_nodep depend
219 SRCTOP=../$(SRCDIR) \
220 BLDTOP=../$(BLDDIR) \
221 EXE_EXT={- $exeext -} \
222 $(PERL) ../$(SRCDIR)/test/run_tests.pl $(TESTS) )
225 @TOP=$(SRCDIR) PERL=$(PERL) $(PERL) $(SRCDIR)/test/run_tests.pl list
228 @set -e; for s in $(SHLIB_INFO); do \
229 s1=`echo "$$s" | cut -f1 -d";"`; \
230 s2=`echo "$$s" | cut -f2 -d";"`; \
233 if [ "$$s1" != "$$s2" ]; then \
240 install: install_sw install_ssldirs install_docs
242 uninstall: uninstall_docs uninstall_sw
245 rm -f $(PROGRAMS) $(TESTPROGS)
246 rm -f `find $(BLDDIR) -name '*{- $depext -}'`
247 rm -f `find $(BLDDIR) -name '*{- $objext -}'`
249 rm -f $(BLDDIR)/tags $(BLDDIR)/TAGS
250 rm -f $(BLDDIR)/openssl.pc $(BLDDIR)/libcrypto.pc $(BLDDIR)/libssl.pc
251 -rm -f `find $(BLDDIR) -type l`
254 # This exists solely for those who still type 'make depend'
256 # We check if any depfile is newer than Makefile and decide to
257 # concatenate only if that is true, or if 'test' (a.k.a [ )
258 # doesn't have the option to figure it out (-nt).
260 # To check if test has the file age comparison operator, we
261 # simply try, and rely test to exit with 0 if the comparison
262 # was true, 1 if false, and most importantly, 2 if it doesn't
263 # recognise the operator.
265 @: {- output_off() if $disabled{makedepend}; "" -}
267 if [ Makefile -nt Makefile ] 2>/dev/null || [ $$? = 1 ]; then \
268 for d in $(DEPS); do \
269 if [ $$d -nt Makefile ]; then \
277 if [ $$catdepends = true ]; then \
278 ( sed -e '/^# DO NOT DELETE THIS LINE.*/,$$d' < Makefile; \
279 echo '# DO NOT DELETE THIS LINE -- make depend depends on it.'; \
281 for d in $(DEPS); do \
282 if [ -f $$d ]; then cat $$d; fi; \
283 done ) > Makefile.new; \
284 if ! cmp Makefile.new Makefile >/dev/null 2>&1; then \
285 mv -f Makefile.new Makefile; \
287 rm -f Makefile.new; \
290 @: {- output_on() if $disabled{makedepend}; "" -}
292 # Install helper targets #############################################
294 install_sw: all install_dev install_engines install_runtime
296 uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
298 install_docs: install_man_docs install_html_docs
300 uninstall_docs: uninstall_man_docs uninstall_html_docs
301 $(RM) -r -v $(DESTDIR)$(DOCDIR)
304 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/certs
305 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/private
308 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
309 @echo "*** Installing development files"
310 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/include/openssl
311 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
312 $(BLDDIR)/include/openssl/*.h; do \
314 echo "install $$i -> $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
315 cp $$i $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
316 chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
318 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
319 @set -e; for l in $(LIBS); do \
321 echo "install $$l -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn"; \
322 cp $$l $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
323 $(RANLIB) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
324 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
325 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new \
326 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn; \
328 @ : {- output_off() if $disabled{shared}; "" -}
329 @set -e; for s in $(SHLIB_INFO); do \
330 s1=`echo "$$s" | cut -f1 -d";"`; \
331 s2=`echo "$$s" | cut -f2 -d";"`; \
332 fn1=`basename $$s1`; \
333 fn2=`basename $$s2`; \
334 : {- output_off() if windowsdll(); "" -}; \
335 echo "install $$s1 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
336 cp $$s1 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new; \
337 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new; \
338 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new \
339 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1; \
340 if [ "$$fn1" != "$$fn2" ]; then \
341 echo "link $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
342 ln -sf $$fn1 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
344 : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
345 echo "install $$s2 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
346 cp $$s2 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new; \
347 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new; \
348 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new \
349 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
350 : {- output_on() unless windowsdll(); "" -}; \
352 @ : {- output_on() if $disabled{shared}; "" -}
353 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
354 @echo "install libcrypto.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc"
355 @cp libcrypto.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
356 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
357 @echo "install libssl.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc"
358 @cp libssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
359 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
360 @echo "install openssl.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc"
361 @cp openssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
362 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
365 @echo "*** Uninstalling development files"
366 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
367 $(BLDDIR)/include/openssl/*.h; do \
369 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
370 $(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
372 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include/openssl
373 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include
374 @set -e; for l in $(LIBS); do \
376 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn"; \
377 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn; \
379 @ : {- output_off() if $disabled{shared}; "" -}
380 @set -e; for s in $(SHLIB_INFO); do \
381 s1=`echo "$$s" | cut -f1 -d";"`; \
382 s2=`echo "$$s" | cut -f2 -d";"`; \
383 fn1=`basename $$s1`; \
384 fn2=`basename $$s2`; \
385 : {- output_off() if windowsdll(); "" -}; \
386 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
387 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1; \
388 if [ "$$fn1" != "$$fn2" ]; then \
389 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
390 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
392 : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
393 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
394 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
395 : {- output_on() unless windowsdll(); "" -}; \
397 @ : {- output_on() if $disabled{shared}; "" -}
398 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
399 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
400 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
401 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
402 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
405 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
406 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/
407 @echo "*** Installing engines"
408 @set -e; for e in $(ENGINES); do \
410 if [ "$$fn" = '{- dso("ossltest") -}' ]; then \
413 echo "install $$e -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn"; \
414 cp $$e $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new; \
415 chmod 755 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new; \
416 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new \
417 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn; \
421 @echo "*** Uninstalling engines"
422 @set -e; for e in $(ENGINES); do \
424 if [ "$$fn" = '{- dso("ossltest") -}' ]; then \
427 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn"; \
428 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn; \
430 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines
433 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
434 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
435 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/misc
436 @echo "*** Installing runtime files"
437 : {- output_off() unless windowsdll(); "" -};
438 @set -e; for s in $(SHLIBS); do \
440 echo "install $$s -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
441 cp $$s $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
442 chmod 644 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
443 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
444 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
446 : {- output_on() unless windowsdll(); "" -};
447 @set -e; for x in $(PROGRAMS); do \
449 echo "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
450 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
451 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
452 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
453 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
455 @set -e; for x in $(BIN_SCRIPTS); do \
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 $(MISC_SCRIPTS); do \
465 echo "install $$x -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
466 cp $$x $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
467 chmod 755 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
468 mv -f $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new \
469 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
471 @echo "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf"
472 @cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
473 @chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
474 @mv -f $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
477 @echo "*** Uninstalling runtime files"
478 @set -e; for x in $(PROGRAMS); \
481 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
482 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
484 @set -e; for x in $(BIN_SCRIPTS); \
487 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
488 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
490 @set -e; for x in $(MISC_SCRIPTS); \
493 echo "$(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
494 $(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
496 : {- output_off() unless windowsdll(); "" -};
497 @set -e; for s in $(SHLIBS); do \
499 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
500 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
502 : {- output_on() unless windowsdll(); "" -};
503 $(RM) $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
504 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
505 -$(RMDIR) $(DESTDIR)$(OPENSSLDIR)/misc
507 # A method to extract all names from a .pod file
508 # The first sed extracts everything between "=head1 NAME" and the next =head1
509 # The second sed joins all the lines into one
510 # The third sed removes the description and turns all commas into spaces
511 # Voilà , you have a space separated list of names!
512 EXTRACT_NAMES=sed -e '1,/^=head1 *NAME *$$/d;/^=head1/,$$d' | \
513 sed -e ':a;{N;s/\n/ /;ba}' | \
514 sed -e 's/ - .*$$//;s/,/ /g'
517 here=`cd $(SRCDIR); pwd`; \
518 point=$$here/util/point.sh; \
519 for ds in apps:1 crypto:3 ssl:3; do \
520 defdir=`echo $$ds | cut -f1 -d:`; \
521 defsec=`echo $$ds | cut -f2 -d:`; \
522 for p in $(SRCDIR)/doc/$$defdir/*.pod; do \
523 SEC=`sed -ne 's/^=for *comment *openssl_manual_section: *\([0-9]\) *$$/\1/p' $$p`; \
524 [ -z "$$SEC" ] && SEC=$$defsec; \
525 fn=`basename $$p .pod`; \
526 NAME=`echo $$fn | tr [a-z] [A-Z]`; \
527 suf=`eval "echo $$OUTSUFFIX"`; \
528 top=`eval "echo $$OUTTOP"`; \
529 $(PERL) $(SRCDIR)/util/mkdir-p.pl $$top/man$$SEC; \
530 echo "install $$p -> $$top/man$$SEC/$$fn$$suf"; \
531 cat $$p | eval "$$GENERATE" \
532 > $$top/man$$SEC/$$fn$$suf; \
533 names=`cat $$p | $(EXTRACT_NAMES)`; \
534 ( cd $$top/man$$SEC; \
535 for n in $$names; do \
538 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
539 comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
540 comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
543 if [ "$$comp_n" != "$$comp_fn" ]; then \
544 echo "link $$top/man$$SEC/$$n$$suf -> $$top/man$$SEC/$$fn$$suf"; \
545 PLATFORM=$(PLATFORM) $$point $$fn$$suf $$n$$suf; \
552 here=`cd $(SRCDIR); pwd`; \
553 for ds in apps:1 crypto:3 ssl:3; do \
554 defdir=`echo $$ds | cut -f1 -d:`; \
555 defsec=`echo $$ds | cut -f2 -d:`; \
556 for p in $(SRCDIR)/doc/$$defdir/*.pod; do \
557 SEC=`sed -ne 's/^=for *comment *openssl_manual_section: *\([0-9]\) *$$/\1/p' $$p`; \
558 [ -z "$$SEC" ] && SEC=$$defsec; \
559 fn=`basename $$p .pod`; \
560 suf=`eval "echo $$OUTSUFFIX"`; \
561 top=`eval "echo $$OUTTOP"`; \
562 echo "$(RM) $$top/man$$SEC/$$fn$$suf"; \
563 $(RM) $$top/man$$SEC/$$fn$$suf; \
564 names=`cat $$p | $(EXTRACT_NAMES)`; \
565 for n in $$names; do \
568 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
569 comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
570 comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
573 if [ "$$comp_n" != "$$comp_fn" ]; then \
574 echo "$(RM) $$top/man$$SEC/$$n$$suf"; \
575 $(RM) $$top/man$$SEC/$$n$$suf; \
578 ( $(RMDIR) $$top/man$$SEC 2>/dev/null || exit 0 ); \
583 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
584 @echo "*** Installing manpages"
586 OUTSUFFIX='.$${SEC}$(MANSUFFIX)'; \
587 OUTTOP="$(DESTDIR)$(MANDIR)"; \
588 GENERATE='pod2man --name=$$NAME --section=$$SEC --center=OpenSSL --release=$(VERSION)'; \
592 @echo "*** Uninstalling manpages"
594 OUTSUFFIX='.$${SEC}$(MANSUFFIX)'; \
595 OUTTOP="$(DESTDIR)$(MANDIR)"; \
599 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
600 @echo "*** Installing HTML manpages"
602 OUTSUFFIX='.$(HTMLSUFFIX)'; \
603 OUTTOP="$(DESTDIR)$(HTMLDIR)"; \
604 GENERATE="pod2html --podroot=$(SRCDIR)/doc --htmldir=.. \
605 --podpath=apps:crypto:ssl \
606 | sed -e 's|href=\"http://man.he.net/man|href=\"../man|g'"; \
610 @echo "*** Uninstalling manpages"
612 OUTSUFFIX='.$(HTMLSUFFIX)'; \
613 OUTTOP="$(DESTDIR)$(HTMLDIR)"; \
617 # Developer targets (note: these are only available on Unix) #########
619 update: generate errors ordinals
621 generate: generate_apps generate_crypto_bn generate_crypto_objects
623 # Test coverage is a good idea for the future
624 #coverage: $(PROGRAMS) $(TESTPROGRAMS)
627 # Currently disabled, util/selftest.pl needs a rewrite
629 # SRCDIR=$(SRCDIR) @$(PERL) util/selftest.pl
632 lint -DLINT $(INCLUDES) $(SRCS)
634 generate_apps: $(SRCDIR)/apps/openssl-vms.cnf $(SRCDIR)/apps/progs.h
636 generate_crypto_bn: $(SRCDIR)/crypto/bn/bn_prime.h
638 generate_crypto_objects: $(SRCDIR)/crypto/objects/obj_dat.h \
639 $(SRCDIR)/include/openssl/obj_mac.h \
640 $(SRCDIR)/crypto/objects/obj_xref.h
643 ( cd $(SRCDIR); $(PERL) util/ck_errf.pl -strict */*.c */*/*.c )
644 ( cd $(SRCDIR); $(PERL) util/mkerr.pl -recurse -write )
645 ( cd $(SRCDIR)/engines; \
647 $(PERL) ../util/mkerr.pl -conf $$e \
648 -nostatic -staticloader -write *.c; \
652 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl crypto update )
653 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl ssl update )
657 SRCTOP=../$(SRCDIR) \
658 BLDTOP=../$(BLDDIR) \
659 $(PERL) ../$(SRCDIR)/test/run_tests.pl test_ordinals )
664 -etags `find . -name '*.[ch]' -o -name '*.pm'`
666 # Release targets (note: only available on Unix) #####################
668 TAR_COMMAND=$(TAR) $(TARFLAGS) --owner 0 --group 0 -cvf -
671 TMPDIR=/var/tmp/openssl-copy.$$$$; \
673 mkdir -p $$TMPDIR/$$DISTDIR; \
675 git ls-tree -r --name-only --full-tree HEAD \
677 mkdir -p $$TMPDIR/$$DISTDIR/`dirname $$F`; \
678 cp $$F $$TMPDIR/$$DISTDIR/$$F; \
682 find $$TMPDIR/$$DISTDIR -type d -print | xargs chmod 755; \
683 find $$TMPDIR/$$DISTDIR -type f -print | xargs chmod a+r; \
684 find $$TMPDIR/$$DISTDIR -type f -perm -0100 -print | xargs chmod a+x; \
685 $(TAR_COMMAND) $$DISTDIR) \
686 | (cd $(SRCDIR); gzip --best > $(TARFILE).gz); \
688 cd $(SRCDIR); ls -l $(TARFILE).gz
691 @$(MAKE) PREPARE_CMD='./Configure dist' tar
693 # Helper targets #####################################################
695 link-utils: $(BLDDIR)/util/opensslwrap.sh $(BLDDIR)/util/shlib_wrap.sh
697 $(BLDDIR)/util/opensslwrap.sh: configdata.pm
698 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
699 mkdir -p "$(BLDDIR)/util"; \
700 ln -sf "../$(SRCDIR)/util/opensslwrap.sh" "$(BLDDIR)/util"; \
702 $(BLDDIR)/util/shlib_wrap.sh: configdata.pm
703 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
704 mkdir -p "$(BLDDIR)/util"; \
705 ln -sf "../$(SRCDIR)/util/shlib_wrap.sh" "$(BLDDIR)/util"; \
708 $(SRCDIR)/apps/openssl-vms.cnf: $(SRCDIR)/apps/openssl.cnf
709 $(PERL) $(SRCDIR)/VMS/VMSify-conf.pl \
710 < $(SRCDIR)/apps/openssl.cnf > $(SRCDIR)/apps/openssl-vms.cnf
712 {- # because the program apps/openssl has object files as sources, and
713 # they then have the corresponding C files as source, we need to chain
714 # the lookups in %unified_info
715 my $apps_openssl = catfile("apps","openssl");
716 our @openssl_source = map { @{$unified_info{sources}->{$_}} }
717 @{$unified_info{sources}->{$apps_openssl}};
719 $(SRCDIR)/apps/progs.h:
721 $(PERL) $(SRCDIR)/apps/progs.pl {- join(" ", @openssl_source) -} > $@
723 $(SRCDIR)/crypto/bn/bn_prime.h: $(SRCDIR)/crypto/bn/bn_prime.pl
724 $(PERL) $(SRCDIR)/crypto/bn/bn_prime.pl > $(SRCDIR)/crypto/bn/bn_prime.h
726 $(SRCDIR)/crypto/objects/obj_dat.h: $(SRCDIR)/crypto/objects/obj_dat.pl \
727 $(SRCDIR)/include/openssl/obj_mac.h
728 $(PERL) $(SRCDIR)/crypto/objects/obj_dat.pl \
729 $(SRCDIR)/include/openssl/obj_mac.h \
730 $(SRCDIR)/crypto/objects/obj_dat.h
732 # objects.pl both reads and writes obj_mac.num
733 $(SRCDIR)/include/openssl/obj_mac.h: $(SRCDIR)/crypto/objects/objects.pl \
734 $(SRCDIR)/crypto/objects/objects.txt \
735 $(SRCDIR)/crypto/objects/obj_mac.num
736 $(PERL) $(SRCDIR)/crypto/objects/objects.pl \
737 $(SRCDIR)/crypto/objects/objects.txt \
738 $(SRCDIR)/crypto/objects/obj_mac.num \
739 $(SRCDIR)/include/openssl/obj_mac.h
740 @sleep 1; touch $(SRCDIR)/include/openssl/obj_mac.h; sleep 1
742 $(SRCDIR)/crypto/objects/obj_xref.h: $(SRCDIR)/crypto/objects/objxref.pl \
743 $(SRCDIR)/crypto/objects/obj_xref.txt \
744 $(SRCDIR)/crypto/objects/obj_mac.num
745 $(PERL) $(SRCDIR)/crypto/objects/objxref.pl \
746 $(SRCDIR)/crypto/objects/obj_mac.num \
747 $(SRCDIR)/crypto/objects/obj_xref.txt \
748 > $(SRCDIR)/crypto/objects/obj_xref.h
749 @sleep 1; touch $(SRCDIR)/crypto/objects/obj_xref.h; sleep 1
753 # Building targets ###################################################
755 libcrypto.pc libssl.pc openssl.pc: configdata.pm $(LIBS)
757 @ ( echo 'prefix=$(INSTALLTOP)'; \
758 echo 'exec_prefix=$${prefix}'; \
759 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
760 echo 'includedir=$${prefix}/include'; \
762 echo 'Name: OpenSSL-libcrypto'; \
763 echo 'Description: OpenSSL cryptography library'; \
764 echo 'Version: '$(VERSION); \
765 echo 'Libs: -L$${libdir} -lcrypto'; \
766 echo 'Libs.private: $(EX_LIBS)'; \
767 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
770 @ ( echo 'prefix=$(INSTALLTOP)'; \
771 echo 'exec_prefix=$${prefix}'; \
772 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
773 echo 'includedir=$${prefix}/include'; \
775 echo 'Name: OpenSSL-libssl'; \
776 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
777 echo 'Version: '$(VERSION); \
778 echo 'Requires.private: libcrypto'; \
779 echo 'Libs: -L$${libdir} -lssl'; \
780 echo 'Libs.private: $(EX_LIBS)'; \
781 echo 'Cflags: -I$${includedir}' ) > libssl.pc
784 @ ( echo 'prefix=$(INSTALLTOP)'; \
785 echo 'exec_prefix=$${prefix}'; \
786 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
787 echo 'includedir=$${prefix}/include'; \
789 echo 'Name: OpenSSL'; \
790 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
791 echo 'Version: '$(VERSION); \
792 echo 'Requires: libssl libcrypto' ) > openssl.pc
794 # Note on the use of $(MFLAGS): this was an older variant of MAKEFLAGS which
795 # wasn't passed down automatically. It's quite safe to use it like we do
796 # below; if it doesn't exist, the result will be empty and 'make' will pick
797 # up $(MAKEFLAGS) which is passed down as an environment variable.
798 configdata.pm: {- $config{build_file_template} -} $(SRCDIR)/Configurations/common.tmpl $(SRCDIR)/Configure $(SRCDIR)/config {- join(" ", @{$config{build_infos}}) -}
799 @echo "Detected changed: $?"
800 @echo "Reconfiguring..."
801 $(SRCDIR)/Configure reconf
802 @echo "**************************************************"
804 @echo "*** Please run the same make command again ***"
806 @echo "**************************************************"
811 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
813 # Helper function to figure out dependencies on libraries
814 # It takes a list of library names and outputs a list of dependencies
815 sub compute_lib_depends {
816 if ($disabled{shared}) {
817 return map { $_.$libext } @_;
820 # Depending on shared libraries:
821 # On Windows POSIX layers, we depend on {libname}.dll.a
822 # On Unix platforms, we depend on {shlibname}.so
823 return map { shlib_simple($_) } @_;
828 my $generator = join(" ", @{$args{generator}});
829 my $incs = join("", map { " -I".$_ } @{$args{incs}});
831 if ($args{src} !~ /\.[sS]$/) {
833 $args{src}: $args{generator}->[0]
834 \$(PERL) $generator > \$@
837 if ($args{generator}->[0] =~ /\.pl$/) {
838 $generator = 'CC="$(CC)" $(PERL) '.$generator;
839 } elsif ($args{generator}->[0] =~ /\.m4$/) {
840 $generator = 'm4 -B 8192 '.$generator.' >'
841 } elsif ($args{generator}->[0] =~ /\.S$/) {
844 die "Generator type for $args{src} unknown: $generator\n";
847 if (defined($generator)) {
848 # If the target is named foo.S in build.info, we want to
849 # end up generating foo.s in two steps.
850 if ($args{src} =~ /\.S$/) {
851 (my $target = $args{src}) =~ s|\.S$|.s|;
853 $target: $args{generator}->[0]
854 ( trap "rm -f \$@.*" INT 0; \\
856 \$(CC) \$(CFLAGS) $incs -E -P \$@.S > \$@.i && mv -f \$@.i \$@ )
861 $args{src}: $args{generator}->[0]
866 $args{src}: $args{generator}->[0]
867 \$(CC) \$(CFLAGS) $incs -E -P \$< > \$@
872 # Should one wonder about the end of the Perl snippet, it's because this
873 # second regexp eats up line endings as well, if the removed path is the
874 # last in the line. We may therefore need to put back a line ending.
877 my $obj = $args{obj};
878 my @srcs = map { (my $x = $_) =~ s/\.S$/.s/; $x } ( @{$args{srcs}} );
879 my $srcs = join(" ", @srcs);
880 my $deps = join(" ", @srcs, @{$args{deps}});
881 my $incs = join("", map { " -I".$_ } @{$args{incs}});
882 my $ecflags = { lib => '$(LIB_CFLAGS)',
883 dso => '$(DSO_CFLAGS)',
884 bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
885 my $makedepprog = $config{makedepprog};
887 if (!$disabled{makedepend} && $makedepprog =~ /\/makedepend/) {
890 rm -f \$\@.tmp; touch \$\@.tmp
891 -\$(MAKEDEPEND) -f\$\@.tmp -o"|$obj$objext" -- \$(CFLAGS) $ecflags$incs -- $srcs \\
893 perl -i -pe 's/^.*\\|//; s/ \\/(\\\\.|[^ ])*//; #\\
894 \$\$_ = undef if (/: *\$\$/ || /^(#.*| *)\$\$/); #\\
895 \$\$_.="\\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 mv $obj$depext.tmp $obj$depext; \\
918 rm -f $obj$depext.tmp; \\
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.