]> git.ipfire.org Git - thirdparty/openssl.git/blame - Configurations/unix-Makefile.tmpl
Fix & update documentation about RAND_priv_bytes()
[thirdparty/openssl.git] / Configurations / unix-Makefile.tmpl
CommitLineData
567a9e6f
RL
1##
2## Makefile for OpenSSL
3##
4## {- join("\n## ", @autowarntext) -}
5{-
834aae2a
BL
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";
822b5e26 11 our $shlibvariant = $target{shlib_variant} || "";
834aae2a
BL
12 our $shlibextsimple = $target{shared_extension_simple} || ".so";
13 our $shlibextimport = $target{shared_import_extension} || "";
14 our $dsoext = $target{dso_extension} || ".so";
c39785d4 15 our $makedepprog = $disabled{makedepend} ? undef : $config{makedepprog};
834aae2a 16
567a9e6f 17 sub windowsdll { $config{target} =~ /^(?:Cygwin|mingw)/ }
f5c174ff 18
d4453024
RL
19 our $sover_dirname = $config{shlib_version_number};
20 $sover_dirname =~ s|\.|_|g
21 if $config{target} =~ /^mingw/;
b2de11c5 22
f5c174ff
RL
23 # shlib and shlib_simple both take a static library name and figure
24 # out what the shlib name should be.
25 #
26 # When OpenSSL is configured "no-shared", these functions will just
27 # return empty lists, making them suitable to join().
28 #
29 # With Windows DLL producers, shlib($libname) will return the shared
30 # library name (which usually is different from the static library
31 # name) with the default shared extension appended to it, while
32 # shlib_simple($libname) will return the static library name with
33 # the shared extension followed by ".a" appended to it. The former
34 # result is used as the runtime shared library while the latter is
35 # used as the DLL import library.
36 #
37 # On all Unix systems, shlib($libname) will return the library name
38 # with the default shared extension, while shlib_simple($libname)
39 # will return the name from shlib($libname) with any SO version number
40 # removed. On some systems, they may therefore return the exact same
41 # string.
42 sub shlib {
f5c174ff 43 my $lib = shift;
33105818 44 return () if $disabled{shared} || $lib =~ /\.a$/;
822b5e26 45 return $unified_info{sharednames}->{$lib}. $shlibvariant. '$(SHLIB_EXT)';
f5c174ff
RL
46 }
47 sub shlib_simple {
f5c174ff 48 my $lib = shift;
33105818
RL
49 return () if $disabled{shared} || $lib =~ /\.a$/;
50
f5c174ff 51 if (windowsdll()) {
d4453024 52 return $lib . '$(SHLIB_EXT_IMPORT)';
f5c174ff 53 }
d4453024 54 return $lib . '$(SHLIB_EXT_SIMPLE)';
f5c174ff
RL
55 }
56
33105818
RL
57 # Easy fixing of static library names
58 sub lib {
59 (my $lib = shift) =~ s/\.a$//;
60 return $lib . $libext;
61 }
62
f5c174ff
RL
63 # dso is a complement to shlib / shlib_simple that returns the
64 # given libname with the simple shared extension (possible SO version
65 # removed). This differs from shlib_simple() by being unconditional.
66 sub dso {
f5c174ff
RL
67 my $engine = shift;
68
834aae2a 69 return $engine . $dsoext;
f5c174ff 70 }
27c40a93
BL
71 # This makes sure things get built in the order they need
72 # to. You're welcome.
73 sub dependmagic {
74 my $target = shift;
75
76 return "$target: build_generated\n\t\$(MAKE) depend && \$(MAKE) _$target\n_$target";
77 }
834aae2a 78 '';
567a9e6f
RL
79-}
80PLATFORM={- $config{target} -}
81OPTIONS={- $config{options} -}
82CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -})
83SRCDIR={- $config{sourcedir} -}
84BLDDIR={- $config{builddir} -}
85
86VERSION={- $config{version} -}
87MAJOR={- $config{major} -}
88MINOR={- $config{minor} -}
89SHLIB_VERSION_NUMBER={- $config{shlib_version_number} -}
90SHLIB_VERSION_HISTORY={- $config{shlib_version_history} -}
91SHLIB_MAJOR={- $config{shlib_major} -}
92SHLIB_MINOR={- $config{shlib_minor} -}
93SHLIB_TARGET={- $target{shared_target} -}
d4453024
RL
94SHLIB_EXT={- $shlibext -}
95SHLIB_EXT_SIMPLE={- $shlibextsimple -}
96SHLIB_EXT_IMPORT={- $shlibextimport -}
567a9e6f 97
33105818 98LIBS={- join(" ", map { lib($_) } @{$unified_info{libraries}}) -}
f5c174ff 99SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{libraries}}) -}
0f01b7bc 100SHLIB_INFO={- join(" ", map { "\"".shlib($_).";".shlib_simple($_)."\"" } @{$unified_info{libraries}}) -}
f5c174ff 101ENGINES={- join(" ", map { dso($_) } @{$unified_info{engines}}) -}
1e3d16b0 102PROGRAMS={- join(" ", map { $_.$exeext } @{$unified_info{programs}}) -}
567a9e6f 103SCRIPTS={- join(" ", @{$unified_info{scripts}}) -}
29eed3dd 104{- output_off() if $disabled{makedepend}; "" -}
834aae2a 105DEPS={- join(" ", map { (my $x = $_) =~ s|\.o$|$depext|; $x; }
c058fcd7
RL
106 grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
107 keys %{$unified_info{sources}}); -}
29eed3dd 108{- output_on() if $disabled{makedepend}; "" -}
8258975c
RL
109GENERATED_MANDATORY={- join(" ", @{$unified_info{depends}->{""}}) -}
110GENERATED={- # common0.tmpl provides @generated
111 join(" ", @generated ) -}
c058fcd7 112
33105818 113INSTALL_LIBS={- join(" ", map { lib($_) } @{$unified_info{install}->{libraries}}) -}
0f01b7bc
RL
114INSTALL_SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{install}->{libraries}}) -}
115INSTALL_SHLIB_INFO={- join(" ", map { "\"".shlib($_).";".shlib_simple($_)."\"" } @{$unified_info{install}->{libraries}}) -}
116INSTALL_ENGINES={- join(" ", map { dso($_) } @{$unified_info{install}->{engines}}) -}
117INSTALL_PROGRAMS={- join(" ", map { $_.$exeext } @{$unified_info{install}->{programs}}) -}
df653379 118{- output_off() if $disabled{apps}; "" -}
567a9e6f 119BIN_SCRIPTS=$(BLDDIR)/tools/c_rehash
b8a9af68 120MISC_SCRIPTS=$(BLDDIR)/apps/CA.pl $(BLDDIR)/apps/tsget
df653379 121{- output_on() if $disabled{apps}; "" -}
567a9e6f 122
6a74806e
RL
123APPS_OPENSSL={- use File::Spec::Functions;
124 catfile("apps","openssl") -}
125
3c65577f
RL
126# DESTDIR is for package builders so that they can configure for, say,
127# /usr/ and yet have everything installed to /tmp/somedir/usr/.
567a9e6f 128# Normally it is left empty.
3c65577f 129DESTDIR=
567a9e6f
RL
130
131# Do not edit these manually. Use Configure with --prefix or --openssldir
132# to change this! Short explanation in the top comment in Configure
133INSTALLTOP={- # $prefix is used in the OPENSSLDIR perl snippet
134 #
135 our $prefix = $config{prefix} || "/usr/local";
136 $prefix -}
137OPENSSLDIR={- #
138 # The logic here is that if no --openssldir was given,
139 # OPENSSLDIR will get the value from $prefix plus "/ssl".
140 # If --openssldir was given and the value is an absolute
141 # path, OPENSSLDIR will get its value without change.
142 # If the value from --openssldir is a relative path,
143 # OPENSSLDIR will get $prefix with the --openssldir
144 # value appended as a subdirectory.
145 #
146 use File::Spec::Functions;
147 our $openssldir =
148 $config{openssldir} ?
149 (file_name_is_absolute($config{openssldir}) ?
150 $config{openssldir}
151 : catdir($prefix, $config{openssldir}))
152 : catdir($prefix, "ssl");
153 $openssldir -}
e454f3ad
RL
154LIBDIR={- our $libdir = $config{libdir};
155 unless ($libdir) {
156 #
157 # if $prefix/lib$target{multilib} is not an existing
158 # directory, then assume that it's not searched by linker
159 # automatically, in which case adding $target{multilib} suffix
160 # causes more grief than we're ready to tolerate, so don't...
161 our $multilib =
162 -d "$prefix/lib$target{multilib}" ? $target{multilib} : "";
163 $libdir = "lib$multilib";
164 }
165 file_name_is_absolute($libdir) ? "" : $libdir -}
166# $(libdir) is chosen to be compatible with the GNU coding standards
167libdir={- file_name_is_absolute($libdir)
168 ? $libdir : '$(INSTALLTOP)/$(LIBDIR)' -}
169ENGINESDIR=$(libdir)/engines-{- $sover_dirname -}
567a9e6f 170
fad599f7
RL
171# Convenience variable for those who want to set the rpath in shared
172# libraries and applications
e454f3ad 173LIBRPATH=$(libdir)
fad599f7 174
dde10ab4 175MANDIR=$(INSTALLTOP)/share/man
8be7bdb5
RL
176DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME)
177HTMLDIR=$(DOCDIR)/html
567a9e6f 178
3544091a
RL
179# MANSUFFIX is for the benefit of anyone who may want to have a suffix
180# appended after the manpage file section number. "ssl" is popular,
181# resulting in files such as config.5ssl rather than config.5.
182MANSUFFIX=
567a9e6f
RL
183HTMLSUFFIX=html
184
5407338a
RS
185# For "optional" echo messages, to get "real" silence
186ECHO = echo
567a9e6f 187
abe256e7
RL
188##### User defined commands and flags ################################
189
190# We let the C compiler driver to take care of .s files. This is done in
191# order to be excused from maintaining a separate set of architecture
192# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
193# gcc, then the driver will automatically translate it to -xarch=v8plus
194# and pass it down to assembler. In any case, we do not define AS or
195# ASFLAGS for this reason.
196
197CROSS_COMPILE={- $config{CROSS_COMPILE} -}
198CC=$(CROSS_COMPILE){- $config{CC} -}
199CXX={- $config{CXX} ? "\$(CROSS_COMPILE)$config{CXX}" : '' -}
200CPPFLAGS={- our $cppflags1 = join(" ",
201 (map { "-D".$_} @{$config{CPPDEFINES}}),
202 (map { "-I".$_} @{$config{CPPINCLUDES}}),
203 @{$config{CPPFLAGS}}) -}
204CFLAGS={- join(' ', @{$config{CFLAGS}}) -}
205CXXFLAGS={- join(' ', @{$config{CXXFLAGS}}) -}
206LDFLAGS= {- join(' ', @{$config{LDFLAGS}}) -}
207EX_LIBS= {- join(' ', @{$config{LDLIBS}}) -}
208
209MAKEDEPEND={- $config{makedepprog} -}
567a9e6f
RL
210
211PERL={- $config{perl} -}
212
abe256e7
RL
213AR=$(CROSS_COMPILE){- $config{AR} -}
214ARFLAGS= {- join(' ', @{$config{ARFLAGS}}) -}
215RANLIB={- $config{RANLIB} ? "\$(CROSS_COMPILE)$config{RANLIB}" : "true"; -}
216RC= $(CROSS_COMPILE){- $config{RC} -}
217RCFLAGS={- join(' ', @{$config{RCFLAGS}}) -} {- $target{shared_rcflag} -}
218
567a9e6f 219RM= rm -f
98e5534e 220RMDIR= rmdir
abe256e7
RL
221TAR= {- $target{TAR} || "tar" -}
222TARFLAGS= {- $target{TARFLAGS} -}
567a9e6f
RL
223
224BASENAME= openssl
225NAME= $(BASENAME)-$(VERSION)
226TARFILE= ../$(NAME).tar
227
abe256e7
RL
228##### Project flags ##################################################
229
230# Variables starting with CNF_ are common variables for all product types
231
232CNF_CPPFLAGS={- our $cppflags2 =
233 join(' ', $target{cppflags} || (),
234 (map { "-D".$_} @{$target{defines}},
235 @{$config{defines}}),
236 (map { "-I".$_} @{$target{includes}},
237 @{$config{includes}}),
238 @{$config{cppflags}}) -}
239CNF_CFLAGS={- join(' ', $target{cflags} || (),
240 @{$config{cflags}}) -}
241CNF_CXXFLAGS={- join(' ', $target{cxxflags} || (),
242 @{$config{cxxflags}}) -}
243CNF_LDFLAGS={- join(' ', $target{lflags} || (),
244 @{$config{lflags}}) -}
245CNF_EX_LIBS={- join(' ', $target{ex_libs} || (),
246 @{$config{ex_libs}}) -}
247
248# Variables starting with LIB_ are used to build library object files
249# and shared libraries.
250# Variables starting with DSO_ are used to build DSOs and their object files.
251# Variables starting with BIN_ are used to build programs and their object
252# files.
253
58d6be5b
RL
254LIB_CPPFLAGS={- our $lib_cppflags =
255 join(' ', $target{lib_cppflags} || (),
abe256e7
RL
256 $target{shared_cppflag} || (),
257 (map { '-D'.$_ }
258 @{$config{lib_defines}},
58d6be5b
RL
259 @{$config{shared_defines}}),
260 @{$config{lib_cppflags}},
261 @{$config{shared_cppflag}});
262 join(' ', $lib_cppflags,
263 (map { '-D'.$_ }
abe256e7
RL
264 'OPENSSLDIR="\"$(OPENSSLDIR)\""',
265 'ENGINESDIR="\"$(ENGINESDIR)\""'),
abe256e7
RL
266 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
267LIB_CFLAGS={- join(' ', $target{lib_cflags} || (),
268 $target{shared_cflag} || (),
269 @{$config{lib_cflags}},
270 @{$config{shared_cflag}},
271 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
272LIB_CXXFLAGS={- join(' ', $target{lib_cxxflags} || (),
273 $target{shared_cxxflag} || (),
274 @{$config{lib_cxxflags}},
275 @{$config{shared_cxxflag}},
276 '$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -}
277LIB_LDFLAGS={- join(' ', $target{shared_ldflag} || (),
278 $config{shared_ldflag} || (),
279 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
280LIB_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
281DSO_CPPFLAGS={- join(' ', $target{dso_cppflags} || (),
282 $target{module_cppflags} || (),
283 @{$config{dso_cppflags}},
284 @{$config{module_cppflags}},
285 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
286DSO_CFLAGS={- join(' ', $target{dso_cflags} || (),
287 $target{module_cflags} || (),
288 @{$config{dso_cflags}},
289 @{$config{module_cflags}},
290 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
291DSO_CXXFLAGS={- join(' ', $target{dso_cxxflags} || (),
292 $target{module_cxxflags} || (),
293 @{$config{dso_cxxflags}},
294 @{$config{module_cxxflag}},
295 '$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -}
296DSO_LDFLAGS={- join(' ', $target{dso_ldflags} || (),
297 $target{module_ldflags} || (),
298 @{$config{dso_ldflags}},
299 @{$config{module_ldflags}},
300 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
301DSO_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
302BIN_CPPFLAGS={- join(' ', $target{bin_cppflags} || (),
303 @{$config{bin_cppflags}},
304 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
305BIN_CFLAGS={- join(' ', $target{bin_cflags} || (),
306 @{$config{bin_cflags}},
307 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
308BIN_CXXFLAGS={- join(' ', $target{bin_cxxflags} || (),
309 @{$config{bin_cxxflags}},
310 '$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -}
311BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (),
312 @{$config{bin_lflags}},
313 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
314BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
315
316# CPPFLAGS_Q is used for one thing only: to build up buildinf.h
317CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g;
318 $cppflags2 =~ s|([\\"])|\\$1|g;
58d6be5b
RL
319 $lib_cppflags =~ s|([\\"])|\\$1|g;
320 join(' ', $lib_cppflags || (), $cppflags2 || (),
321 $cppflags1 || ()) -}
abe256e7 322
567a9e6f
RL
323PERLASM_SCHEME= {- $target{perlasm_scheme} -}
324
325# For x86 assembler: Set PROCESSOR to 386 if you want to support
326# the 80386.
327PROCESSOR= {- $config{processor} -}
328
9c7ce40b
AP
329# We want error [and other] messages in English. Trouble is that make(1)
330# doesn't pass macros down as environment variables unless there already
331# was corresponding variable originally set. In other words we can only
332# reassign environment variables, but not set new ones, not in portable
333# manner that is. That's why we reassign several, just to be sure...
334LC_ALL=C
335LC_MESSAGES=C
336LANG=C
337
567a9e6f
RL
338# The main targets ###################################################
339
1e3d16b0 340{- dependmagic('all'); -}: build_libs_nodep build_engines_nodep build_programs_nodep link-utils
27c40a93
BL
341{- dependmagic('build_libs'); -}: build_libs_nodep
342{- dependmagic('build_engines'); -}: build_engines_nodep
1e3d16b0 343{- dependmagic('build_programs'); -}: build_programs_nodep
567a9e6f 344
27c40a93 345build_generated: $(GENERATED_MANDATORY)
c058fcd7 346build_libs_nodep: libcrypto.pc libssl.pc openssl.pc
c058fcd7 347build_engines_nodep: $(ENGINES)
1e3d16b0
RL
348build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
349
350# Kept around for backward compatibility
351build_apps build_tests: build_programs
68a5f1a2 352
9b03b91b
RL
353# Convenience target to prebuild all generated files, not just the mandatory
354# ones
355build_all_generated: $(GENERATED_MANDATORY) $(GENERATED)
18d15882
AP
356 @ : {- output_off() if $disabled{makedepend}; "" -}
357 @echo "Warning: consider configuring with no-makedepend, because if"
358 @echo " target system doesn't have $(PERL),"
359 @echo " then make will fail..."
360 @ : {- output_on() if $disabled{makedepend}; "" -}
9b03b91b 361
1b741653 362test: tests
1e3d16b0 363{- dependmagic('tests'); -}: build_programs_nodep build_engines_nodep link-utils
d90a6beb 364 @ : {- output_off() if $disabled{tests}; "" -}
567a9e6f 365 ( cd test; \
41f571e1 366 mkdir -p test-runs; \
567a9e6f
RL
367 SRCTOP=../$(SRCDIR) \
368 BLDTOP=../$(BLDDIR) \
41f571e1 369 RESULT_D=test-runs \
cbece220 370 PERL="$(PERL)" \
834aae2a 371 EXE_EXT={- $exeext -} \
06444da4 372 OPENSSL_ENGINES=`cd ../$(BLDDIR)/engines 2>/dev/null && pwd` \
6d4bc8a3 373 OPENSSL_DEBUG_MEMORY=on \
567a9e6f 374 $(PERL) ../$(SRCDIR)/test/run_tests.pl $(TESTS) )
d90a6beb
MC
375 @ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
376 @echo "Tests are not supported with your chosen Configure options"
377 @ : {- output_on() if !$disabled{tests}; "" -}
567a9e6f
RL
378
379list-tests:
4813ad2d
RL
380 @ : {- output_off() if $disabled{tests}; "" -}
381 @SRCTOP="$(SRCDIR)" \
382 $(PERL) $(SRCDIR)/test/run_tests.pl list
383 @ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
384 @echo "Tests are not supported with your chosen Configure options"
385 @ : {- output_on() if !$disabled{tests}; "" -}
386
387install: install_sw install_ssldirs install_docs
388
389uninstall: uninstall_docs uninstall_sw
567a9e6f
RL
390
391libclean:
f99f91f1 392 @set -e; for s in $(SHLIB_INFO); do \
49bb4dd0 393 if [ "$$s" = ";" ]; then continue; fi; \
f99f91f1
RL
394 s1=`echo "$$s" | cut -f1 -d";"`; \
395 s2=`echo "$$s" | cut -f2 -d";"`; \
49bb4dd0
BE
396 $(ECHO) $(RM) $$s1; {- output_off() unless windowsdll(); "" -}\
397 $(RM) apps/$$s1; \
398 $(RM) test/$$s1; \
399 $(RM) fuzz/$$s1; {- output_on() unless windowsdll(); "" -}\
f99f91f1
RL
400 $(RM) $$s1; \
401 if [ "$$s1" != "$$s2" ]; then \
5407338a 402 $(ECHO) $(RM) $$s2; \
f99f91f1
RL
403 $(RM) $$s2; \
404 fi; \
405 done
406 $(RM) $(LIBS)
4813ad2d 407 $(RM) *.map
567a9e6f
RL
408
409clean: libclean
4813ad2d 410 $(RM) $(PROGRAMS) $(TESTPROGS) $(ENGINES) $(SCRIPTS)
b0a97931 411 $(RM) $(GENERATED_MANDATORY) $(GENERATED)
4813ad2d
RL
412 -$(RM) `find . -name '*{- $depext -}' -a \! -path "./.git/*"`
413 -$(RM) `find . -name '*{- $objext -}' -a \! -path "./.git/*"`
414 $(RM) core
9e183d22 415 $(RM) tags TAGS doc-nits
d016d1ec 416 $(RM) -r test/test-runs
4813ad2d
RL
417 $(RM) openssl.pc libcrypto.pc libssl.pc
418 -$(RM) `find . -type l -a \! -path "./.git/*"`
419 $(RM) $(TARFILE)
567a9e6f 420
7cae3864 421distclean: clean
4813ad2d
RL
422 $(RM) configdata.pm
423 $(RM) Makefile
7cae3864 424
f8d9d6e4 425# We check if any depfile is newer than Makefile and decide to
a6adf099 426# concatenate only if that is true.
ea80a25e 427depend:
29eed3dd 428 @: {- output_off() if $disabled{makedepend}; "" -}
c39785d4
RL
429 @$(PERL) $(SRCDIR)/util/add-depends.pl {-
430 defined $makedepprog && $makedepprog =~ /\/makedepend/
431 ? 'makedepend' : 'gcc' -}
29eed3dd 432 @: {- output_on() if $disabled{makedepend}; "" -}
567a9e6f
RL
433
434# Install helper targets #############################################
435
436install_sw: all install_dev install_engines install_runtime
437
f99f91f1 438uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
567a9e6f
RL
439
440install_docs: install_man_docs install_html_docs
441
442uninstall_docs: uninstall_man_docs uninstall_html_docs
8be7bdb5 443 $(RM) -r -v $(DESTDIR)$(DOCDIR)
567a9e6f 444
dde10ab4
RL
445install_ssldirs:
446 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/certs
447 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/private
66c2eb8b 448 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/misc
4813ad2d
RL
449 @set -e; for x in dummy $(MISC_SCRIPTS); do \
450 if [ "$$x" = "dummy" ]; then continue; fi; \
451 fn=`basename $$x`; \
5407338a 452 $(ECHO) "install $$x -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
4813ad2d
RL
453 cp $$x $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
454 chmod 755 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
455 mv -f $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new \
456 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
457 done
5407338a 458 @$(ECHO) "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist"
4813ad2d
RL
459 @cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
460 @chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
cb926df2 461 @mv -f $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist
c7af65c7 462 @if [ ! -f "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf" ]; then \
5407338a 463 $(ECHO) "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf"; \
cb926df2
RL
464 cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf; \
465 chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf; \
466 fi
5407338a 467 @$(ECHO) "install $(SRCDIR)/apps/ct_log_list.cnf -> $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist"
c7af65c7
RS
468 @cp $(SRCDIR)/apps/ct_log_list.cnf $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new
469 @chmod 644 $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new
470 @mv -f $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist
471 @if [ ! -f "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf" ]; then \
5407338a 472 $(ECHO) "install $(SRCDIR)/apps/ct_log_list.cnf -> $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf"; \
c7af65c7
RS
473 cp $(SRCDIR)/apps/ct_log_list.cnf $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \
474 chmod 644 $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \
475 fi
dde10ab4 476
567a9e6f
RL
477install_dev:
478 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
5407338a 479 @$(ECHO) "*** Installing development files"
3c65577f 480 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/include/openssl
24c4f736 481 @ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -}
5407338a 482 @$(ECHO) "install $(SRCDIR)/ms/applink.c -> $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
24c4f736
RL
483 @cp $(SRCDIR)/ms/applink.c $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
484 @chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
485 @ : {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -}
567a9e6f
RL
486 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
487 $(BLDDIR)/include/openssl/*.h; do \
488 fn=`basename $$i`; \
5407338a 489 $(ECHO) "install $$i -> $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
3c65577f
RL
490 cp $$i $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
491 chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
567a9e6f 492 done
e454f3ad 493 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)
0f01b7bc 494 @set -e; for l in $(INSTALL_LIBS); do \
567a9e6f 495 fn=`basename $$l`; \
e454f3ad
RL
496 $(ECHO) "install $$l -> $(DESTDIR)$(libdir)/$$fn"; \
497 cp $$l $(DESTDIR)$(libdir)/$$fn.new; \
498 $(RANLIB) $(DESTDIR)$(libdir)/$$fn.new; \
499 chmod 644 $(DESTDIR)$(libdir)/$$fn.new; \
500 mv -f $(DESTDIR)$(libdir)/$$fn.new \
501 $(DESTDIR)$(libdir)/$$fn; \
567a9e6f 502 done
84af1bae 503 @ : {- output_off() if $disabled{shared}; "" -}
0f01b7bc 504 @set -e; for s in $(INSTALL_SHLIB_INFO); do \
c8c2b779
RL
505 s1=`echo "$$s" | cut -f1 -d";"`; \
506 s2=`echo "$$s" | cut -f2 -d";"`; \
507 fn1=`basename $$s1`; \
508 fn2=`basename $$s2`; \
509 : {- output_off() if windowsdll(); "" -}; \
e454f3ad
RL
510 $(ECHO) "install $$s1 -> $(DESTDIR)$(libdir)/$$fn1"; \
511 cp $$s1 $(DESTDIR)$(libdir)/$$fn1.new; \
512 chmod 755 $(DESTDIR)$(libdir)/$$fn1.new; \
513 mv -f $(DESTDIR)$(libdir)/$$fn1.new \
514 $(DESTDIR)$(libdir)/$$fn1; \
c8c2b779 515 if [ "$$fn1" != "$$fn2" ]; then \
e454f3ad
RL
516 $(ECHO) "link $(DESTDIR)$(libdir)/$$fn2 -> $(DESTDIR)$(libdir)/$$fn1"; \
517 ln -sf $$fn1 $(DESTDIR)$(libdir)/$$fn2; \
567a9e6f 518 fi; \
c8c2b779 519 : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
e454f3ad
RL
520 $(ECHO) "install $$s2 -> $(DESTDIR)$(libdir)/$$fn2"; \
521 cp $$s2 $(DESTDIR)$(libdir)/$$fn2.new; \
522 chmod 755 $(DESTDIR)$(libdir)/$$fn2.new; \
523 mv -f $(DESTDIR)$(libdir)/$$fn2.new \
524 $(DESTDIR)$(libdir)/$$fn2; \
ce5ed82f 525 : {- output_on() unless windowsdll(); "" -}; \
567a9e6f 526 done
84af1bae 527 @ : {- output_on() if $disabled{shared}; "" -}
e454f3ad
RL
528 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)/pkgconfig
529 @$(ECHO) "install libcrypto.pc -> $(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc"
530 @cp libcrypto.pc $(DESTDIR)$(libdir)/pkgconfig
531 @chmod 644 $(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc
532 @$(ECHO) "install libssl.pc -> $(DESTDIR)$(libdir)/pkgconfig/libssl.pc"
533 @cp libssl.pc $(DESTDIR)$(libdir)/pkgconfig
534 @chmod 644 $(DESTDIR)$(libdir)/pkgconfig/libssl.pc
535 @$(ECHO) "install openssl.pc -> $(DESTDIR)$(libdir)/pkgconfig/openssl.pc"
536 @cp openssl.pc $(DESTDIR)$(libdir)/pkgconfig
537 @chmod 644 $(DESTDIR)$(libdir)/pkgconfig/openssl.pc
567a9e6f
RL
538
539uninstall_dev:
5407338a 540 @$(ECHO) "*** Uninstalling development files"
24c4f736 541 @ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -}
5407338a 542 @$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
24c4f736
RL
543 @$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
544 @ : {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -}
567a9e6f
RL
545 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
546 $(BLDDIR)/include/openssl/*.h; do \
547 fn=`basename $$i`; \
5407338a 548 $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
3c65577f 549 $(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
567a9e6f 550 done
98e5534e
RL
551 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include/openssl
552 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include
0f01b7bc 553 @set -e; for l in $(INSTALL_LIBS); do \
567a9e6f 554 fn=`basename $$l`; \
e454f3ad
RL
555 $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn"; \
556 $(RM) $(DESTDIR)$(libdir)/$$fn; \
567a9e6f 557 done
84af1bae 558 @ : {- output_off() if $disabled{shared}; "" -}
0f01b7bc 559 @set -e; for s in $(INSTALL_SHLIB_INFO); do \
c8c2b779
RL
560 s1=`echo "$$s" | cut -f1 -d";"`; \
561 s2=`echo "$$s" | cut -f2 -d";"`; \
562 fn1=`basename $$s1`; \
563 fn2=`basename $$s2`; \
564 : {- output_off() if windowsdll(); "" -}; \
e454f3ad
RL
565 $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn1"; \
566 $(RM) $(DESTDIR)$(libdir)/$$fn1; \
c8c2b779 567 if [ "$$fn1" != "$$fn2" ]; then \
e454f3ad
RL
568 $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn2"; \
569 $(RM) $(DESTDIR)$(libdir)/$$fn2; \
567a9e6f 570 fi; \
c8c2b779 571 : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
e454f3ad
RL
572 $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn2"; \
573 $(RM) $(DESTDIR)$(libdir)/$$fn2; \
ce5ed82f 574 : {- output_on() unless windowsdll(); "" -}; \
567a9e6f 575 done
c8cca980 576 @ : {- output_on() if $disabled{shared}; "" -}
e454f3ad
RL
577 $(RM) $(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc
578 $(RM) $(DESTDIR)$(libdir)/pkgconfig/libssl.pc
579 $(RM) $(DESTDIR)$(libdir)/pkgconfig/openssl.pc
580 -$(RMDIR) $(DESTDIR)$(libdir)/pkgconfig
581 -$(RMDIR) $(DESTDIR)$(libdir)
567a9e6f
RL
582
583install_engines:
584 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
b2de11c5 585 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(ENGINESDIR)/
5407338a 586 @$(ECHO) "*** Installing engines"
0f01b7bc 587 @set -e; for e in dummy $(INSTALL_ENGINES); do \
2b364f61 588 if [ "$$e" = "dummy" ]; then continue; fi; \
567a9e6f 589 fn=`basename $$e`; \
5407338a 590 $(ECHO) "install $$e -> $(DESTDIR)$(ENGINESDIR)/$$fn"; \
b2de11c5
RL
591 cp $$e $(DESTDIR)$(ENGINESDIR)/$$fn.new; \
592 chmod 755 $(DESTDIR)$(ENGINESDIR)/$$fn.new; \
593 mv -f $(DESTDIR)$(ENGINESDIR)/$$fn.new \
594 $(DESTDIR)$(ENGINESDIR)/$$fn; \
567a9e6f
RL
595 done
596
597uninstall_engines:
5407338a 598 @$(ECHO) "*** Uninstalling engines"
0f01b7bc 599 @set -e; for e in dummy $(INSTALL_ENGINES); do \
2b364f61 600 if [ "$$e" = "dummy" ]; then continue; fi; \
567a9e6f 601 fn=`basename $$e`; \
f0c93a85
RL
602 if [ "$$fn" = '{- dso("ossltest") -}' ]; then \
603 continue; \
604 fi; \
5407338a 605 $(ECHO) "$(RM) $(DESTDIR)$(ENGINESDIR)/$$fn"; \
b2de11c5 606 $(RM) $(DESTDIR)$(ENGINESDIR)/$$fn; \
567a9e6f 607 done
b2de11c5 608 -$(RMDIR) $(DESTDIR)$(ENGINESDIR)
567a9e6f
RL
609
610install_runtime:
611 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
3c65577f 612 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
36b53720 613 @ : {- output_off() if windowsdll(); "" -}
e454f3ad 614 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)
36b53720 615 @ : {- output_on() if windowsdll(); "" -}
5407338a 616 @$(ECHO) "*** Installing runtime files"
0f01b7bc 617 @set -e; for s in dummy $(INSTALL_SHLIBS); do \
2b364f61 618 if [ "$$s" = "dummy" ]; then continue; fi; \
f99f91f1 619 fn=`basename $$s`; \
36b53720 620 : {- output_off() unless windowsdll(); "" -}; \
5407338a 621 $(ECHO) "install $$s -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
3c65577f
RL
622 cp $$s $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
623 chmod 644 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
624 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
625 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
36b53720 626 : {- output_on() unless windowsdll(); "" -}{- output_off() if windowsdll(); "" -}; \
e454f3ad
RL
627 $(ECHO) "install $$s -> $(DESTDIR)$(libdir)/$$fn"; \
628 cp $$s $(DESTDIR)$(libdir)/$$fn.new; \
629 chmod 755 $(DESTDIR)$(libdir)/$$fn.new; \
630 mv -f $(DESTDIR)$(libdir)/$$fn.new \
631 $(DESTDIR)$(libdir)/$$fn; \
36b53720 632 : {- output_on() if windowsdll(); "" -}; \
fcf80c46 633 done
0f01b7bc 634 @set -e; for x in dummy $(INSTALL_PROGRAMS); do \
2b364f61 635 if [ "$$x" = "dummy" ]; then continue; fi; \
567a9e6f 636 fn=`basename $$x`; \
5407338a 637 $(ECHO) "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
3c65577f
RL
638 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
639 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
640 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
641 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
567a9e6f 642 done
2b364f61
RL
643 @set -e; for x in dummy $(BIN_SCRIPTS); do \
644 if [ "$$x" = "dummy" ]; then continue; fi; \
567a9e6f 645 fn=`basename $$x`; \
5407338a 646 $(ECHO) "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
3c65577f
RL
647 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
648 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
649 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
650 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
567a9e6f 651 done
567a9e6f
RL
652
653uninstall_runtime:
5407338a 654 @$(ECHO) "*** Uninstalling runtime files"
0f01b7bc 655 @set -e; for x in dummy $(INSTALL_PROGRAMS); \
567a9e6f 656 do \
2b364f61 657 if [ "$$x" = "dummy" ]; then continue; fi; \
567a9e6f 658 fn=`basename $$x`; \
5407338a 659 $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
3c65577f 660 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
567a9e6f 661 done;
2b364f61 662 @set -e; for x in dummy $(BIN_SCRIPTS); \
567a9e6f 663 do \
2b364f61 664 if [ "$$x" = "dummy" ]; then continue; fi; \
567a9e6f 665 fn=`basename $$x`; \
5407338a 666 $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
3c65577f 667 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
567a9e6f 668 done
b1837abd 669 @ : {- output_off() unless windowsdll(); "" -}
0f01b7bc 670 @set -e; for s in dummy $(INSTALL_SHLIBS); do \
2b364f61 671 if [ "$$s" = "dummy" ]; then continue; fi; \
f99f91f1 672 fn=`basename $$s`; \
5407338a 673 $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
3c65577f 674 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
fcf80c46 675 done
b1837abd 676 @ : {- output_on() unless windowsdll(); "" -}
b894054e 677 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
567a9e6f 678
567a9e6f
RL
679
680install_man_docs:
681 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
5407338a 682 @$(ECHO) "*** Installing manpages"
cadb015b
RL
683 $(PERL) $(SRCDIR)/util/process_docs.pl \
684 --destdir=$(DESTDIR)$(MANDIR) --type=man --suffix=$(MANSUFFIX)
567a9e6f
RL
685
686uninstall_man_docs:
5407338a 687 @$(ECHO) "*** Uninstalling manpages"
cadb015b
RL
688 $(PERL) $(SRCDIR)/util/process_docs.pl \
689 --destdir=$(DESTDIR)$(MANDIR) --type=man --suffix=$(MANSUFFIX) \
690 --remove
567a9e6f
RL
691
692install_html_docs:
693 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
5407338a 694 @$(ECHO) "*** Installing HTML manpages"
cadb015b
RL
695 $(PERL) $(SRCDIR)/util/process_docs.pl \
696 --destdir=$(DESTDIR)$(HTMLDIR) --type=html
567a9e6f
RL
697
698uninstall_html_docs:
5407338a 699 @$(ECHO) "*** Uninstalling manpages"
cadb015b
RL
700 $(PERL) $(SRCDIR)/util/process_docs.pl \
701 --destdir=$(DESTDIR)$(HTMLDIR) --type=html --remove
567a9e6f
RL
702
703
704# Developer targets (note: these are only available on Unix) #########
705
6bb2106e
RL
706update: generate errors ordinals
707
b7650c67 708generate: generate_apps generate_crypto_bn generate_crypto_objects \
8e32e1ab 709 generate_crypto_conf generate_crypto_asn1 generate_fuzz_oids
567a9e6f 710
65c1f979 711doc-nits:
1722496f 712 (cd $(SRCDIR); $(PERL) util/find-doc-nits -n -p ) >doc-nits
9e183d22 713 if [ -s doc-nits ] ; then cat doc-nits; rm doc-nits ; exit 1; fi
65c1f979 714
567a9e6f
RL
715# Test coverage is a good idea for the future
716#coverage: $(PROGRAMS) $(TESTPROGRAMS)
717# ...
718
567a9e6f
RL
719lint:
720 lint -DLINT $(INCLUDES) $(SRCS)
721
9a9f8ee7
RL
722generate_apps:
723 ( cd $(SRCDIR); $(PERL) VMS/VMSify-conf.pl \
724 < apps/openssl.cnf > apps/openssl-vms.cnf )
9a9f8ee7
RL
725
726generate_crypto_bn:
727 ( cd $(SRCDIR); $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h )
728
729generate_crypto_objects:
22defb43
RS
730 ( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl -n \
731 crypto/objects/objects.txt \
732 crypto/objects/obj_mac.num \
733 > crypto/objects/obj_mac.new && \
734 mv crypto/objects/obj_mac.new crypto/objects/obj_mac.num )
9a9f8ee7
RL
735 ( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl \
736 crypto/objects/objects.txt \
737 crypto/objects/obj_mac.num \
22defb43 738 > include/openssl/obj_mac.h )
e6f2bb66
KM
739 ( cd $(SRCDIR); $(PERL) crypto/objects/obj_dat.pl \
740 include/openssl/obj_mac.h \
22defb43 741 > crypto/objects/obj_dat.h )
9a9f8ee7
RL
742 ( cd $(SRCDIR); $(PERL) crypto/objects/objxref.pl \
743 crypto/objects/obj_mac.num \
744 crypto/objects/obj_xref.txt \
745 > crypto/objects/obj_xref.h )
6bb2106e 746
b7650c67
RL
747generate_crypto_conf:
748 ( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \
749 > crypto/conf/conf_def.h )
750
751generate_crypto_asn1:
752 ( cd $(SRCDIR); $(PERL) crypto/asn1/charmap.pl \
753 > crypto/asn1/charmap.h )
754
8e32e1ab
RL
755generate_fuzz_oids:
756 ( cd $(SRCDIR); $(PERL) fuzz/mkfuzzoids.pl \
757 crypto/objects/obj_dat.h \
758 > fuzz/oids.txt )
759
52df25cf
RS
760# Set to -force to force a rebuild
761ERROR_REBUILD=
567a9e6f 762errors:
aa6cc8d3
RL
763 ( b=`pwd`; set -e; cd $(SRCDIR); \
764 $(PERL) util/ck_errf.pl -strict -internal; \
cb7b7275 765 $(PERL) -I$$b util/mkerr.pl $(ERROR_REBUILD) -internal )
aa6cc8d3 766 ( b=`pwd`; set -e; cd $(SRCDIR)/engines; \
52df25cf 767 for E in *.ec ; do \
aa6cc8d3
RL
768 $(PERL) ../util/ck_errf.pl -strict \
769 -conf $$E `basename $$E .ec`.c; \
cb7b7275 770 $(PERL) -I$$b ../util/mkerr.pl $(ERROR_REBUILD) -static \
52df25cf
RS
771 -conf $$E `basename $$E .ec`.c ; \
772 done )
567a9e6f
RL
773
774ordinals:
775 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl crypto update )
776 ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl ssl update )
777
778test_ordinals:
779 ( cd test; \
780 SRCTOP=../$(SRCDIR) \
781 BLDTOP=../$(BLDDIR) \
782 $(PERL) ../$(SRCDIR)/test/run_tests.pl test_ordinals )
783
784tags TAGS: FORCE
785 rm -f TAGS tags
786 -ctags -R .
787 -etags `find . -name '*.[ch]' -o -name '*.pm'`
788
789# Release targets (note: only available on Unix) #####################
790
77a9c26e
RL
791# If your tar command doesn't support --owner and --group, make sure to
792# use one that does, for example GNU tar
9967a9ed 793TAR_COMMAND=$(TAR) $(TARFLAGS) --owner 0 --group 0 -cf -
54bb8f74 794PREPARE_CMD=:
567a9e6f 795tar:
34a5b7d7 796 set -e; \
567a9e6f 797 TMPDIR=/var/tmp/openssl-copy.$$$$; \
54bb8f74 798 DISTDIR=$(NAME); \
567a9e6f
RL
799 mkdir -p $$TMPDIR/$$DISTDIR; \
800 (cd $(SRCDIR); \
5b7b0115 801 excl_re=`git submodule status | sed -e 's/^.//' | cut -d' ' -f2`; \
918388b5 802 excl_re="^(fuzz/corpora|Configurations/.*\.norelease\.conf|`echo $$excl_re | sed -e 's/ /$$|/g'`\$$)"; \
5b7b0115 803 echo "$$excl_re"; \
567a9e6f 804 git ls-tree -r --name-only --full-tree HEAD \
17c84aa7 805 | egrep -v "$$excl_re" \
567a9e6f
RL
806 | while read F; do \
807 mkdir -p $$TMPDIR/$$DISTDIR/`dirname $$F`; \
808 cp $$F $$TMPDIR/$$DISTDIR/$$F; \
809 done); \
17c84aa7 810 (cd $$TMPDIR/$$DISTDIR; \
54bb8f74 811 $(PREPARE_CMD); \
17c84aa7
RL
812 find . -type d -print | xargs chmod 755; \
813 find . -type f -print | xargs chmod a+r; \
814 find . -type f -perm -0100 -print | xargs chmod a+x); \
815 (cd $$TMPDIR; $(TAR_COMMAND) $$DISTDIR) \
567a9e6f
RL
816 | (cd $(SRCDIR); gzip --best > $(TARFILE).gz); \
817 rm -rf $$TMPDIR
818 cd $(SRCDIR); ls -l $(TARFILE).gz
819
820dist:
bffa1ff8 821 @$(MAKE) PREPARE_CMD='$(PERL) ./Configure dist' TARFILE="$(TARFILE)" NAME="$(NAME)" tar
567a9e6f
RL
822
823# Helper targets #####################################################
824
342a1a23 825link-utils: $(BLDDIR)/util/opensslwrap.sh
567a9e6f 826
27f42b46 827$(BLDDIR)/util/opensslwrap.sh: configdata.pm
567a9e6f
RL
828 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
829 mkdir -p "$(BLDDIR)/util"; \
830 ln -sf "../$(SRCDIR)/util/opensslwrap.sh" "$(BLDDIR)/util"; \
831 fi
342a1a23 832
c058fcd7 833FORCE:
567a9e6f
RL
834
835# Building targets ###################################################
836
8478a703 837libcrypto.pc libssl.pc openssl.pc: configdata.pm $(LIBS) {- join(" ",map { shlib_simple($_) } @{$unified_info{libraries}}) -}
567a9e6f
RL
838libcrypto.pc:
839 @ ( echo 'prefix=$(INSTALLTOP)'; \
840 echo 'exec_prefix=$${prefix}'; \
e454f3ad
RL
841 if [ -n "$(LIBDIR)" ]; then \
842 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
843 else \
844 echo 'libdir=$(libdir)'; \
845 fi; \
567a9e6f 846 echo 'includedir=$${prefix}/include'; \
d4453024 847 echo 'enginesdir=$${libdir}/engines-{- $sover_dirname -}'; \
567a9e6f
RL
848 echo ''; \
849 echo 'Name: OpenSSL-libcrypto'; \
850 echo 'Description: OpenSSL cryptography library'; \
851 echo 'Version: '$(VERSION); \
852 echo 'Libs: -L$${libdir} -lcrypto'; \
abe256e7 853 echo 'Libs.private: $(LIB_EX_LIBS)'; \
567a9e6f
RL
854 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
855
856libssl.pc:
857 @ ( echo 'prefix=$(INSTALLTOP)'; \
858 echo 'exec_prefix=$${prefix}'; \
e454f3ad
RL
859 if [ -n "$(LIBDIR)" ]; then \
860 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
861 else \
862 echo 'libdir=$(libdir)'; \
863 fi; \
567a9e6f
RL
864 echo 'includedir=$${prefix}/include'; \
865 echo ''; \
866 echo 'Name: OpenSSL-libssl'; \
867 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
868 echo 'Version: '$(VERSION); \
869 echo 'Requires.private: libcrypto'; \
870 echo 'Libs: -L$${libdir} -lssl'; \
567a9e6f
RL
871 echo 'Cflags: -I$${includedir}' ) > libssl.pc
872
873openssl.pc:
874 @ ( echo 'prefix=$(INSTALLTOP)'; \
875 echo 'exec_prefix=$${prefix}'; \
e454f3ad
RL
876 if [ -n "$(LIBDIR)" ]; then \
877 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
878 else \
879 echo 'libdir=$(libdir)'; \
880 fi; \
567a9e6f
RL
881 echo 'includedir=$${prefix}/include'; \
882 echo ''; \
883 echo 'Name: OpenSSL'; \
884 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
885 echo 'Version: '$(VERSION); \
886 echo 'Requires: libssl libcrypto' ) > openssl.pc
887
41240e68 888configdata.pm: $(SRCDIR)/Configure $(SRCDIR)/config {- join(" ", @{$config{build_file_templates}}, @{$config{build_infos}}, @{$config{conf_files}}) -}
27f42b46 889 @echo "Detected changed: $?"
a1b6933e 890 $(PERL) configdata.pm -r
567a9e6f
RL
891 @echo "**************************************************"
892 @echo "*** ***"
893 @echo "*** Please run the same make command again ***"
894 @echo "*** ***"
895 @echo "**************************************************"
896 @false
897
bf01fbbf 898reconfigure reconf:
a1b6933e 899 $(PERL) configdata.pm -r
bf01fbbf 900
567a9e6f
RL
901{-
902 use File::Basename;
903 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
cedbb146
RL
904
905 # Helper function to figure out dependencies on libraries
906 # It takes a list of library names and outputs a list of dependencies
907 sub compute_lib_depends {
84af1bae 908 if ($disabled{shared}) {
33105818 909 return map { lib($_) } @_;
cedbb146
RL
910 }
911
912 # Depending on shared libraries:
913 # On Windows POSIX layers, we depend on {libname}.dll.a
914 # On Unix platforms, we depend on {shlibname}.so
186a31e5 915 return map { $_ =~ /\.a$/ ? $`.$libext : shlib_simple($_) } @_;
cedbb146
RL
916 }
917
66ddf178
RL
918 sub generatesrc {
919 my %args = @_;
920 my $generator = join(" ", @{$args{generator}});
8d34daf0 921 my $generator_incs = join("", map { " -I".$_ } @{$args{generator_incs}});
d4605727 922 my $incs = join("", map { " -I".$_ } @{$args{incs}});
8d34daf0 923 my $deps = join(" ", @{$args{generator_deps}}, @{$args{deps}});
66ddf178
RL
924
925 if ($args{src} !~ /\.[sS]$/) {
7cae3864
RL
926 if ($args{generator}->[0] =~ m|^.*\.in$|) {
927 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
928 "util", "dofile.pl")),
929 rel2abs($config{builddir}));
930 return <<"EOF";
931$args{src}: $args{generator}->[0] $deps
932 \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
933 "-o$target{build_file}" $generator > \$@
934EOF
935 } else {
936 return <<"EOF";
769777b0 937$args{src}: $args{generator}->[0] $deps
8d34daf0 938 \$(PERL)$generator_incs $generator > \$@
66ddf178 939EOF
7cae3864 940 }
66ddf178 941 } else {
8458f1bf 942 if ($args{generator}->[0] =~ /\.pl$/) {
8d34daf0 943 $generator = 'CC="$(CC)" $(PERL)'.$generator_incs.' '.$generator;
8458f1bf 944 } elsif ($args{generator}->[0] =~ /\.m4$/) {
8d34daf0 945 $generator = 'm4 -B 8192'.$generator_incs.' '.$generator.' >'
8458f1bf
RL
946 } elsif ($args{generator}->[0] =~ /\.S$/) {
947 $generator = undef;
948 } else {
949 die "Generator type for $args{src} unknown: $generator\n";
950 }
951
722c9762 952 my $cppflags = {
8bc0147f
RL
953 lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
954 dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
955 bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
722c9762 956 } -> {$args{intent}};
8458f1bf 957 if (defined($generator)) {
66ddf178 958 return <<"EOF";
769777b0 959$args{src}: $args{generator}->[0] $deps
8458f1bf 960 $generator \$@
66ddf178 961EOF
66ddf178 962 }
8458f1bf 963 return <<"EOF";
769777b0 964$args{src}: $args{generator}->[0] $deps
d3f9268a 965 \$(CC) $incs $cppflags -E $args{generator}->[0] | \\
39199fb3 966 \$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@
8458f1bf 967EOF
66ddf178
RL
968 }
969 }
970
bb26842d
RL
971 # Should one wonder about the end of the Perl snippet, it's because this
972 # second regexp eats up line endings as well, if the removed path is the
973 # last in the line. We may therefore need to put back a line ending.
88297284 974 sub src2obj {
567a9e6f 975 my %args = @_;
81183680 976 (my $obj = $args{obj}) =~ s|\.o$||;
a23f0316 977 my @srcs = @{$args{srcs}};
8458f1bf
RL
978 my $srcs = join(" ", @srcs);
979 my $deps = join(" ", @srcs, @{$args{deps}});
45502bfe 980 my $incs = join("", map { " -I".$_ } @{$args{incs}});
722c9762
RL
981 my $cmd;
982 my $cmdflags;
983 my $cmdcompile;
81183680
RL
984 if (grep /\.rc$/, @srcs) {
985 $cmd = '$(RC)';
986 $cmdflags = '$(RCFLAGS)';
8c3bc594 987 $cmdcompile = '';
81183680
RL
988 } elsif (grep /\.(cc|cpp)$/, @srcs) {
989 $cmd = '$(CXX)';
722c9762
RL
990 $cmdcompile = ' -c';
991 $cmdflags = {
992 lib => '$(LIB_CXXFLAGS) $(LIB_CPPFLAGS)',
993 dso => '$(DSO_CXXFLAGS) $(DSO_CPPFLAGS)',
994 bin => '$(BIN_CXXFLAGS) $(BIN_CPPFLAGS)'
995 } -> {$args{intent}};
7763472f 996 } else {
722c9762
RL
997 $cmd = '$(CC)';
998 $cmdcompile = ' -c';
999 $cmdflags = {
1000 lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
1001 dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
1002 bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
1003 } -> {$args{intent}};
7763472f 1004 }
a23f0316
AP
1005 my $recipe;
1006 # extension-specific rules
1007 if (grep /\.s$/, @srcs) {
1008 $recipe .= <<"EOF";
7e5b8b93 1009$obj$objext: $deps
a23f0316 1010 $cmd $cmdflags -c -o \$\@ $srcs
7e5b8b93 1011EOF
a23f0316 1012 } elsif (grep /\.S$/, @srcs) {
18d15882
AP
1013 # Originally there was mutli-step rule with $(CC) -E file.S
1014 # followed by $(CC) -c file.s. It compensated for one of
1015 # legacy platform compiler's inability to handle .S files.
1016 # The platform is long discontinued by vendor so there is
1017 # hardly a point to drag it along...
29eed3dd 1018 $recipe .= <<"EOF";
a23f0316 1019$obj$objext: $deps
18d15882 1020 $cmd $incs $cmdflags -c -o \$\@ $srcs
a23f0316 1021EOF
49bb4dd0
BE
1022 } elsif (defined $makedepprog && $makedepprog !~ /\/makedepend/
1023 && !grep /\.rc$/, @srcs) {
a23f0316
AP
1024 $recipe .= <<"EOF";
1025$obj$objext: $deps
81183680 1026 $cmd $incs $cmdflags -MMD -MF $obj$depext.tmp -MT \$\@ -c -o \$\@ $srcs
7e5b8b93
RL
1027 \@touch $obj$depext.tmp
1028 \@if cmp $obj$depext.tmp $obj$depext > /dev/null 2> /dev/null; then \\
1029 rm -f $obj$depext.tmp; \\
29b28eee 1030 else \\
7e5b8b93 1031 mv $obj$depext.tmp $obj$depext; \\
987dbc7f 1032 fi
29eed3dd 1033EOF
7e5b8b93 1034 } else {
29eed3dd 1035 $recipe .= <<"EOF";
a23f0316
AP
1036$obj$objext: $deps
1037 $cmd $incs $cmdflags $cmdcompile -o \$\@ $srcs
567a9e6f 1038EOF
81183680 1039 if (defined $makedepprog && $makedepprog =~ /\/makedepend/) {
7e5b8b93 1040 $recipe .= <<"EOF";
c39785d4
RL
1041 \$(MAKEDEPEND) -f- -Y -- $incs $cmdflags -- $srcs 2>/dev/null \\
1042 > $obj$depext
567a9e6f 1043EOF
7e5b8b93 1044 }
29eed3dd
RL
1045 }
1046 return $recipe;
567a9e6f
RL
1047 }
1048 # On Unix, we build shlibs from static libs, so we're ignoring the
1049 # object file array. We *know* this routine is only called when we've
1050 # configure 'shared'.
1051 sub libobj2shlib {
1052 my %args = @_;
1053 my $lib = $args{lib};
1054 my $shlib = $args{shlib};
1055 my $libd = dirname($lib);
1056 my $libn = basename($lib);
1057 (my $libname = $libn) =~ s/^lib//;
47eeaf45
RL
1058 my @linkdirs = ();
1059 foreach (@{args{deps}}) {
1060 my $d = dirname($_);
1061 push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
1062 }
1063 my $linkflags = join("", map { "-L$_ " } @linkdirs);
1064 my $linklibs = join("", map { my $f = basename($_);
cedbb146 1065 (my $l = $f) =~ s/^lib//;
47eeaf45 1066 " -l$l" } @{$args{deps}});
29f3cfdd
RL
1067 my @objs = map { (my $x = $_) =~ s|\.o$||; "$x$objext" }
1068 grep { $_ !~ m/\.(?:def|map)$/ }
81183680 1069 @{$args{objs}};
29f3cfdd 1070 my @defs = grep { $_ =~ /\.(?:def|map)$/ } @{$args{objs}};
81183680
RL
1071 my @deps = compute_lib_depends(@{$args{deps}});
1072 die "More than one exported symbol map" if scalar @defs > 1;
1073 my $objs = join(" ", @objs);
1074 my $deps = join(" ", @objs, @defs, @deps);
f5c174ff 1075 my $target = shlib_simple($lib);
d07abe13 1076 my $target_full = shlib($lib);
81183680
RL
1077 my $shared_soname = "";
1078 $shared_soname .= ' '.$target{shared_sonameflag}.basename($target_full)
1079 if defined $target{shared_sonameflag};
1080 my $shared_imp = "";
1081 $shared_imp .= ' '.$target{shared_impflag}.basename($target)
1082 if defined $target{shared_impflag};
1083 my $shared_def = join("", map { ' '.$target{shared_defflag}.$_ } @defs);
1084 my $recipe = <<"EOF";
1085# When building on a Windows POSIX layer (Cygwin or Mingw), we know for a fact
cedbb146
RL
1086# that two files get produced, {shlibname}.dll and {libname}.dll.a.
1087# With all other Unix platforms, we often build a shared library with the
1088# SO version built into the file name and a symlink without the SO version
1089# It's not necessary to have both as targets. The choice falls on the
d4453024
RL
1090# simplest, {libname}\$(SHLIB_EXT_IMPORT) for Windows POSIX layers and
1091# {libname}\$(SHLIB_EXT_SIMPLE) for the Unix platforms.
81183680 1092$target: $deps
722c9762 1093 \$(CC) \$(LIB_CFLAGS) $linkflags\$(LIB_LDFLAGS)$shared_soname$shared_imp \\
81183680 1094 -o $target_full$shared_def $objs \\
150624bc 1095 $linklibs \$(LIB_EX_LIBS)
fcf80c46 1096EOF
81183680
RL
1097 if (windowsdll()) {
1098 $recipe .= <<"EOF";
d4453024
RL
1099 rm -f apps/$shlib'\$(SHLIB_EXT)'
1100 rm -f test/$shlib'\$(SHLIB_EXT)'
81183680 1101 rm -f fuzz/$shlib'\$(SHLIB_EXT)'
d4453024
RL
1102 cp -p $shlib'\$(SHLIB_EXT)' apps/
1103 cp -p $shlib'\$(SHLIB_EXT)' test/
81183680
RL
1104 cp -p $shlib'\$(SHLIB_EXT)' fuzz/
1105EOF
1106 } else {
1107 $recipe .= <<"EOF";
50625bf5
RL
1108 if [ '$target' != '$target_full' ]; then \\
1109 rm -f $target; \\
1110 ln -s $target_full $target; \\
1111 fi
567a9e6f 1112EOF
81183680 1113 }
567a9e6f 1114 }
5386287c 1115 sub obj2dso {
567a9e6f 1116 my %args = @_;
d07abe13
RL
1117 my $dso = $args{lib};
1118 my $dsod = dirname($dso);
1119 my $dson = basename($dso);
47eeaf45
RL
1120 my @linkdirs = ();
1121 foreach (@{args{deps}}) {
1122 my $d = dirname($_);
1123 push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
1124 }
1125 my $linkflags = join("", map { "-L$_ " } @linkdirs);
1126 my $linklibs = join("", map { my $f = basename($_);
81183680 1127 (my $l = $f) =~ s/^lib//;
47eeaf45 1128 " -l$l" } @{$args{deps}});
29f3cfdd
RL
1129 my @objs = map { (my $x = $_) =~ s|\.o$||; "$x$objext" }
1130 grep { $_ !~ m/\.(?:def|map)$/ }
1131 @{$args{objs}};
81183680
RL
1132 my @deps = compute_lib_depends(@{$args{deps}});
1133 my $objs = join(" ", @objs);
1134 my $deps = join(" ", @deps);
d07abe13 1135 my $target = dso($dso);
567a9e6f 1136 return <<"EOF";
f5c174ff 1137$target: $objs $deps
722c9762 1138 \$(CC) \$(DSO_CFLAGS) $linkflags\$(DSO_LDFLAGS) \\
81183680 1139 -o $target $objs \\
150624bc 1140 $linklibs \$(DSO_EX_LIBS)
567a9e6f
RL
1141EOF
1142 }
1143 sub obj2lib {
1144 my %args = @_;
33105818 1145 (my $lib = $args{lib}) =~ s/\.a$//;
81183680
RL
1146 my @objs = map { (my $x = $_) =~ s|\.o$|$objext|; $x } @{$args{objs}};
1147 my $objs = join(" ", @objs);
567a9e6f 1148 return <<"EOF";
834aae2a 1149$lib$libext: $objs
5b18235a 1150 \$(AR) \$(ARFLAGS) \$\@ \$\?
567a9e6f
RL
1151 \$(RANLIB) \$\@ || echo Never mind.
1152EOF
1153 }
1154 sub obj2bin {
1155 my %args = @_;
1156 my $bin = $args{bin};
1157 my $bind = dirname($bin);
1158 my $binn = basename($bin);
29f3cfdd 1159 my $objs = join(" ", map { (my $x = $_) =~ s|\.o$||; "$x$objext" }
81183680 1160 @{$args{objs}});
cedbb146 1161 my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
47eeaf45
RL
1162 my @linkdirs = ();
1163 foreach (@{args{deps}}) {
1164 next if $_ =~ /\.a$/;
1165 my $d = dirname($_);
1166 push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
1167 }
1168 my $linkflags = join("", map { "-L$_ " } @linkdirs);
186a31e5
RL
1169 my $linklibs = join("", map { if ($_ =~ /\.a$/) {
1170 " $_";
1171 } else {
186a31e5 1172 my $f = basename($_);
186a31e5 1173 (my $l = $f) =~ s/^lib//;
47eeaf45 1174 " -l$l"
186a31e5
RL
1175 }
1176 } @{$args{deps}});
81183680 1177 my $cmd = '$(CC)';
722c9762 1178 my $cmdflags = '$(BIN_CFLAGS)';
81183680
RL
1179 if (grep /_cc\.o$/, @{$args{objs}}) {
1180 $cmd = '$(CXX)';
722c9762 1181 $cmdflags = '$(BIN_CXXFLAGS)';
7763472f 1182 }
567a9e6f 1183 return <<"EOF";
834aae2a 1184$bin$exeext: $objs $deps
81183680 1185 rm -f $bin$exeext
722c9762 1186 \$\${LDCMD:-$cmd} $cmdflags $linkflags\$(BIN_LDFLAGS) \\
47eeaf45 1187 -o $bin$exeext $objs \\
150624bc 1188 $linklibs \$(BIN_EX_LIBS)
567a9e6f
RL
1189EOF
1190 }
1191 sub in2script {
1192 my %args = @_;
1193 my $script = $args{script};
1194 my $sources = join(" ", @{$args{sources}});
1195 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
1196 "util", "dofile.pl")),
1197 rel2abs($config{builddir}));
1198 return <<"EOF";
88297284 1199$script: $sources
4b799cea 1200 \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
ba327ade 1201 "-o$target{build_file}" $sources > "$script"
567a9e6f 1202 chmod a+x $script
0ad1d94d
RL
1203EOF
1204 }
1205 sub generatedir {
1206 my %args = @_;
1207 my $dir = $args{dir};
1208 my @deps = map { s|\.o$|$objext|; $_ } @{$args{deps}};
1209 my @actions = ();
1210 my %extinfo = ( dso => $dsoext,
1211 lib => $libext,
1212 bin => $exeext );
1213
1214 foreach my $type (("dso", "lib", "bin", "script")) {
1215 next unless defined($unified_info{dirinfo}->{$dir}->{products}->{$type});
850000aa
RL
1216 # For lib object files, we could update the library. However, it
1217 # was decided that it's enough to build the directory local object
1218 # files, so we don't need to add any actions, and the dependencies
1219 # are already taken care of.
1220 if ($type ne "lib") {
0ad1d94d
RL
1221 foreach my $prod (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) {
1222 if (dirname($prod) eq $dir) {
1223 push @deps, $prod.$extinfo{$type};
1224 } else {
1225 push @actions, "\t@ : No support to produce $type ".join(", ", @{$unified_info{dirinfo}->{$dir}->{products}->{$type}});
1226 }
1227 }
1228 }
1229 }
1230
1231 my $deps = join(" ", @deps);
1232 my $actions = join("\n", "", @actions);
1233 return <<"EOF";
1234$args{dir} $args{dir}/: $deps$actions
567a9e6f
RL
1235EOF
1236 }
1237 "" # Important! This becomes part of the template result.
1238-}