# The main targets ###################################################
-all: Makefile libcrypto.pc libssl.pc openssl.pc $(ENGINES) $(PROGRAMS) $(SCRIPTS) $(TESTPROGS) link-utils
+all: build_libs build_engines build_apps link-utils
-test tests: $(TESTPROGS) rehash
+# The pkg-config files depend on the libraries as well as Makefile
+build_libs: libcrypto.pc libssl.pc openssl.pc
+build_engines: $(ENGINES)
+build_apps: $(PROGRAMS) $(SCRIPTS)
+build_tests: $(TESTPROGS)
+
+test tests: build_tests build_apps build_engines rehash
( cd test; \
SRCTOP=../$(SRCDIR) \
BLDTOP=../$(BLDDIR) \
# Helper targets #####################################################
-rehash: link-utils copy-certs
+rehash: link-utils copy-certs build_apps
@if [ -z "$(CROSS_COMPILE)" ]; then \
(OPENSSL="$(BLDDIR)/util/shlib_wrap.sh apps/openssl"; \
[ -x "$(BLDDIR)/openssl.exe" ] && OPENSSL="$(BLDDIR)/openssl.exe" || :; \
rel2abs($config{builddir}));
return <<"EOF";
$script : $sources
- \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" $sources > "$script"
+ \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
+ "-o$target{build_file}" $sources > "$script"
chmod a+x $script
EOF
}