Finally thought of a way to avoid explicitly declaring CLONED_DIR to make when I invoke it and figured maybe others would want to copy the idea &/or improve it, here's the file:
Code:
TOP_DIR?=.
# Detect if we ourselves are a 3rd party inclusion
_DIR_3RDPARTY:=$(wildcard ../../3rdparty)
_DIR_CLONED:=$(if $(_DIR_3RDPARTY),..,$(wildcard ../../cloned))
CLONED_DIR?=$(if $(_DIR_CLONED),..,$(TOP_DIR)/cloned)
BIN_DIR?=$(TOP_DIR)/bin
LIB_DIR?=$(TOP_DIR)/lib
OBJ_DIR?=$(TOP_DIR)/obj
INC_DIR?=$(TOP_DIR)/include
SRC_DIR?=$(TOP_DIR)/src
MAK_DIR?=$(CLONED_DIR)/mak
PAW_DIR?=$(CLONED_DIR)/paw
url_paw:=https://gitlab.com/awsdert/mak.git
url_mak:=https://gitlab.com/awsdert/paw.git
ALL_DIR:=$(BIN_DIR) $(LIB_DIR) $(SRC_DIR) $(OBJ_DIR) $(INC_DIR) $(CLONED_DIR) $(MAK_DIR) $(PAW_DIR)
directories: $(ALL_DIR:%=%/)
%/:
mkdir $*
$(CLONED_DIR)/%/:
cd $(CLONED_DIR) && git clone $(url_$*)
.PHONY: directories