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'
253 @( sed -e '/^# DO NOT DELETE THIS LINE.*/,$$d' < Makefile; \
254 echo '# DO NOT DELETE THIS LINE -- make depend depends on it.'; \
256 for d in $(DEPS); do \
257 if [ -f $$d ]; then cat $$d; fi; \
258 done ) > Makefile.new
259 @if ! cmp Makefile.new Makefile >/dev/null 2>&1; then \
260 mv -f Makefile.new Makefile; \
262 rm -f Makefile.new; \
265 # Install helper targets #############################################
267 install_sw: all install_dev install_engines install_runtime
269 uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
271 install_docs: install_man_docs install_html_docs
273 uninstall_docs: uninstall_man_docs uninstall_html_docs
274 $(RM) -r -v $(DESTDIR)$(DOCDIR)
277 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/certs
278 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/private
281 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
282 @echo "*** Installing development files"
283 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/include/openssl
284 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
285 $(BLDDIR)/include/openssl/*.h; do \
287 echo "install $$i -> $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
288 cp $$i $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
289 chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
291 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
292 @set -e; for l in $(LIBS); do \
294 echo "install $$l -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn"; \
295 cp $$l $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
296 $(RANLIB) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
297 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
298 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new \
299 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn; \
301 @ : {- output_off() if $config{no_shared}; "" -}
302 @set -e; for s in $(SHLIB_INFO); do \
303 s1=`echo "$$s" | cut -f1 -d";"`; \
304 s2=`echo "$$s" | cut -f2 -d";"`; \
305 fn1=`basename $$s1`; \
306 fn2=`basename $$s2`; \
307 : {- output_off() if windowsdll(); "" -}; \
308 echo "install $$s1 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
309 cp $$s1 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new; \
310 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new; \
311 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new \
312 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1; \
313 if [ "$$fn1" != "$$fn2" ]; then \
314 echo "link $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
315 ln -sf $$fn1 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
317 : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
318 echo "install $$s2 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
319 cp $$s2 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new; \
320 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new; \
321 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new \
322 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
323 : {- output_on() unless windowsdll(); "" -}; \
325 @ : {- output_on() if $config{no_shared}; "" -}
326 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
327 @echo "install libcrypto.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc"
328 @cp libcrypto.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
329 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
330 @echo "install libssl.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc"
331 @cp libssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
332 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
333 @echo "install openssl.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc"
334 @cp openssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
335 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
338 @echo "*** Uninstalling development files"
339 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
340 $(BLDDIR)/include/openssl/*.h; do \
342 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
343 $(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
345 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include/openssl
346 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include
347 @set -e; for l in $(LIBS); do \
349 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn"; \
350 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn; \
352 @ : {- output_off() if $config{no_shared}; "" -}
353 @set -e; for s in $(SHLIB_INFO); do \
354 s1=`echo "$$s" | cut -f1 -d";"`; \
355 s2=`echo "$$s" | cut -f2 -d";"`; \
356 fn1=`basename $$s1`; \
357 fn2=`basename $$s2`; \
358 : {- output_off() if windowsdll(); "" -}; \
359 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
360 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1; \
361 if [ "$$fn1" != "$$fn2" ]; then \
362 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
363 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
365 : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
366 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
367 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
368 : {- output_on() unless windowsdll(); "" -}; \
370 @ : {- output_on() if $config{no_shared}; "" -}
371 @echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc"
372 @$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
373 @echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc"
374 @$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
375 @echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc"
376 @$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
377 @echo $(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
378 -@$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
379 @echo $(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
380 -@$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
383 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
384 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/
385 @echo "*** Installing engines"
386 @set -e; for e in $(ENGINES); do \
388 if [ "$$fn" = '{- dso("ossltest") -}' ]; then \
391 echo "install $$e -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn"; \
392 cp $$e $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new; \
393 chmod 755 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new; \
394 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new \
395 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn; \
399 @echo "*** Uninstalling engines"
400 @set -e; for e in $(ENGINES); do \
402 if [ "$$fn" = '{- dso("ossltest") -}' ]; then \
405 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn"; \
406 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn; \
408 @echo "$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines"
409 -@$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines
412 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
413 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
414 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/misc
415 @echo "*** Installing runtime files"
416 : {- output_off() unless windowsdll(); "" -};
417 @set -e; for s in $(SHLIBS); do \
419 echo "install $$s -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
420 cp $$s $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
421 chmod 644 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
422 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
423 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
425 : {- output_on() unless windowsdll(); "" -};
426 @set -e; for x in $(PROGRAMS); do \
428 echo "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
429 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
430 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
431 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
432 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
434 @set -e; for x in $(BIN_SCRIPTS); do \
436 echo "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
437 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
438 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
439 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
440 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
442 @set -e; for x in $(MISC_SCRIPTS); do \
444 echo "install $$x -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
445 cp $$x $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
446 chmod 755 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
447 mv -f $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new \
448 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
450 @echo "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf"
451 @cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
452 @chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
453 @mv -f $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
456 @echo "*** Uninstalling runtime files"
457 @set -e; for x in $(PROGRAMS); \
460 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
461 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
463 @set -e; for x in $(BIN_SCRIPTS); \
466 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
467 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
469 @set -e; for x in $(MISC_SCRIPTS); \
472 echo "$(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
473 $(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
475 : {- output_off() unless windowsdll(); "" -};
476 @set -e; for s in $(SHLIBS); do \
478 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
479 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
481 : {- output_on() unless windowsdll(); "" -};
482 $(RM) $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
483 @echo "$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin"
484 -@$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
485 @echo "$(RMDIR) $(DESTDIR)$(OPENSSLDIR)/misc"
486 -@$(RMDIR) $(DESTDIR)$(OPENSSLDIR)/misc
488 # A method to extract all names from a .pod file
489 # The first sed extracts everything between "=head1 NAME" and the next =head1
490 # The second sed joins all the lines into one
491 # The third sed removes the description and turns all commas into spaces
492 # Voilà , you have a space separated list of names!
493 EXTRACT_NAMES=sed -e '1,/^=head1 *NAME *$$/d;/^=head1/,$$d' | \
494 sed -e ':a;{N;s/\n/ /;ba}' | \
495 sed -e 's/ - .*$$//;s/,/ /g'
498 here=`cd $(SRCDIR); pwd`; \
499 point=$$here/util/point.sh; \
500 for ds in apps:1 crypto:3 ssl:3; do \
501 defdir=`echo $$ds | cut -f1 -d:`; \
502 defsec=`echo $$ds | cut -f2 -d:`; \
503 for p in $(SRCDIR)/doc/$$defdir/*.pod; do \
504 SEC=`sed -ne 's/^=for *comment *openssl_manual_section: *\([0-9]\) *$$/\1/p' $$p`; \
505 [ -z "$$SEC" ] && SEC=$$defsec; \
506 fn=`basename $$p .pod`; \
507 NAME=`echo $$fn | tr [a-z] [A-Z]`; \
508 suf=`eval "echo $$OUTSUFFIX"`; \
509 top=`eval "echo $$OUTTOP"`; \
510 $(PERL) $(SRCDIR)/util/mkdir-p.pl $$top/man$$SEC; \
511 echo "install $$p -> $$top/man$$SEC/$$fn$$suf"; \
512 cat $$p | eval "$$GENERATE" \
513 > $$top/man$$SEC/$$fn$$suf; \
514 names=`cat $$p | $(EXTRACT_NAMES)`; \
515 ( cd $$top/man$$SEC; \
516 for n in $$names; do \
519 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
520 comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
521 comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
524 if [ "$$comp_n" != "$$comp_fn" ]; then \
525 echo "link $$top/man$$SEC/$$n$$suf -> $$top/man$$SEC/$$fn$$suf"; \
526 PLATFORM=$(PLATFORM) $$point $$fn$$suf $$n$$suf; \
533 here=`cd $(SRCDIR); pwd`; \
534 for ds in apps:1 crypto:3 ssl:3; do \
535 defdir=`echo $$ds | cut -f1 -d:`; \
536 defsec=`echo $$ds | cut -f2 -d:`; \
537 for p in $(SRCDIR)/doc/$$defdir/*.pod; do \
538 SEC=`sed -ne 's/^=for *comment *openssl_manual_section: *\([0-9]\) *$$/\1/p' $$p`; \
539 [ -z "$$SEC" ] && SEC=$$defsec; \
540 fn=`basename $$p .pod`; \
541 suf=`eval "echo $$OUTSUFFIX"`; \
542 top=`eval "echo $$OUTTOP"`; \
543 echo "$(RM) $$top/man$$SEC/$$fn$$suf"; \
544 $(RM) $$top/man$$SEC/$$fn$$suf; \
545 names=`cat $$p | $(EXTRACT_NAMES)`; \
546 for n in $$names; do \
549 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
550 comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
551 comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
554 if [ "$$comp_n" != "$$comp_fn" ]; then \
555 echo "$(RM) $$top/man$$SEC/$$n$$suf"; \
556 $(RM) $$top/man$$SEC/$$n$$suf; \
559 ( $(RMDIR) $$top/man$$SEC 2>/dev/null || exit 0 ); \
564 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
565 @echo "*** Installing manpages"
567 OUTSUFFIX='.$${SEC}$(MANSUFFIX)'; \
568 OUTTOP="$(DESTDIR)$(MANDIR)"; \
569 GENERATE='pod2man --name=$$NAME --section=$$SEC --center=OpenSSL --release=$(VERSION)'; \
573 @echo "*** Uninstalling manpages"
575 OUTSUFFIX='.$${SEC}$(MANSUFFIX)'; \
576 OUTTOP="$(DESTDIR)$(MANDIR)"; \
580 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
581 @echo "*** Installing HTML manpages"
583 OUTSUFFIX='.$(HTMLSUFFIX)'; \
584 OUTTOP="$(DESTDIR)$(HTMLDIR)"; \
585 GENERATE="pod2html --podroot=$(SRCDIR)/doc --htmldir=.. \
586 --podpath=apps:crypto:ssl \
587 | sed -e 's|href=\"http://man.he.net/man|href=\"../man|g'"; \
591 @echo "*** Uninstalling manpages"
593 OUTSUFFIX='.$(HTMLSUFFIX)'; \
594 OUTTOP="$(DESTDIR)$(HTMLDIR)"; \
598 # Developer targets (note: these are only available on Unix) #########
600 update: generate errors ordinals
602 generate: generate_apps generate_crypto_bn generate_crypto_objects
604 # Test coverage is a good idea for the future
605 #coverage: $(PROGRAMS) $(TESTPROGRAMS)
608 # Currently disabled, util/selftest.pl needs a rewrite
610 # SRCDIR=$(SRCDIR) @$(PERL) util/selftest.pl
613 lint -DLINT $(INCLUDES) $(SRCS)
615 generate_apps: $(SRCDIR)/apps/openssl-vms.cnf $(SRCDIR)/apps/progs.h
617 generate_crypto_bn: $(SRCDIR)/crypto/bn/bn_prime.h
619 generate_crypto_objects: $(SRCDIR)/crypto/objects/obj_dat.h \
620 $(SRCDIR)/include/openssl/obj_mac.h \
621 $(SRCDIR)/crypto/objects/obj_xref.h
624 ( cd $(SRCDIR); $(PERL) util/ck_errf.pl -strict */*.c */*/*.c )
625 ( cd $(SRCDIR); $(PERL) util/mkerr.pl -recurse -write )
626 ( cd $(SRCDIR)/engines; \
628 $(PERL) ../util/mkerr.pl -conf $$e \
629 -nostatic -staticloader -write *.c; \
631 ( cd $(SRCDIR)/crypto/ct; \
632 $(PERL) ../../util/mkerr.pl -conf ct.ec -hprefix internal/ -write *.c )
635 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl crypto update )
636 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl ssl update )
640 SRCTOP=../$(SRCDIR) \
641 BLDTOP=../$(BLDDIR) \
642 $(PERL) ../$(SRCDIR)/test/run_tests.pl test_ordinals )
647 -etags `find . -name '*.[ch]' -o -name '*.pm'`
649 # Release targets (note: only available on Unix) #####################
652 TMPDIR=/var/tmp/openssl-copy.$$$$; \
653 DISTDIR=openssl-$(VERSION); \
654 mkdir -p $$TMPDIR/$$DISTDIR; \
656 git ls-tree -r --name-only --full-tree HEAD \
658 mkdir -p $$TMPDIR/$$DISTDIR/`dirname $$F`; \
659 cp $$F $$TMPDIR/$$DISTDIR/$$F; \
662 [ -n "$(PREPARE_CMD)" ] && $(PREPARE_CMD); \
663 find $$TMPDIR/$$DISTDIR -type d -print | xargs chmod 755; \
664 find $$TMPDIR/$$DISTDIR -type f -print | xargs chmod a+r; \
665 find $$TMPDIR/$$DISTDIR -type f -perm -0100 -print | xargs chmod a+x; \
666 $(TAR) $(TARFLAGS) --owner 0 --group 0 -cvf - $$DISTDIR) \
667 | (cd $(SRCDIR); gzip --best > $(TARFILE).gz); \
669 cd $(SRCDIR); ls -l $(TARFILE).gz
672 @$(MAKE) PREPARE_CMD='./Configure dist' tar
674 # Helper targets #####################################################
676 rehash: link-utils copy-certs build_apps_nodep
677 @if [ -z "$(CROSS_COMPILE)" ]; then \
678 (OPENSSL="$(BLDDIR)/util/shlib_wrap.sh apps/openssl"; \
679 [ -x "$(BLDDIR)/openssl.exe" ] && OPENSSL="$(BLDDIR)/openssl.exe" || :; \
680 OPENSSL_DEBUG_MEMORY=on; OPENSSL_CONF=/dev/null ; \
681 export OPENSSL OPENSSL_DEBUG_MEMORY OPENSSL_CONF; \
682 $$OPENSSL rehash certs/demo \
683 || $(PERL) tools/c_rehash certs/demo) && \
687 link-utils: $(BLDDIR)/util/opensslwrap.sh $(BLDDIR)/util/shlib_wrap.sh
689 $(BLDDIR)/util/opensslwrap.sh: configdata.pm
690 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
691 mkdir -p "$(BLDDIR)/util"; \
692 ln -sf "../$(SRCDIR)/util/opensslwrap.sh" "$(BLDDIR)/util"; \
694 $(BLDDIR)/util/shlib_wrap.sh: configdata.pm
695 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
696 mkdir -p "$(BLDDIR)/util"; \
697 ln -sf "../$(SRCDIR)/util/shlib_wrap.sh" "$(BLDDIR)/util"; \
701 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
702 cp -R "$(SRCDIR)/certs" "$(BLDDIR)/"; \
705 $(SRCDIR)/apps/openssl-vms.cnf: $(SRCDIR)/apps/openssl.cnf
706 $(PERL) $(SRCDIR)/VMS/VMSify-conf.pl \
707 < $(SRCDIR)/apps/openssl.cnf > $(SRCDIR)/apps/openssl-vms.cnf
709 {- # because the program apps/openssl has object files as sources, and
710 # they then have the corresponding C files as source, we need to chain
711 # the lookups in %unified_info
712 my $apps_openssl = catfile("apps","openssl");
713 our @openssl_source = map { @{$unified_info{sources}->{$_}} }
714 @{$unified_info{sources}->{$apps_openssl}};
716 $(SRCDIR)/apps/progs.h:
718 $(PERL) $(SRCDIR)/apps/progs.pl {- join(" ", @openssl_source) -} > $@
720 $(SRCDIR)/crypto/bn/bn_prime.h: $(SRCDIR)/crypto/bn/bn_prime.pl
721 $(PERL) $(SRCDIR)/crypto/bn/bn_prime.pl > $(SRCDIR)/crypto/bn/bn_prime.h
723 $(SRCDIR)/crypto/objects/obj_dat.h: $(SRCDIR)/crypto/objects/obj_dat.pl \
724 $(SRCDIR)/include/openssl/obj_mac.h
725 $(PERL) $(SRCDIR)/crypto/objects/obj_dat.pl \
726 $(SRCDIR)/include/openssl/obj_mac.h \
727 $(SRCDIR)/crypto/objects/obj_dat.h
729 # objects.pl both reads and writes obj_mac.num
730 $(SRCDIR)/include/openssl/obj_mac.h: $(SRCDIR)/crypto/objects/objects.pl \
731 $(SRCDIR)/crypto/objects/objects.txt \
732 $(SRCDIR)/crypto/objects/obj_mac.num
733 $(PERL) $(SRCDIR)/crypto/objects/objects.pl \
734 $(SRCDIR)/crypto/objects/objects.txt \
735 $(SRCDIR)/crypto/objects/obj_mac.num \
736 $(SRCDIR)/include/openssl/obj_mac.h
737 @sleep 1; touch $(SRCDIR)/include/openssl/obj_mac.h; sleep 1
739 $(SRCDIR)/crypto/objects/obj_xref.h: $(SRCDIR)/crypto/objects/objxref.pl \
740 $(SRCDIR)/crypto/objects/obj_xref.txt \
741 $(SRCDIR)/crypto/objects/obj_mac.num
742 $(PERL) $(SRCDIR)/crypto/objects/objxref.pl \
743 $(SRCDIR)/crypto/objects/obj_mac.num \
744 $(SRCDIR)/crypto/objects/obj_xref.txt \
745 > $(SRCDIR)/crypto/objects/obj_xref.h
746 @sleep 1; touch $(SRCDIR)/crypto/objects/obj_xref.h; sleep 1
750 # Building targets ###################################################
752 libcrypto.pc libssl.pc openssl.pc: configdata.pm $(LIBS)
754 @ ( echo 'prefix=$(INSTALLTOP)'; \
755 echo 'exec_prefix=$${prefix}'; \
756 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
757 echo 'includedir=$${prefix}/include'; \
759 echo 'Name: OpenSSL-libcrypto'; \
760 echo 'Description: OpenSSL cryptography library'; \
761 echo 'Version: '$(VERSION); \
762 echo 'Libs: -L$${libdir} -lcrypto'; \
763 echo 'Libs.private: $(EX_LIBS)'; \
764 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
767 @ ( echo 'prefix=$(INSTALLTOP)'; \
768 echo 'exec_prefix=$${prefix}'; \
769 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
770 echo 'includedir=$${prefix}/include'; \
772 echo 'Name: OpenSSL-libssl'; \
773 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
774 echo 'Version: '$(VERSION); \
775 echo 'Requires.private: libcrypto'; \
776 echo 'Libs: -L$${libdir} -lssl'; \
777 echo 'Libs.private: $(EX_LIBS)'; \
778 echo 'Cflags: -I$${includedir}' ) > libssl.pc
781 @ ( echo 'prefix=$(INSTALLTOP)'; \
782 echo 'exec_prefix=$${prefix}'; \
783 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
784 echo 'includedir=$${prefix}/include'; \
786 echo 'Name: OpenSSL'; \
787 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
788 echo 'Version: '$(VERSION); \
789 echo 'Requires: libssl libcrypto' ) > openssl.pc
791 # Note on the use of $(MFLAGS): this was an older variant of MAKEFLAGS which
792 # wasn't passed down automatically. It's quite safe to use it like we do
793 # below; if it doesn't exist, the result will be empty and 'make' will pick
794 # up $(MAKEFLAGS) which is passed down as an environment variable.
795 configdata.pm: {- $config{build_file_template} -} $(SRCDIR)/Configure $(SRCDIR)/config
796 @echo "Detected changed: $?"
797 @echo "Reconfiguring..."
798 $(SRCDIR)/Configure reconf
799 @echo "**************************************************"
801 @echo "*** Please run the same make command again ***"
803 @echo "**************************************************"
808 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
810 # Helper function to figure out dependencies on libraries
811 # It takes a list of library names and outputs a list of dependencies
812 sub compute_lib_depends {
813 if ($config{no_shared}) {
814 return map { $_.$libext } @_;
817 # Depending on shared libraries:
818 # On Windows POSIX layers, we depend on {libname}.dll.a
819 # On Unix platforms, we depend on {shlibname}.so
820 return map { shlib_simple($_) } @_;
825 my $obj = $args{obj};
826 my $srcs = join(" ", @{$args{srcs}});
827 my $deps = join(" ", @{$args{srcs}}, @{$args{deps}});
828 my $incs = join("", map { " -I".$_ } @{$args{incs}});
829 my $ecflags = { lib => '$(SHARED_CFLAGS)',
830 dso => '$(DSO_CFLAGS)',
831 bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
832 my $makedepprog = $config{makedepprog};
833 if ($makedepprog eq "makedepend") {
836 rm -f \$\@.tmp; touch \$\@.tmp
837 \$(MAKEDEPEND) -f\$\@.tmp -o"|$obj" -- \$(CFLAGS) $ecflags$incs -- $srcs \\
839 sed -e 's/^.*|//' -e 's/ \\/\\(\\\\.\\|[^ ]\\)*//g' -e '/: *\$\$/d' -e '/^\\(#.*\\| *\\)\$\$/d' \$\@.tmp > \$\@
841 $obj$objext: $obj$depext
842 \$(CC) \$(CFLAGS) $ecflags$incs -c -o \$\@ $srcs
847 \$(CC) \$(CFLAGS) $ecflags$incs -MM -MF \$\@ -MQ $obj$objext $srcs
849 $obj$objext: $obj$depext
850 \$(CC) \$(CFLAGS) $ecflags$incs -c -o \$\@ $srcs
853 # On Unix, we build shlibs from static libs, so we're ignoring the
854 # object file array. We *know* this routine is only called when we've
855 # configure 'shared'.
858 my $lib = $args{lib};
859 my $shlib = $args{shlib};
860 my $libd = dirname($lib);
861 my $libn = basename($lib);
862 (my $libname = $libn) =~ s/^lib//;
863 my $linklibs = join("", map { my $d = dirname($_);
864 my $f = basename($_);
865 (my $l = $f) =~ s/^lib//;
866 " -L$d -l$l" } @{$args{deps}});
867 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
868 my $shlib_target = $target{shared_target};
869 my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : "";
870 my $target = shlib_simple($lib);
872 # With a build on a Windows POSIX layer (Cygwin or Mingw), we know for a fact
873 # that two files get produced, {shlibname}.dll and {libname}.dll.a.
874 # With all other Unix platforms, we often build a shared library with the
875 # SO version built into the file name and a symlink without the SO version
876 # It's not necessary to have both as targets. The choice falls on the
877 # simplest, {libname}$shlibextimport for Windows POSIX layers and
878 # {libname}$shlibextsimple for the Unix platforms.
879 $target: $lib$libext $deps $ordinalsfile
880 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
881 PLATFORM=\$(PLATFORM) \\
882 PERL=\$(PERL) SRCDIR="\$(SRCDIR)" DSTDIR="$libd" \\
883 INSTALLTOP="\$(INSTALLTOP)" LIBDIR="\$(LIBDIR)" \\
884 LIBDEPS="\$(PLIB_LDFLAGS) $linklibs \$(EX_LIBS)" \\
885 LIBNAME=$libname LIBVERSION=\$(SHLIB_MAJOR).\$(SHLIB_MINOR) \\
886 LIBCOMPATVERSIONS=";\$(SHLIB_VERSION_HISTORY)" \\
887 CC="\$(CC)" CFLAGS="\$(CFLAGS)" LDFLAGS="\$(LDFLAGS)" \\
888 CROSS_COMPILE="\$(CROSS_COMPILE)" \\
889 SHARED_LDFLAGS="\$(SHARED_LDFLAGS)" SHLIB_EXT=$shlibext \\
890 SHARED_RCFLAGS="\$(SHARED_RCFLAGS)" \\
891 link_shlib.$shlib_target
893 . (windowsdll() ? <<"EOF" : "");
894 rm -f apps/$shlib$shlibext
895 rm -f test/$shlib$shlibext
896 cp -p $shlib$shlibext apps/
897 cp -p $shlib$shlibext test/
902 my $lib = $args{lib};
903 my $libd = dirname($lib);
904 my $libn = basename($lib);
905 (my $libname = $libn) =~ s/^lib//;
906 my $shlibdeps = join("", map { my $d = dirname($_);
907 my $f = basename($_);
908 (my $l = $f) =~ s/^lib//;
909 " -L$d -l$l" } @{$args{deps}});
910 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
911 my $shlib_target = $target{shared_target};
912 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
913 my $target = dso($lib);
916 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
917 PLATFORM=\$(PLATFORM) \\
918 PERL=\$(PERL) SRCDIR="\$(SRCDIR)" DSTDIR="$libd" \\
919 LIBDEPS="\$(PLIB_LDFLAGS) $shlibdeps \$(EX_LIBS)" \\
920 LIBNAME=$libname LDFLAGS="\$(LDFLAGS)" \\
921 CC="\$(CC)" CFLAGS="\$(CFLAGS)" \\
922 SHARED_LDFLAGS="\$(SHARED_LDFLAGS)" \\
925 link_dso.$shlib_target
930 my $lib = $args{lib};
931 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
935 \$(RANLIB) \$\@ || echo Never mind.
940 my $bin = $args{bin};
941 my $bind = dirname($bin);
942 my $binn = basename($bin);
943 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
944 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
945 my $linklibs = join("", map { my $d = dirname($_);
946 my $f = basename($_);
947 $d = "." if $d eq $f;
948 (my $l = $f) =~ s/^lib//;
949 " -L$d -l$l" } @{$args{deps}});
950 my $shlib_target = $config{no_shared} ? "" : $target{shared_target};
952 $bin$exeext: $objs $deps
954 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
955 PERL=\$(PERL) SRCDIR=\$(SRCDIR) \\
956 APPNAME=$bin$exeext OBJECTS="$objs" \\
957 LIBDEPS="\$(PLIB_LDFLAGS) $linklibs \$(EX_LIBS)" \\
958 CC="\$(CC)" CFLAGS="\$(CFLAGS)" LDFLAGS="\$(LDFLAGS)" \\
959 LIBRPATH="\$(INSTALLTOP)/\$(LIBDIR)" \\
960 link_app.$shlib_target
965 my $script = $args{script};
966 my $sources = join(" ", @{$args{sources}});
967 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
968 "util", "dofile.pl")),
969 rel2abs($config{builddir}));
972 \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
973 "-o$target{build_file}" $sources > "$script"
977 "" # Important! This becomes part of the template result.