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 $config{no_shared};
39 return $unified_info{sharednames}->{$lib} . $shlibext;
42 return () if $config{no_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 DEPS={- join(" ", map { (my $x = $_) =~ s|\.o$|$depext|; $x; }
83 grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
84 keys %{$unified_info{sources}}); -}
86 BIN_SCRIPTS=$(BLDDIR)/tools/c_rehash
87 MISC_SCRIPTS=$(SRCDIR)/tools/c_hash $(SRCDIR)/tools/c_info \
88 $(SRCDIR)/tools/c_issuer $(SRCDIR)/tools/c_name \
89 $(BLDDIR)/apps/CA.pl $(SRCDIR)/apps/tsget
91 SHLIB_INFO={- join(" ", map { "\"".shlib($_).";".shlib_simple($_)."\"" } @{$unified_info{libraries}}) -}
93 # DESTDIR is for package builders so that they can configure for, say,
94 # /usr/ and yet have everything installed to /tmp/somedir/usr/.
95 # Normally it is left empty.
98 # Do not edit these manually. Use Configure with --prefix or --openssldir
99 # to change this! Short explanation in the top comment in Configure
100 INSTALLTOP={- # $prefix is used in the OPENSSLDIR perl snippet
102 our $prefix = $config{prefix} || "/usr/local";
105 # The logic here is that if no --openssldir was given,
106 # OPENSSLDIR will get the value from $prefix plus "/ssl".
107 # If --openssldir was given and the value is an absolute
108 # path, OPENSSLDIR will get its value without change.
109 # If the value from --openssldir is a relative path,
110 # OPENSSLDIR will get $prefix with the --openssldir
111 # value appended as a subdirectory.
113 use File::Spec::Functions;
115 $config{openssldir} ?
116 (file_name_is_absolute($config{openssldir}) ?
118 : catdir($prefix, $config{openssldir}))
119 : catdir($prefix, "ssl");
122 # if $prefix/lib$target{multilib} is not an existing
123 # directory, then assume that it's not searched by linker
124 # automatically, in which case adding $target{multilib} suffix
125 # causes more grief than we're ready to tolerate, so don't...
127 -d "$prefix/lib$target{multilib}" ? $target{multilib} : "";
128 our $libdir = $config{libdir} || "lib$multilib";
130 ENGINESDIR={- use File::Spec::Functions;
131 catdir($prefix,$libdir,"engines") -}
133 MANDIR=$(INSTALLTOP)/share/man
134 DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME)
135 HTMLDIR=$(DOCDIR)/html
137 # MANSUFFIX is for the benefit of anyone who may want to have a suffix
138 # appended after the manpage file section number. "ssl" is popular,
139 # resulting in files such as config.5ssl rather than config.5.
145 CROSS_COMPILE= {- $config{cross_compile_prefix} -}
146 CC= $(CROSS_COMPILE){- $target{cc} -}
147 CFLAGS={- our $cflags2 = join(" ",(map { "-D".$_} @{$config{defines}}),"-DOPENSSLDIR=\"\\\"\$(OPENSSLDIR)\\\"\"","-DENGINESDIR=\"\\\"\$(ENGINESDIR)\\\"\"") -} {- $config{cflags} -}
148 CFLAGS_Q={- $cflags2 =~ s|([\\"])|\\$1|g; $cflags2 -} {- $config{cflags} -}
149 LDFLAGS= {- $config{lflags} -}
150 PLIB_LDFLAGS= {- $config{plib_lflags} -}
151 EX_LIBS= {- $config{ex_libs} -}
152 SHARED_CFLAGS={- $target{shared_cflag} || "" -}
153 SHARED_LDFLAGS={- $target{shared_ldflag}
154 # Unlike other OSes (like Solaris, Linux, Tru64,
155 # IRIX) BSD run-time linkers (tested OpenBSD, NetBSD
156 # and FreeBSD) "demand" RPATH set on .so objects.
157 # Apparently application RPATH is not global and
158 # does not apply to .so linked with other .so.
159 # Problem manifests itself when libssl.so fails to
160 # load libcrypto.so. One can argue that we should
161 # engrave this into Makefile.shared rules or into
162 # BSD-* config lines above. Meanwhile let's try to
163 # be cautious and pass -rpath to linker only when
164 # $prefix is not /usr.
165 . ($config{target} =~ m|^BSD-| && $prefix !~ m|^/usr/.*$|
166 ? " -Wl,-rpath,\$\$(LIBRPATH)" : "") -}
167 SHARED_RCFLAGS={- $target{shared_rcflag} -}
168 DSO_CFLAGS={- $target{shared_cflag} || "" -}
171 PERL={- $config{perl} -}
173 ARFLAGS= {- $target{arflags} -}
174 AR=$(CROSS_COMPILE){- $target{ar} || "ar" -} $(ARFLAGS) r
175 RANLIB= {- $target{ranlib} -}
176 NM= $(CROSS_COMPILE){- $target{nm} || "nm" -}
179 TAR= {- $target{tar} || "tar" -}
180 TARFLAGS= {- $target{tarflags} -}
181 MAKEDEPEND=$(CROSS_COMPILE){- $config{makedepprog} -}
184 NAME= $(BASENAME)-$(VERSION)
185 TARFILE= ../$(NAME).tar
187 # We let the C compiler driver to take care of .s files. This is done in
188 # order to be excused from maintaining a separate set of architecture
189 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
190 # gcc, then the driver will automatically translate it to -xarch=v8plus
191 # and pass it down to assembler.
194 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
196 # For x86 assembler: Set PROCESSOR to 386 if you want to support
198 PROCESSOR= {- $config{processor} -}
200 # The main targets ###################################################
202 all: configdata.pm build_libs_nodep build_engines_nodep build_apps_nodep \
205 build_libs: configdata.pm build_libs_nodep depend
206 build_libs_nodep: libcrypto.pc libssl.pc openssl.pc
207 build_engines: configdata.pm build_engines_nodep depend
208 build_engines_nodep: $(ENGINES)
209 build_apps: configdata.pm build_apps_nodep depend
210 build_apps_nodep: $(PROGRAMS) $(SCRIPTS)
211 build_tests: configdata.pm build_tests_nodep depend
212 build_tests_nodep: $(TESTPROGS)
214 test tests: build_tests_nodep build_apps_nodep build_engines_nodep depend rehash
216 SRCTOP=../$(SRCDIR) \
217 BLDTOP=../$(BLDDIR) \
218 EXE_EXT={- $exeext -} \
219 $(PERL) ../$(SRCDIR)/test/run_tests.pl $(TESTS) )
222 @TOP=$(SRCDIR) PERL=$(PERL) $(PERL) $(SRCDIR)/test/run_tests.pl list
225 @set -e; for s in $(SHLIB_INFO); do \
226 s1=`echo "$$s" | cut -f1 -d";"`; \
227 s2=`echo "$$s" | cut -f2 -d";"`; \
230 if [ "$$s1" != "$$s2" ]; then \
237 install: install_sw install_ssldirs install_docs
239 uninstall: uninstall_docs uninstall_sw
242 rm -f $(PROGRAMS) $(TESTPROGS)
243 rm -f `find $(BLDDIR) -name '*{- $depext -}'`
244 rm -f `find $(BLDDIR) -name '*{- $objext -}'`
245 rm -f $(BLDDIR)/core $(BLDDIR)/rehash.time
246 rm -f $(BLDDIR)/tags $(BLDDIR)/TAGS
247 rm -f $(BLDDIR)/openssl.pc $(BLDDIR)/libcrypto.pc $(BLDDIR)/libssl.pc
248 -rm -f `find $(BLDDIR) -type l`
251 # This exists solely for those who still type 'make depend'
254 @( sed -e '/^# DO NOT DELETE THIS LINE.*/,$$d' < Makefile; \
255 echo '# DO NOT DELETE THIS LINE -- make depend depends on it.'; \
257 for d in $(DEPS); do \
258 if [ -f $$d ]; then cat $$d; fi; \
259 done ) > Makefile.new
260 @if ! cmp Makefile.new Makefile >/dev/null 2>&1; then \
261 mv -f Makefile.new Makefile; \
263 rm -f Makefile.new; \
266 # Install helper targets #############################################
268 install_sw: all install_dev install_engines install_runtime
270 uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
272 install_docs: install_man_docs install_html_docs
274 uninstall_docs: uninstall_man_docs uninstall_html_docs
275 $(RM) -r -v $(DESTDIR)$(DOCDIR)
278 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/certs
279 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/private
282 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
283 @echo "*** Installing development files"
284 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/include/openssl
285 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
286 $(BLDDIR)/include/openssl/*.h; do \
288 echo "install $$i -> $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
289 cp $$i $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
290 chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
292 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
293 @set -e; for l in $(LIBS); do \
295 echo "install $$l -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn"; \
296 cp $$l $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
297 $(RANLIB) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
298 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
299 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new \
300 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn; \
302 @ : {- output_off() if $config{no_shared}; "" -}
303 @set -e; for s in $(SHLIB_INFO); do \
304 s1=`echo "$$s" | cut -f1 -d";"`; \
305 s2=`echo "$$s" | cut -f2 -d";"`; \
306 fn1=`basename $$s1`; \
307 fn2=`basename $$s2`; \
308 : {- output_off() if windowsdll(); "" -}; \
309 echo "install $$s1 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
310 cp $$s1 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new; \
311 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new; \
312 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new \
313 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1; \
314 if [ "$$fn1" != "$$fn2" ]; then \
315 echo "link $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
316 ln -sf $$fn1 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
318 : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
319 echo "install $$s2 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
320 cp $$s2 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new; \
321 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new; \
322 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new \
323 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
324 : {- output_on() unless windowsdll(); "" -}; \
326 @ : {- output_on() if $config{no_shared}; "" -}
327 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
328 @echo "install libcrypto.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc"
329 @cp libcrypto.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
330 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
331 @echo "install libssl.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc"
332 @cp libssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
333 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
334 @echo "install openssl.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc"
335 @cp openssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
336 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
339 @echo "*** Uninstalling development files"
340 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
341 $(BLDDIR)/include/openssl/*.h; do \
343 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
344 $(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
346 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include/openssl
347 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include
348 @set -e; for l in $(LIBS); do \
350 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn"; \
351 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn; \
353 @ : {- output_off() if $config{no_shared}; "" -}
354 @set -e; for s in $(SHLIB_INFO); do \
355 s1=`echo "$$s" | cut -f1 -d";"`; \
356 s2=`echo "$$s" | cut -f2 -d";"`; \
357 fn1=`basename $$s1`; \
358 fn2=`basename $$s2`; \
359 : {- output_off() if windowsdll(); "" -}; \
360 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
361 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1; \
362 if [ "$$fn1" != "$$fn2" ]; then \
363 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
364 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
366 : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
367 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
368 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
369 : {- output_on() unless windowsdll(); "" -}; \
371 @ : {- output_on() if $config{no_shared}; "" -}
372 @echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc"
373 @$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
374 @echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc"
375 @$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
376 @echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc"
377 @$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
378 @echo $(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
379 -@$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
380 @echo $(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
381 -@$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
384 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
385 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/
386 @echo "*** Installing engines"
387 @set -e; for e in $(ENGINES); do \
389 if [ "$$fn" = '{- dso("ossltest") -}' ]; then \
392 echo "install $$e -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn"; \
393 cp $$e $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new; \
394 chmod 755 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new; \
395 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new \
396 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn; \
400 @echo "*** Uninstalling engines"
401 @set -e; for e in $(ENGINES); do \
403 if [ "$$fn" = '{- dso("ossltest") -}' ]; then \
406 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn"; \
407 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn; \
409 @echo "$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines"
410 -@$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines
413 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
414 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
415 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/misc
416 @echo "*** Installing runtime files"
417 : {- output_off() unless windowsdll(); "" -};
418 @set -e; for s in $(SHLIBS); do \
420 echo "install $$s -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
421 cp $$s $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
422 chmod 644 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
423 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
424 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
426 : {- output_on() unless windowsdll(); "" -};
427 @set -e; for x in $(PROGRAMS); do \
429 echo "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
430 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
431 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
432 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
433 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
435 @set -e; for x in $(BIN_SCRIPTS); do \
437 echo "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
438 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
439 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
440 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
441 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
443 @set -e; for x in $(MISC_SCRIPTS); do \
445 echo "install $$x -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
446 cp $$x $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
447 chmod 755 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
448 mv -f $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new \
449 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
451 @echo "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf"
452 @cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
453 @chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
454 @mv -f $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
457 @echo "*** Uninstalling runtime files"
458 @set -e; for x in $(PROGRAMS); \
461 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
462 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
464 @set -e; for x in $(BIN_SCRIPTS); \
467 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
468 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
470 @set -e; for x in $(MISC_SCRIPTS); \
473 echo "$(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
474 $(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
476 : {- output_off() unless windowsdll(); "" -};
477 @set -e; for s in $(SHLIBS); do \
479 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
480 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
482 : {- output_on() unless windowsdll(); "" -};
483 $(RM) $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
484 @echo "$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin"
485 -@$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
486 @echo "$(RMDIR) $(DESTDIR)$(OPENSSLDIR)/misc"
487 -@$(RMDIR) $(DESTDIR)$(OPENSSLDIR)/misc
489 # A method to extract all names from a .pod file
490 # The first sed extracts everything between "=head1 NAME" and the next =head1
491 # The second sed joins all the lines into one
492 # The third sed removes the description and turns all commas into spaces
493 # Voilà , you have a space separated list of names!
494 EXTRACT_NAMES=sed -e '1,/^=head1 *NAME *$$/d;/^=head1/,$$d' | \
495 sed -e ':a;{N;s/\n/ /;ba}' | \
496 sed -e 's/ - .*$$//;s/,/ /g'
499 here=`cd $(SRCDIR); pwd`; \
500 point=$$here/util/point.sh; \
501 for ds in apps:1 crypto:3 ssl:3; do \
502 defdir=`echo $$ds | cut -f1 -d:`; \
503 defsec=`echo $$ds | cut -f2 -d:`; \
504 for p in $(SRCDIR)/doc/$$defdir/*.pod; do \
505 SEC=`sed -ne 's/^=for *comment *openssl_manual_section: *\([0-9]\) *$$/\1/p' $$p`; \
506 [ -z "$$SEC" ] && SEC=$$defsec; \
507 fn=`basename $$p .pod`; \
508 NAME=`echo $$fn | tr [a-z] [A-Z]`; \
509 suf=`eval "echo $$OUTSUFFIX"`; \
510 top=`eval "echo $$OUTTOP"`; \
511 $(PERL) $(SRCDIR)/util/mkdir-p.pl $$top/man$$SEC; \
512 echo "install $$p -> $$top/man$$SEC/$$fn$$suf"; \
513 cat $$p | eval "$$GENERATE" \
514 > $$top/man$$SEC/$$fn$$suf; \
515 names=`cat $$p | $(EXTRACT_NAMES)`; \
516 ( cd $$top/man$$SEC; \
517 for n in $$names; do \
520 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
521 comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
522 comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
525 if [ "$$comp_n" != "$$comp_fn" ]; then \
526 echo "link $$top/man$$SEC/$$n$$suf -> $$top/man$$SEC/$$fn$$suf"; \
527 PLATFORM=$(PLATFORM) $$point $$fn$$suf $$n$$suf; \
534 here=`cd $(SRCDIR); pwd`; \
535 for ds in apps:1 crypto:3 ssl:3; do \
536 defdir=`echo $$ds | cut -f1 -d:`; \
537 defsec=`echo $$ds | cut -f2 -d:`; \
538 for p in $(SRCDIR)/doc/$$defdir/*.pod; do \
539 SEC=`sed -ne 's/^=for *comment *openssl_manual_section: *\([0-9]\) *$$/\1/p' $$p`; \
540 [ -z "$$SEC" ] && SEC=$$defsec; \
541 fn=`basename $$p .pod`; \
542 suf=`eval "echo $$OUTSUFFIX"`; \
543 top=`eval "echo $$OUTTOP"`; \
544 echo "$(RM) $$top/man$$SEC/$$fn$$suf"; \
545 $(RM) $$top/man$$SEC/$$fn$$suf; \
546 names=`cat $$p | $(EXTRACT_NAMES)`; \
547 for n in $$names; do \
550 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
551 comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
552 comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
555 if [ "$$comp_n" != "$$comp_fn" ]; then \
556 echo "$(RM) $$top/man$$SEC/$$n$$suf"; \
557 $(RM) $$top/man$$SEC/$$n$$suf; \
560 ( $(RMDIR) $$top/man$$SEC 2>/dev/null || exit 0 ); \
565 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
566 @echo "*** Installing manpages"
568 OUTSUFFIX='.$${SEC}$(MANSUFFIX)'; \
569 OUTTOP="$(DESTDIR)$(MANDIR)"; \
570 GENERATE='pod2man --name=$$NAME --section=$$SEC --center=OpenSSL --release=$(VERSION)'; \
574 @echo "*** Uninstalling manpages"
576 OUTSUFFIX='.$${SEC}$(MANSUFFIX)'; \
577 OUTTOP="$(DESTDIR)$(MANDIR)"; \
581 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
582 @echo "*** Installing HTML manpages"
584 OUTSUFFIX='.$(HTMLSUFFIX)'; \
585 OUTTOP="$(DESTDIR)$(HTMLDIR)"; \
586 GENERATE="pod2html --podroot=$(SRCDIR)/doc --htmldir=.. \
587 --podpath=apps:crypto:ssl \
588 | sed -e 's|href=\"http://man.he.net/man|href=\"../man|g'"; \
592 @echo "*** Uninstalling manpages"
594 OUTSUFFIX='.$(HTMLSUFFIX)'; \
595 OUTTOP="$(DESTDIR)$(HTMLDIR)"; \
599 # Developer targets (note: these are only available on Unix) #########
601 update: generate errors ordinals
603 generate: generate_apps generate_crypto_bn generate_crypto_objects
605 # Test coverage is a good idea for the future
606 #coverage: $(PROGRAMS) $(TESTPROGRAMS)
609 # Currently disabled, util/selftest.pl needs a rewrite
611 # SRCDIR=$(SRCDIR) @$(PERL) util/selftest.pl
614 lint -DLINT $(INCLUDES) $(SRCS)
616 generate_apps: $(SRCDIR)/apps/openssl-vms.cnf $(SRCDIR)/apps/progs.h
618 generate_crypto_bn: $(SRCDIR)/crypto/bn/bn_prime.h
620 generate_crypto_objects: $(SRCDIR)/crypto/objects/obj_dat.h \
621 $(SRCDIR)/include/openssl/obj_mac.h \
622 $(SRCDIR)/crypto/objects/obj_xref.h
625 ( cd $(SRCDIR); $(PERL) util/ck_errf.pl -strict */*.c */*/*.c )
626 ( cd $(SRCDIR); $(PERL) util/mkerr.pl -recurse -write )
627 ( cd $(SRCDIR)/engines; \
629 $(PERL) ../util/mkerr.pl -conf $$e \
630 -nostatic -staticloader -write *.c; \
632 ( cd $(SRCDIR)/crypto/ct; \
633 $(PERL) ../../util/mkerr.pl -conf ct.ec -hprefix internal/ -write *.c )
636 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl crypto update )
637 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl ssl update )
641 SRCTOP=../$(SRCDIR) \
642 BLDTOP=../$(BLDDIR) \
643 $(PERL) ../$(SRCDIR)/test/run_tests.pl test_ordinals )
648 -etags `find . -name '*.[ch]' -o -name '*.pm'`
650 # Release targets (note: only available on Unix) #####################
653 TMPDIR=/var/tmp/openssl-copy.$$$$; \
654 DISTDIR=openssl-$(VERSION); \
655 mkdir -p $$TMPDIR/$$DISTDIR; \
657 git ls-tree -r --name-only --full-tree HEAD \
659 mkdir -p $$TMPDIR/$$DISTDIR/`dirname $$F`; \
660 cp $$F $$TMPDIR/$$DISTDIR/$$F; \
663 [ -n "$(PREPARE_CMD)" ] && $(PREPARE_CMD); \
664 find $$TMPDIR/$$DISTDIR -type d -print | xargs chmod 755; \
665 find $$TMPDIR/$$DISTDIR -type f -print | xargs chmod a+r; \
666 find $$TMPDIR/$$DISTDIR -type f -perm -0100 -print | xargs chmod a+x; \
667 $(TAR) $(TARFLAGS) --owner 0 --group 0 -cvf - $$DISTDIR) \
668 | (cd $(SRCDIR); gzip --best > $(TARFILE).gz); \
670 cd $(SRCDIR); ls -l $(TARFILE).gz
673 @$(MAKE) PREPARE_CMD='./Configure dist' tar
675 # Helper targets #####################################################
677 rehash: link-utils copy-certs build_apps_nodep
678 @if [ -z "$(CROSS_COMPILE)" ]; then \
679 (OPENSSL="$(BLDDIR)/util/shlib_wrap.sh apps/openssl"; \
680 [ -x "$(BLDDIR)/openssl.exe" ] && OPENSSL="$(BLDDIR)/openssl.exe" || :; \
681 OPENSSL_DEBUG_MEMORY=on; OPENSSL_CONF=/dev/null ; \
682 export OPENSSL OPENSSL_DEBUG_MEMORY OPENSSL_CONF; \
683 $$OPENSSL rehash certs/demo \
684 || $(PERL) tools/c_rehash certs/demo) && \
688 link-utils: $(BLDDIR)/util/opensslwrap.sh $(BLDDIR)/util/shlib_wrap.sh
690 $(BLDDIR)/util/opensslwrap.sh: configdata.pm
691 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
692 mkdir -p "$(BLDDIR)/util"; \
693 ln -sf "../$(SRCDIR)/util/opensslwrap.sh" "$(BLDDIR)/util"; \
695 $(BLDDIR)/util/shlib_wrap.sh: configdata.pm
696 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
697 mkdir -p "$(BLDDIR)/util"; \
698 ln -sf "../$(SRCDIR)/util/shlib_wrap.sh" "$(BLDDIR)/util"; \
702 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
703 cp -R "$(SRCDIR)/certs" "$(BLDDIR)/"; \
706 $(SRCDIR)/apps/openssl-vms.cnf: $(SRCDIR)/apps/openssl.cnf
707 $(PERL) $(SRCDIR)/VMS/VMSify-conf.pl \
708 < $(SRCDIR)/apps/openssl.cnf > $(SRCDIR)/apps/openssl-vms.cnf
710 {- # because the program apps/openssl has object files as sources, and
711 # they then have the corresponding C files as source, we need to chain
712 # the lookups in %unified_info
713 my $apps_openssl = catfile("apps","openssl");
714 our @openssl_source = map { @{$unified_info{sources}->{$_}} }
715 @{$unified_info{sources}->{$apps_openssl}};
717 $(SRCDIR)/apps/progs.h:
719 $(PERL) $(SRCDIR)/apps/progs.pl {- join(" ", @openssl_source) -} > $@
721 $(SRCDIR)/crypto/bn/bn_prime.h: $(SRCDIR)/crypto/bn/bn_prime.pl
722 $(PERL) $(SRCDIR)/crypto/bn/bn_prime.pl > $(SRCDIR)/crypto/bn/bn_prime.h
724 $(SRCDIR)/crypto/objects/obj_dat.h: $(SRCDIR)/crypto/objects/obj_dat.pl \
725 $(SRCDIR)/include/openssl/obj_mac.h
726 $(PERL) $(SRCDIR)/crypto/objects/obj_dat.pl \
727 $(SRCDIR)/include/openssl/obj_mac.h \
728 $(SRCDIR)/crypto/objects/obj_dat.h
730 # objects.pl both reads and writes obj_mac.num
731 $(SRCDIR)/include/openssl/obj_mac.h: $(SRCDIR)/crypto/objects/objects.pl \
732 $(SRCDIR)/crypto/objects/objects.txt \
733 $(SRCDIR)/crypto/objects/obj_mac.num
734 $(PERL) $(SRCDIR)/crypto/objects/objects.pl \
735 $(SRCDIR)/crypto/objects/objects.txt \
736 $(SRCDIR)/crypto/objects/obj_mac.num \
737 $(SRCDIR)/include/openssl/obj_mac.h
738 @sleep 1; touch $(SRCDIR)/include/openssl/obj_mac.h; sleep 1
740 $(SRCDIR)/crypto/objects/obj_xref.h: $(SRCDIR)/crypto/objects/objxref.pl \
741 $(SRCDIR)/crypto/objects/obj_xref.txt \
742 $(SRCDIR)/crypto/objects/obj_mac.num
743 $(PERL) $(SRCDIR)/crypto/objects/objxref.pl \
744 $(SRCDIR)/crypto/objects/obj_mac.num \
745 $(SRCDIR)/crypto/objects/obj_xref.txt \
746 > $(SRCDIR)/crypto/objects/obj_xref.h
747 @sleep 1; touch $(SRCDIR)/crypto/objects/obj_xref.h; sleep 1
751 # Building targets ###################################################
753 libcrypto.pc libssl.pc openssl.pc: configdata.pm $(LIBS)
755 @ ( echo 'prefix=$(INSTALLTOP)'; \
756 echo 'exec_prefix=$${prefix}'; \
757 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
758 echo 'includedir=$${prefix}/include'; \
760 echo 'Name: OpenSSL-libcrypto'; \
761 echo 'Description: OpenSSL cryptography library'; \
762 echo 'Version: '$(VERSION); \
763 echo 'Libs: -L$${libdir} -lcrypto'; \
764 echo 'Libs.private: $(EX_LIBS)'; \
765 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
768 @ ( echo 'prefix=$(INSTALLTOP)'; \
769 echo 'exec_prefix=$${prefix}'; \
770 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
771 echo 'includedir=$${prefix}/include'; \
773 echo 'Name: OpenSSL-libssl'; \
774 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
775 echo 'Version: '$(VERSION); \
776 echo 'Requires.private: libcrypto'; \
777 echo 'Libs: -L$${libdir} -lssl'; \
778 echo 'Libs.private: $(EX_LIBS)'; \
779 echo 'Cflags: -I$${includedir}' ) > libssl.pc
782 @ ( echo 'prefix=$(INSTALLTOP)'; \
783 echo 'exec_prefix=$${prefix}'; \
784 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
785 echo 'includedir=$${prefix}/include'; \
787 echo 'Name: OpenSSL'; \
788 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
789 echo 'Version: '$(VERSION); \
790 echo 'Requires: libssl libcrypto' ) > openssl.pc
792 # Note on the use of $(MFLAGS): this was an older variant of MAKEFLAGS which
793 # wasn't passed down automatically. It's quite safe to use it like we do
794 # below; if it doesn't exist, the result will be empty and 'make' will pick
795 # up $(MAKEFLAGS) which is passed down as an environment variable.
796 configdata.pm: {- $config{build_file_template} -} $(SRCDIR)/Configure $(SRCDIR)/config
797 @echo "Detected changed: $?"
798 @echo "Reconfiguring..."
799 $(SRCDIR)/Configure reconf
800 @echo "**************************************************"
802 @echo "*** Please run the same make command again ***"
804 @echo "**************************************************"
809 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
811 # Helper function to figure out dependencies on libraries
812 # It takes a list of library names and outputs a list of dependencies
813 sub compute_lib_depends {
814 if ($config{no_shared}) {
815 return map { $_.$libext } @_;
818 # Depending on shared libraries:
819 # On Windows POSIX layers, we depend on {libname}.dll.a
820 # On Unix platforms, we depend on {shlibname}.so
821 return map { shlib_simple($_) } @_;
826 my $obj = $args{obj};
827 my $srcs = join(" ", @{$args{srcs}});
828 my $deps = join(" ", @{$args{srcs}}, @{$args{deps}});
829 my $incs = join("", map { " -I".$_ } @{$args{incs}});
830 my $ecflags = { lib => '$(SHARED_CFLAGS)',
831 dso => '$(DSO_CFLAGS)',
832 bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
833 my $makedepprog = $config{makedepprog};
834 if ($makedepprog eq "makedepend") {
837 rm -f \$\@.tmp; touch \$\@.tmp
838 \$(MAKEDEPEND) -f\$\@.tmp -o"|$obj" -- \$(CFLAGS) $ecflags$incs -- $srcs \\
840 sed -e 's/^.*|//' -e 's/ \\/\\(\\\\.\\|[^ ]\\)*//g' -e '/: *\$\$/d' -e '/^\\(#.*\\| *\\)\$\$/d' \$\@.tmp > \$\@
842 $obj$objext: $obj$depext
843 \$(CC) \$(CFLAGS) $ecflags$incs -c -o \$\@ $srcs
848 \$(CC) \$(CFLAGS) $ecflags$incs -MM -MF \$\@ -MQ $obj$objext $srcs
850 $obj$objext: $obj$depext
851 \$(CC) \$(CFLAGS) $ecflags$incs -c -o \$\@ $srcs
854 # On Unix, we build shlibs from static libs, so we're ignoring the
855 # object file array. We *know* this routine is only called when we've
856 # configure 'shared'.
859 my $lib = $args{lib};
860 my $shlib = $args{shlib};
861 my $libd = dirname($lib);
862 my $libn = basename($lib);
863 (my $libname = $libn) =~ s/^lib//;
864 my $linklibs = join("", map { my $d = dirname($_);
865 my $f = basename($_);
866 (my $l = $f) =~ s/^lib//;
867 " -L$d -l$l" } @{$args{deps}});
868 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
869 my $shlib_target = $target{shared_target};
870 my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : "";
871 my $target = shlib_simple($lib);
873 # With a build on a Windows POSIX layer (Cygwin or Mingw), we know for a fact
874 # that two files get produced, {shlibname}.dll and {libname}.dll.a.
875 # With all other Unix platforms, we often build a shared library with the
876 # SO version built into the file name and a symlink without the SO version
877 # It's not necessary to have both as targets. The choice falls on the
878 # simplest, {libname}$shlibextimport for Windows POSIX layers and
879 # {libname}$shlibextsimple for the Unix platforms.
880 $target: $lib$libext $deps $ordinalsfile
881 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
882 PLATFORM=\$(PLATFORM) \\
883 PERL=\$(PERL) SRCDIR="\$(SRCDIR)" DSTDIR="$libd" \\
884 INSTALLTOP="\$(INSTALLTOP)" LIBDIR="\$(LIBDIR)" \\
885 LIBDEPS="\$(PLIB_LDFLAGS) $linklibs \$(EX_LIBS)" \\
886 LIBNAME=$libname LIBVERSION=\$(SHLIB_MAJOR).\$(SHLIB_MINOR) \\
887 LIBCOMPATVERSIONS=";\$(SHLIB_VERSION_HISTORY)" \\
888 CC="\$(CC)" CFLAGS="\$(CFLAGS)" LDFLAGS="\$(LDFLAGS)" \\
889 CROSS_COMPILE="\$(CROSS_COMPILE)" \\
890 SHARED_LDFLAGS="\$(SHARED_LDFLAGS)" SHLIB_EXT=$shlibext \\
891 SHARED_RCFLAGS="\$(SHARED_RCFLAGS)" \\
892 link_shlib.$shlib_target
894 . (windowsdll() ? <<"EOF" : "");
895 rm -f apps/$shlib$shlibext
896 rm -f test/$shlib$shlibext
897 cp -p $shlib$shlibext apps/
898 cp -p $shlib$shlibext test/
903 my $lib = $args{lib};
904 my $libd = dirname($lib);
905 my $libn = basename($lib);
906 (my $libname = $libn) =~ s/^lib//;
907 my $shlibdeps = join("", map { my $d = dirname($_);
908 my $f = basename($_);
909 (my $l = $f) =~ s/^lib//;
910 " -L$d -l$l" } @{$args{deps}});
911 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
912 my $shlib_target = $target{shared_target};
913 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
914 my $target = dso($lib);
917 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
918 PLATFORM=\$(PLATFORM) \\
919 PERL=\$(PERL) SRCDIR="\$(SRCDIR)" DSTDIR="$libd" \\
920 LIBDEPS="\$(PLIB_LDFLAGS) $shlibdeps \$(EX_LIBS)" \\
921 LIBNAME=$libname LDFLAGS="\$(LDFLAGS)" \\
922 CC="\$(CC)" CFLAGS="\$(CFLAGS)" \\
923 SHARED_LDFLAGS="\$(SHARED_LDFLAGS)" \\
926 link_dso.$shlib_target
931 my $lib = $args{lib};
932 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
936 \$(RANLIB) \$\@ || echo Never mind.
941 my $bin = $args{bin};
942 my $bind = dirname($bin);
943 my $binn = basename($bin);
944 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
945 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
946 my $linklibs = join("", map { my $d = dirname($_);
947 my $f = basename($_);
948 $d = "." if $d eq $f;
949 (my $l = $f) =~ s/^lib//;
950 " -L$d -l$l" } @{$args{deps}});
951 my $shlib_target = $config{no_shared} ? "" : $target{shared_target};
953 $bin$exeext: $objs $deps
955 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
956 PERL=\$(PERL) SRCDIR=\$(SRCDIR) \\
957 APPNAME=$bin$exeext OBJECTS="$objs" \\
958 LIBDEPS="\$(PLIB_LDFLAGS) $linklibs \$(EX_LIBS)" \\
959 CC="\$(CC)" CFLAGS="\$(CFLAGS)" LDFLAGS="\$(LDFLAGS)" \\
960 LIBRPATH="\$(INSTALLTOP)/\$(LIBDIR)" \\
961 link_app.$shlib_target
966 my $script = $args{script};
967 my $sources = join(" ", @{$args{sources}});
968 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
969 "util", "dofile.pl")),
970 rel2abs($config{builddir}));
973 \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
974 "-o$target{build_file}" $sources > "$script"
978 "" # Important! This becomes part of the template result.