.SUFFIXES:
OBJDIR := _out_$(RUST_TARGET)-$(_link_type)-$(_profile)
MAKETARGET = $(MAKE) --no-print-directory -C $@ -f $(CURDIR)/Makefile \
SRCDIR=$(CURDIR) $(MAKECMDGOALS)
.PHONY: $(OBJDIR)
$(OBJDIR):
+@[ -d "$@" ] || mkdir -p "$@"
+@$(MAKETARGET)
Makefile : ;
%.mk :: ;
% :: $(OBJDIR) ;
.PHONY: clean clean-all help
clean:
rm -rf $(OBJDIR)
clean-all:
rm -rf _out_*
help:
@echo "You have the choice of the following parameters:"
@echo ""
@echo "Variable | Description | Default | Values"
@echo "---------+----------------------+-----------+---------------------------"
@echo "LIBC | libc to link against | 'gnu' | 'gnu' or 'musl'"
@echo "PROFILE | Optimization profile | 'release' | 'debug' or 'size_optimized'"
@echo "LINK | | 'dynamic' | 'dynamic' or 'static'"
@echo "CARGO | cargo binary to use | 'cargo' | 'rustup run nightly cargo'"
@echo "CC | C compiler to use | 'gcc' | 'musl-gcc'"
@echo "STRIP | strip command to use | 'strip' | -"
@echo ""
@echo "When building this project, each configuration will result in a separate output directory."
@echo "The target clean only removes the output directory of the specified configuration."
@echo "The target clean-all can be used to remove the builds of all configurations."