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 SHARED_CFLAGS={- $target{shared_cflag} || "" -}
155 SHARED_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 SHARED_RCFLAGS={- $target{shared_rcflag} -}
170 DSO_CFLAGS={- $target{shared_cflag} || "" -}
173 PERL={- $config{perl} -}
175 ARFLAGS= {- $target{arflags} -}
176 AR=$(CROSS_COMPILE){- $target{ar} || "ar" -} $(ARFLAGS) r
177 RANLIB= {- $target{ranlib} -}
178 NM= $(CROSS_COMPILE){- $target{nm} || "nm" -}
181 TAR= {- $target{tar} || "tar" -}
182 TARFLAGS= {- $target{tarflags} -}
183 MAKEDEPEND={- $config{makedepprog} -}
186 NAME= $(BASENAME)-$(VERSION)
187 TARFILE= ../$(NAME).tar
189 # We let the C compiler driver to take care of .s files. This is done in
190 # order to be excused from maintaining a separate set of architecture
191 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
192 # gcc, then the driver will automatically translate it to -xarch=v8plus
193 # and pass it down to assembler.
196 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
198 # For x86 assembler: Set PROCESSOR to 386 if you want to support
200 PROCESSOR= {- $config{processor} -}
202 # The main targets ###################################################
204 all: configdata.pm build_libs_nodep build_engines_nodep build_apps_nodep \
207 build_libs: configdata.pm build_libs_nodep depend
208 build_libs_nodep: libcrypto.pc libssl.pc openssl.pc
209 build_engines: configdata.pm build_engines_nodep depend
210 build_engines_nodep: $(ENGINES)
211 build_apps: configdata.pm build_apps_nodep depend
212 build_apps_nodep: $(PROGRAMS) $(SCRIPTS)
213 build_tests: configdata.pm build_tests_nodep depend
214 build_tests_nodep: $(TESTPROGS)
216 test tests: build_tests_nodep build_apps_nodep build_engines_nodep depend
218 SRCTOP=../$(SRCDIR) \
219 BLDTOP=../$(BLDDIR) \
220 EXE_EXT={- $exeext -} \
221 $(PERL) ../$(SRCDIR)/test/run_tests.pl $(TESTS) )
224 @TOP=$(SRCDIR) PERL=$(PERL) $(PERL) $(SRCDIR)/test/run_tests.pl list
227 @set -e; for s in $(SHLIB_INFO); do \
228 s1=`echo "$$s" | cut -f1 -d";"`; \
229 s2=`echo "$$s" | cut -f2 -d";"`; \
232 if [ "$$s1" != "$$s2" ]; then \
239 install: install_sw install_ssldirs install_docs
241 uninstall: uninstall_docs uninstall_sw
244 rm -f $(PROGRAMS) $(TESTPROGS)
245 rm -f `find $(BLDDIR) -name '*{- $depext -}'`
246 rm -f `find $(BLDDIR) -name '*{- $objext -}'`
248 rm -f $(BLDDIR)/tags $(BLDDIR)/TAGS
249 rm -f $(BLDDIR)/openssl.pc $(BLDDIR)/libcrypto.pc $(BLDDIR)/libssl.pc
250 -rm -f `find $(BLDDIR) -type l`
253 # This exists solely for those who still type 'make depend'
255 # We check if any depfile is newer than Makefile and decide to
256 # concatenate only if that is true, or if 'test' (a.k.a [ )
257 # doesn't have the option to figure it out (-nt).
259 # To check if test has the file age comparison operator, we
260 # simply try, and rely test to exit with 0 if the comparison
261 # was true, 1 if false, and most importantly, 2 if it doesn't
262 # recognise the operator.
264 @: {- output_off() if $disabled{makedepend}; "" -}
266 if [ Makefile -nt Makefile ] 2>/dev/null || [ $$? = 1 ]; then \
267 for d in $(DEPS); do \
268 if [ $$d -nt Makefile ]; then \
276 if [ $$catdepends = true ]; then \
277 ( sed -e '/^# DO NOT DELETE THIS LINE.*/,$$d' < Makefile; \
278 echo '# DO NOT DELETE THIS LINE -- make depend depends on it.'; \
280 for d in $(DEPS); do \
281 if [ -f $$d ]; then cat $$d; fi; \
282 done ) > Makefile.new; \
283 if ! cmp Makefile.new Makefile >/dev/null 2>&1; then \
284 mv -f Makefile.new Makefile; \
286 rm -f Makefile.new; \
289 @: {- output_on() if $disabled{makedepend}; "" -}
291 # Install helper targets #############################################
293 install_sw: all install_dev install_engines install_runtime
295 uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
297 install_docs: install_man_docs install_html_docs
299 uninstall_docs: uninstall_man_docs uninstall_html_docs
300 $(RM) -r -v $(DESTDIR)$(DOCDIR)
303 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/certs
304 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/private
307 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
308 @echo "*** Installing development files"
309 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/include/openssl
310 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
311 $(BLDDIR)/include/openssl/*.h; do \
313 echo "install $$i -> $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
314 cp $$i $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
315 chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
317 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
318 @set -e; for l in $(LIBS); do \
320 echo "install $$l -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn"; \
321 cp $$l $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
322 $(RANLIB) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
323 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
324 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new \
325 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn; \
327 @ : {- output_off() if $disabled{shared}; "" -}
328 @set -e; for s in $(SHLIB_INFO); do \
329 s1=`echo "$$s" | cut -f1 -d";"`; \
330 s2=`echo "$$s" | cut -f2 -d";"`; \
331 fn1=`basename $$s1`; \
332 fn2=`basename $$s2`; \
333 : {- output_off() if windowsdll(); "" -}; \
334 echo "install $$s1 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
335 cp $$s1 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new; \
336 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new; \
337 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new \
338 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1; \
339 if [ "$$fn1" != "$$fn2" ]; then \
340 echo "link $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
341 ln -sf $$fn1 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
343 : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
344 echo "install $$s2 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
345 cp $$s2 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new; \
346 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new; \
347 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new \
348 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
349 : {- output_on() unless windowsdll(); "" -}; \
351 @ : {- output_on() if $disabled{shared}; "" -}
352 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
353 @echo "install libcrypto.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc"
354 @cp libcrypto.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
355 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
356 @echo "install libssl.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc"
357 @cp libssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
358 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
359 @echo "install openssl.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc"
360 @cp openssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
361 @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
364 @echo "*** Uninstalling development files"
365 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
366 $(BLDDIR)/include/openssl/*.h; do \
368 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
369 $(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
371 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include/openssl
372 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include
373 @set -e; for l in $(LIBS); do \
375 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn"; \
376 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn; \
378 @ : {- output_off() if $disabled{shared}; "" -}
379 @set -e; for s in $(SHLIB_INFO); do \
380 s1=`echo "$$s" | cut -f1 -d";"`; \
381 s2=`echo "$$s" | cut -f2 -d";"`; \
382 fn1=`basename $$s1`; \
383 fn2=`basename $$s2`; \
384 : {- output_off() if windowsdll(); "" -}; \
385 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
386 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1; \
387 if [ "$$fn1" != "$$fn2" ]; then \
388 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
389 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
391 : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
392 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
393 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
394 : {- output_on() unless windowsdll(); "" -}; \
396 @ : {- output_on() if $disabled{shared}; "" -}
397 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
398 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
399 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
400 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
401 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
404 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
405 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/
406 @echo "*** Installing engines"
407 @set -e; for e in $(ENGINES); do \
409 if [ "$$fn" = '{- dso("ossltest") -}' ]; then \
412 echo "install $$e -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn"; \
413 cp $$e $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new; \
414 chmod 755 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new; \
415 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new \
416 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn; \
420 @echo "*** Uninstalling engines"
421 @set -e; for e in $(ENGINES); do \
423 if [ "$$fn" = '{- dso("ossltest") -}' ]; then \
426 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn"; \
427 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn; \
429 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines
432 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
433 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
434 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/misc
435 @echo "*** Installing runtime files"
436 : {- output_off() unless windowsdll(); "" -};
437 @set -e; for s in $(SHLIBS); do \
439 echo "install $$s -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
440 cp $$s $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
441 chmod 644 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
442 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
443 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
445 : {- output_on() unless windowsdll(); "" -};
446 @set -e; for x in $(PROGRAMS); do \
448 echo "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
449 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
450 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
451 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
452 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
454 @set -e; for x in $(BIN_SCRIPTS); do \
456 echo "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
457 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
458 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
459 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
460 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
462 @set -e; for x in $(MISC_SCRIPTS); do \
464 echo "install $$x -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
465 cp $$x $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
466 chmod 755 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
467 mv -f $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new \
468 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
470 @echo "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf"
471 @cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
472 @chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
473 @mv -f $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
476 @echo "*** Uninstalling runtime files"
477 @set -e; for x in $(PROGRAMS); \
480 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
481 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
483 @set -e; for x in $(BIN_SCRIPTS); \
486 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
487 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
489 @set -e; for x in $(MISC_SCRIPTS); \
492 echo "$(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
493 $(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
495 : {- output_off() unless windowsdll(); "" -};
496 @set -e; for s in $(SHLIBS); do \
498 echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
499 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
501 : {- output_on() unless windowsdll(); "" -};
502 $(RM) $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
503 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
504 -$(RMDIR) $(DESTDIR)$(OPENSSLDIR)/misc
506 # A method to extract all names from a .pod file
507 # The first sed extracts everything between "=head1 NAME" and the next =head1
508 # The second sed joins all the lines into one
509 # The third sed removes the description and turns all commas into spaces
510 # Voilà , you have a space separated list of names!
511 EXTRACT_NAMES=sed -e '1,/^=head1 *NAME *$$/d;/^=head1/,$$d' | \
512 sed -e ':a;{N;s/\n/ /;ba}' | \
513 sed -e 's/ - .*$$//;s/,/ /g'
516 here=`cd $(SRCDIR); pwd`; \
517 point=$$here/util/point.sh; \
518 for ds in apps:1 crypto:3 ssl:3; do \
519 defdir=`echo $$ds | cut -f1 -d:`; \
520 defsec=`echo $$ds | cut -f2 -d:`; \
521 for p in $(SRCDIR)/doc/$$defdir/*.pod; do \
522 SEC=`sed -ne 's/^=for *comment *openssl_manual_section: *\([0-9]\) *$$/\1/p' $$p`; \
523 [ -z "$$SEC" ] && SEC=$$defsec; \
524 fn=`basename $$p .pod`; \
525 NAME=`echo $$fn | tr [a-z] [A-Z]`; \
526 suf=`eval "echo $$OUTSUFFIX"`; \
527 top=`eval "echo $$OUTTOP"`; \
528 $(PERL) $(SRCDIR)/util/mkdir-p.pl $$top/man$$SEC; \
529 echo "install $$p -> $$top/man$$SEC/$$fn$$suf"; \
530 cat $$p | eval "$$GENERATE" \
531 > $$top/man$$SEC/$$fn$$suf; \
532 names=`cat $$p | $(EXTRACT_NAMES)`; \
533 ( cd $$top/man$$SEC; \
534 for n in $$names; do \
537 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
538 comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
539 comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
542 if [ "$$comp_n" != "$$comp_fn" ]; then \
543 echo "link $$top/man$$SEC/$$n$$suf -> $$top/man$$SEC/$$fn$$suf"; \
544 PLATFORM=$(PLATFORM) $$point $$fn$$suf $$n$$suf; \
551 here=`cd $(SRCDIR); pwd`; \
552 for ds in apps:1 crypto:3 ssl:3; do \
553 defdir=`echo $$ds | cut -f1 -d:`; \
554 defsec=`echo $$ds | cut -f2 -d:`; \
555 for p in $(SRCDIR)/doc/$$defdir/*.pod; do \
556 SEC=`sed -ne 's/^=for *comment *openssl_manual_section: *\([0-9]\) *$$/\1/p' $$p`; \
557 [ -z "$$SEC" ] && SEC=$$defsec; \
558 fn=`basename $$p .pod`; \
559 suf=`eval "echo $$OUTSUFFIX"`; \
560 top=`eval "echo $$OUTTOP"`; \
561 echo "$(RM) $$top/man$$SEC/$$fn$$suf"; \
562 $(RM) $$top/man$$SEC/$$fn$$suf; \
563 names=`cat $$p | $(EXTRACT_NAMES)`; \
564 for n in $$names; do \
567 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
568 comp_n=`echo "$$n" | tr [A-Z] [a-z]`; \
569 comp_fn=`echo "$$fn" | tr [A-Z] [a-z]`; \
572 if [ "$$comp_n" != "$$comp_fn" ]; then \
573 echo "$(RM) $$top/man$$SEC/$$n$$suf"; \
574 $(RM) $$top/man$$SEC/$$n$$suf; \
577 ( $(RMDIR) $$top/man$$SEC 2>/dev/null || exit 0 ); \
582 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
583 @echo "*** Installing manpages"
585 OUTSUFFIX='.$${SEC}$(MANSUFFIX)'; \
586 OUTTOP="$(DESTDIR)$(MANDIR)"; \
587 GENERATE='pod2man --name=$$NAME --section=$$SEC --center=OpenSSL --release=$(VERSION)'; \
591 @echo "*** Uninstalling manpages"
593 OUTSUFFIX='.$${SEC}$(MANSUFFIX)'; \
594 OUTTOP="$(DESTDIR)$(MANDIR)"; \
598 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
599 @echo "*** Installing HTML manpages"
601 OUTSUFFIX='.$(HTMLSUFFIX)'; \
602 OUTTOP="$(DESTDIR)$(HTMLDIR)"; \
603 GENERATE="pod2html --podroot=$(SRCDIR)/doc --htmldir=.. \
604 --podpath=apps:crypto:ssl \
605 | sed -e 's|href=\"http://man.he.net/man|href=\"../man|g'"; \
609 @echo "*** Uninstalling manpages"
611 OUTSUFFIX='.$(HTMLSUFFIX)'; \
612 OUTTOP="$(DESTDIR)$(HTMLDIR)"; \
616 # Developer targets (note: these are only available on Unix) #########
618 update: generate errors ordinals
620 generate: generate_apps generate_crypto_bn generate_crypto_objects
622 # Test coverage is a good idea for the future
623 #coverage: $(PROGRAMS) $(TESTPROGRAMS)
626 # Currently disabled, util/selftest.pl needs a rewrite
628 # SRCDIR=$(SRCDIR) @$(PERL) util/selftest.pl
631 lint -DLINT $(INCLUDES) $(SRCS)
633 generate_apps: $(SRCDIR)/apps/openssl-vms.cnf $(SRCDIR)/apps/progs.h
635 generate_crypto_bn: $(SRCDIR)/crypto/bn/bn_prime.h
637 generate_crypto_objects: $(SRCDIR)/crypto/objects/obj_dat.h \
638 $(SRCDIR)/include/openssl/obj_mac.h \
639 $(SRCDIR)/crypto/objects/obj_xref.h
642 ( cd $(SRCDIR); $(PERL) util/ck_errf.pl -strict */*.c */*/*.c )
643 ( cd $(SRCDIR); $(PERL) util/mkerr.pl -recurse -write )
644 ( cd $(SRCDIR)/engines; \
646 $(PERL) ../util/mkerr.pl -conf $$e \
647 -nostatic -staticloader -write *.c; \
651 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl crypto update )
652 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl ssl update )
656 SRCTOP=../$(SRCDIR) \
657 BLDTOP=../$(BLDDIR) \
658 $(PERL) ../$(SRCDIR)/test/run_tests.pl test_ordinals )
663 -etags `find . -name '*.[ch]' -o -name '*.pm'`
665 # Release targets (note: only available on Unix) #####################
667 TAR_COMMAND=$(TAR) $(TARFLAGS) --owner 0 --group 0 -cvf -
670 TMPDIR=/var/tmp/openssl-copy.$$$$; \
672 mkdir -p $$TMPDIR/$$DISTDIR; \
674 git ls-tree -r --name-only --full-tree HEAD \
676 mkdir -p $$TMPDIR/$$DISTDIR/`dirname $$F`; \
677 cp $$F $$TMPDIR/$$DISTDIR/$$F; \
681 find $$TMPDIR/$$DISTDIR -type d -print | xargs chmod 755; \
682 find $$TMPDIR/$$DISTDIR -type f -print | xargs chmod a+r; \
683 find $$TMPDIR/$$DISTDIR -type f -perm -0100 -print | xargs chmod a+x; \
684 $(TAR_COMMAND) $$DISTDIR) \
685 | (cd $(SRCDIR); gzip --best > $(TARFILE).gz); \
687 cd $(SRCDIR); ls -l $(TARFILE).gz
690 @$(MAKE) PREPARE_CMD='./Configure dist' tar
692 # Helper targets #####################################################
694 link-utils: $(BLDDIR)/util/opensslwrap.sh $(BLDDIR)/util/shlib_wrap.sh
696 $(BLDDIR)/util/opensslwrap.sh: configdata.pm
697 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
698 mkdir -p "$(BLDDIR)/util"; \
699 ln -sf "../$(SRCDIR)/util/opensslwrap.sh" "$(BLDDIR)/util"; \
701 $(BLDDIR)/util/shlib_wrap.sh: configdata.pm
702 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
703 mkdir -p "$(BLDDIR)/util"; \
704 ln -sf "../$(SRCDIR)/util/shlib_wrap.sh" "$(BLDDIR)/util"; \
707 $(SRCDIR)/apps/openssl-vms.cnf: $(SRCDIR)/apps/openssl.cnf
708 $(PERL) $(SRCDIR)/VMS/VMSify-conf.pl \
709 < $(SRCDIR)/apps/openssl.cnf > $(SRCDIR)/apps/openssl-vms.cnf
711 {- # because the program apps/openssl has object files as sources, and
712 # they then have the corresponding C files as source, we need to chain
713 # the lookups in %unified_info
714 my $apps_openssl = catfile("apps","openssl");
715 our @openssl_source = map { @{$unified_info{sources}->{$_}} }
716 @{$unified_info{sources}->{$apps_openssl}};
718 $(SRCDIR)/apps/progs.h:
720 $(PERL) $(SRCDIR)/apps/progs.pl {- join(" ", @openssl_source) -} > $@
722 $(SRCDIR)/crypto/bn/bn_prime.h: $(SRCDIR)/crypto/bn/bn_prime.pl
723 $(PERL) $(SRCDIR)/crypto/bn/bn_prime.pl > $(SRCDIR)/crypto/bn/bn_prime.h
725 $(SRCDIR)/crypto/objects/obj_dat.h: $(SRCDIR)/crypto/objects/obj_dat.pl \
726 $(SRCDIR)/include/openssl/obj_mac.h
727 $(PERL) $(SRCDIR)/crypto/objects/obj_dat.pl \
728 $(SRCDIR)/include/openssl/obj_mac.h \
729 $(SRCDIR)/crypto/objects/obj_dat.h
731 # objects.pl both reads and writes obj_mac.num
732 $(SRCDIR)/include/openssl/obj_mac.h: $(SRCDIR)/crypto/objects/objects.pl \
733 $(SRCDIR)/crypto/objects/objects.txt \
734 $(SRCDIR)/crypto/objects/obj_mac.num
735 $(PERL) $(SRCDIR)/crypto/objects/objects.pl \
736 $(SRCDIR)/crypto/objects/objects.txt \
737 $(SRCDIR)/crypto/objects/obj_mac.num \
738 $(SRCDIR)/include/openssl/obj_mac.h
739 @sleep 1; touch $(SRCDIR)/include/openssl/obj_mac.h; sleep 1
741 $(SRCDIR)/crypto/objects/obj_xref.h: $(SRCDIR)/crypto/objects/objxref.pl \
742 $(SRCDIR)/crypto/objects/obj_xref.txt \
743 $(SRCDIR)/crypto/objects/obj_mac.num
744 $(PERL) $(SRCDIR)/crypto/objects/objxref.pl \
745 $(SRCDIR)/crypto/objects/obj_mac.num \
746 $(SRCDIR)/crypto/objects/obj_xref.txt \
747 > $(SRCDIR)/crypto/objects/obj_xref.h
748 @sleep 1; touch $(SRCDIR)/crypto/objects/obj_xref.h; sleep 1
752 # Building targets ###################################################
754 libcrypto.pc libssl.pc openssl.pc: configdata.pm $(LIBS)
756 @ ( echo 'prefix=$(INSTALLTOP)'; \
757 echo 'exec_prefix=$${prefix}'; \
758 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
759 echo 'includedir=$${prefix}/include'; \
761 echo 'Name: OpenSSL-libcrypto'; \
762 echo 'Description: OpenSSL cryptography library'; \
763 echo 'Version: '$(VERSION); \
764 echo 'Libs: -L$${libdir} -lcrypto'; \
765 echo 'Libs.private: $(EX_LIBS)'; \
766 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
769 @ ( echo 'prefix=$(INSTALLTOP)'; \
770 echo 'exec_prefix=$${prefix}'; \
771 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
772 echo 'includedir=$${prefix}/include'; \
774 echo 'Name: OpenSSL-libssl'; \
775 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
776 echo 'Version: '$(VERSION); \
777 echo 'Requires.private: libcrypto'; \
778 echo 'Libs: -L$${libdir} -lssl'; \
779 echo 'Libs.private: $(EX_LIBS)'; \
780 echo 'Cflags: -I$${includedir}' ) > libssl.pc
783 @ ( echo 'prefix=$(INSTALLTOP)'; \
784 echo 'exec_prefix=$${prefix}'; \
785 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
786 echo 'includedir=$${prefix}/include'; \
788 echo 'Name: OpenSSL'; \
789 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
790 echo 'Version: '$(VERSION); \
791 echo 'Requires: libssl libcrypto' ) > openssl.pc
793 # Note on the use of $(MFLAGS): this was an older variant of MAKEFLAGS which
794 # wasn't passed down automatically. It's quite safe to use it like we do
795 # below; if it doesn't exist, the result will be empty and 'make' will pick
796 # up $(MAKEFLAGS) which is passed down as an environment variable.
797 configdata.pm: {- $config{build_file_template} -} $(SRCDIR)/Configurations/common.tmpl $(SRCDIR)/Configure $(SRCDIR)/config {- join(" ", @{$config{build_infos}}) -}
798 @echo "Detected changed: $?"
799 @echo "Reconfiguring..."
800 $(SRCDIR)/Configure reconf
801 @echo "**************************************************"
803 @echo "*** Please run the same make command again ***"
805 @echo "**************************************************"
810 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
812 # Helper function to figure out dependencies on libraries
813 # It takes a list of library names and outputs a list of dependencies
814 sub compute_lib_depends {
815 if ($disabled{shared}) {
816 return map { $_.$libext } @_;
819 # Depending on shared libraries:
820 # On Windows POSIX layers, we depend on {libname}.dll.a
821 # On Unix platforms, we depend on {shlibname}.so
822 return map { shlib_simple($_) } @_;
827 my $generator = join(" ", @{$args{generator}});
828 my $incs = join("", map { " -I".$_ } @{$args{incs}});
830 if ($args{src} !~ /\.[sS]$/) {
832 $args{src}: $args{generator}->[0]
833 \$(PERL) $generator > \$@
836 if ($args{generator}->[0] =~ /\.pl$/) {
837 $generator = 'CC="$(CC)" $(PERL) '.$generator;
838 } elsif ($args{generator}->[0] =~ /\.m4$/) {
839 $generator = 'm4 -B 8192 '.$generator.' >'
840 } elsif ($args{generator}->[0] =~ /\.S$/) {
843 die "Generator type for $args{src} unknown: $generator\n";
846 if (defined($generator)) {
847 # If the target is named foo.S in build.info, we want to
848 # end up generating foo.s in two steps.
849 if ($args{src} =~ /\.S$/) {
850 (my $target = $args{src}) =~ s|\.S$|.s|;
852 $target: $args{generator}->[0]
853 ( trap "rm -f \$@.S" INT; \\
855 \$(CC) \$(CFLAGS) $incs -E -P \$@.S > \$@ && rm -f \$@.S )
860 $args{src}: $args{generator}->[0]
865 $args{src}: $args{generator}->[0]
866 \$(CC) \$(CFLAGS) $incs -E -P \$< > \$@
873 my $obj = $args{obj};
874 my @srcs = map { (my $x = $_) =~ s/\.S$/.s/; $x } ( @{$args{srcs}} );
875 my $srcs = join(" ", @srcs);
876 my $deps = join(" ", @srcs, @{$args{deps}});
877 my $incs = join("", map { " -I".$_ } @{$args{incs}});
878 my $ecflags = { lib => '$(SHARED_CFLAGS)',
879 dso => '$(DSO_CFLAGS)',
880 bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
881 my $makedepprog = $config{makedepprog};
883 if (!$disabled{makedepend} && $makedepprog =~ /\/makedepend/) {
886 rm -f \$\@.tmp; touch \$\@.tmp
887 -\$(MAKEDEPEND) -f\$\@.tmp -o"|$obj$objext" -- \$(CFLAGS) $ecflags$incs -- $srcs \\
889 sed -e 's/^.*|//' -e 's/ \\/\\(\\\\.\\|[^ ]\\)*//g' -e '/: *\$\$/d' -e '/^\\(#.*\\| *\\)\$\$/d' \$\@.tmp > \$\@
892 $deps = $obj.$depext;
894 if ($disabled{makedepend} || $makedepprog =~ /\/makedepend/) {
897 \$(CC) \$(CFLAGS) $ecflags$incs -c -o \$\@ $srcs
900 if (!$disabled{makedepend} && $makedepprog !~ /\/makedepend/) {
903 \$(CC) \$(CFLAGS) $ecflags$incs -MMD -MF $obj$depext.tmp -MT \$\@ -c -o \$\@ $srcs
904 \@touch $obj$depext.tmp
905 \@if ! cmp $obj$depext.tmp $obj$depext > /dev/null 2> /dev/null; then \\
906 mv $obj$depext.tmp $obj$depext; \\
912 # On Unix, we build shlibs from static libs, so we're ignoring the
913 # object file array. We *know* this routine is only called when we've
914 # configure 'shared'.
917 my $lib = $args{lib};
918 my $shlib = $args{shlib};
919 my $libd = dirname($lib);
920 my $libn = basename($lib);
921 (my $libname = $libn) =~ s/^lib//;
922 my $linklibs = join("", map { my $d = dirname($_);
923 my $f = basename($_);
924 (my $l = $f) =~ s/^lib//;
925 " -L$d -l$l" } @{$args{deps}});
926 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
927 my $shlib_target = $target{shared_target};
928 my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : "";
929 my $target = shlib_simple($lib);
931 # With a build on a Windows POSIX layer (Cygwin or Mingw), we know for a fact
932 # that two files get produced, {shlibname}.dll and {libname}.dll.a.
933 # With all other Unix platforms, we often build a shared library with the
934 # SO version built into the file name and a symlink without the SO version
935 # It's not necessary to have both as targets. The choice falls on the
936 # simplest, {libname}$shlibextimport for Windows POSIX layers and
937 # {libname}$shlibextsimple for the Unix platforms.
938 $target: $lib$libext $deps $ordinalsfile
939 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
940 PLATFORM=\$(PLATFORM) \\
941 PERL=\$(PERL) SRCDIR="\$(SRCDIR)" DSTDIR="$libd" \\
942 INSTALLTOP="\$(INSTALLTOP)" LIBDIR="\$(LIBDIR)" \\
943 LIBDEPS="\$(PLIB_LDFLAGS) $linklibs \$(EX_LIBS)" \\
944 LIBNAME=$libname LIBVERSION=\$(SHLIB_MAJOR).\$(SHLIB_MINOR) \\
945 LIBCOMPATVERSIONS=";\$(SHLIB_VERSION_HISTORY)" \\
946 CC="\$(CC)" CFLAGS="\$(CFLAGS)" LDFLAGS="\$(LDFLAGS)" \\
947 CROSS_COMPILE="\$(CROSS_COMPILE)" \\
948 SHARED_LDFLAGS="\$(SHARED_LDFLAGS)" SHLIB_EXT=$shlibext \\
949 SHARED_RCFLAGS="\$(SHARED_RCFLAGS)" \\
950 link_shlib.$shlib_target
952 . (windowsdll() ? <<"EOF" : "");
953 rm -f apps/$shlib$shlibext
954 rm -f test/$shlib$shlibext
955 cp -p $shlib$shlibext apps/
956 cp -p $shlib$shlibext test/
961 my $lib = $args{lib};
962 my $libd = dirname($lib);
963 my $libn = basename($lib);
964 (my $libname = $libn) =~ s/^lib//;
965 my $shlibdeps = join("", map { my $d = dirname($_);
966 my $f = basename($_);
967 (my $l = $f) =~ s/^lib//;
968 " -L$d -l$l" } @{$args{deps}});
969 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
970 my $shlib_target = $target{shared_target};
971 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
972 my $target = dso($lib);
975 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
976 PLATFORM=\$(PLATFORM) \\
977 PERL=\$(PERL) SRCDIR="\$(SRCDIR)" DSTDIR="$libd" \\
978 LIBDEPS="\$(PLIB_LDFLAGS) $shlibdeps \$(EX_LIBS)" \\
979 LIBNAME=$libname LDFLAGS="\$(LDFLAGS)" \\
980 CC="\$(CC)" CFLAGS="\$(CFLAGS)" \\
981 SHARED_LDFLAGS="\$(SHARED_LDFLAGS)" \\
984 link_dso.$shlib_target
989 my $lib = $args{lib};
990 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
994 \$(RANLIB) \$\@ || echo Never mind.
999 my $bin = $args{bin};
1000 my $bind = dirname($bin);
1001 my $binn = basename($bin);
1002 my $objs = join(" ", map { $_.$objext } @{$args{objs}});
1003 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
1004 my $linklibs = join("", map { my $d = dirname($_);
1005 my $f = basename($_);
1006 $d = "." if $d eq $f;
1007 (my $l = $f) =~ s/^lib//;
1008 " -L$d -l$l" } @{$args{deps}});
1009 my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
1011 $bin$exeext: $objs $deps
1013 \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
1014 PERL=\$(PERL) SRCDIR=\$(SRCDIR) \\
1015 APPNAME=$bin$exeext OBJECTS="$objs" \\
1016 LIBDEPS="\$(PLIB_LDFLAGS) $linklibs \$(EX_LIBS)" \\
1017 CC="\$(CC)" CFLAGS="\$(CFLAGS)" LDFLAGS="\$(LDFLAGS)" \\
1018 LIBRPATH="\$(INSTALLTOP)/\$(LIBDIR)" \\
1019 link_app.$shlib_target
1024 my $script = $args{script};
1025 my $sources = join(" ", @{$args{sources}});
1026 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
1027 "util", "dofile.pl")),
1028 rel2abs($config{builddir}));
1031 \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
1032 "-o$target{build_file}" $sources > "$script"
1036 "" # Important! This becomes part of the template result.