X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=Makefile.org;h=902bcd9a4168d112889ff0c503ea661ffc236a6b;hp=a34033abe02356945a56b72cd4d220c4198d54c1;hb=b480283c56cd7c93237aad1ef6b269b357b46c5f;hpb=ed26604a717ca6e028ec12ae896603a96c66e2b2 diff --git a/Makefile.org b/Makefile.org index a34033abe0..902bcd9a41 100644 --- a/Makefile.org +++ b/Makefile.org @@ -197,12 +197,29 @@ BUILDENV= PLATFORM='${PLATFORM}' PROCESSOR='${PROCESSOR}' \ # MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors, # which in turn eliminates ambiguities in variable treatment with -e. +# BUILD_CMD is a generic macro to build a given target in a given +# subdirectory. The target must be given through the shell variable +# `target' and the subdirectory to build in must be given through `dir'. +# This macro shouldn't be used directly, use RECURSIVE_BUILD_CMD or +# BUILD_ONE_CMD instead. +# +# BUILD_ONE_CMD is a macro to build a given target in a given +# subdirectory if that subdirectory is part of $(DIRS). It requires +# exactly the same shell variables as BUILD_CMD. +# +# RECURSIVE_BUILD_CMD is a macro to build a given target in all +# subdirectories defined in $(DIRS). It requires that the target +# is given through the shell variable `target'. BUILD_CMD= if [ -d "$$dir" ]; then \ ( cd $$dir && echo "making $$target in $$dir..." && \ $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \ ) || exit 1; \ fi RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done +BUILD_ONE_CMD=\ + if echo " $(DIRS) " | grep " $$dir " >/dev/null 2>/dev/null; then \ + $(BUILD_CMD); \ + fi reflect: @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV) @@ -213,21 +230,21 @@ build_all: build_libs build_apps build_tests build_tools build_libs: build_crypto build_ssl build_engines build_crypto: - @dir=crypto; target=all; $(BUILD_CMD) + @dir=crypto; target=all; $(BUILD_ONE_CMD) build_ssl: - @dir=ssl; target=all; $(BUILD_CMD) + @dir=ssl; target=all; $(BUILD_ONE_CMD) build_engines: - @dir=engines; target=all; $(BUILD_CMD) + @dir=engines; target=all; $(BUILD_ONE_CMD) build_apps: - @dir=apps; target=all; $(BUILD_CMD) + @dir=apps; target=all; $(BUILD_ONE_CMD) build_tests: - @dir=test; target=all; $(BUILD_CMD) + @dir=test; target=all; $(BUILD_ONE_CMD) build_tools: - @dir=tools; target=all; $(BUILD_CMD) + @dir=tools; target=all; $(BUILD_ONE_CMD) all_testapps: build_libs build_testapps build_testapps: - @dir=crypto; target=testapps; $(BUILD_CMD) + @dir=crypto; target=testapps; $(BUILD_ONE_CMD) libcrypto$(SHLIB_EXT): libcrypto.a @if [ "$(SHLIB_TARGET)" != "" ]; then \