From ae7ca00e692848a7c93ce8c8a5ca8f1117ff5457 Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Fri, 14 Oct 2022 11:59:16 -0300 Subject: [PATCH] Dettach git clone and fix clean The user has to clone the repo, then edit the Makefile to change WiFi credentials. Running make build does both and the tests go flawlessly The user can run make to clone the repo, then change credentials and run make build, it will skip cloning if the repo is already there In some systems the compiled files are not owned by the user as Docker runs as root, so we first invoke clean in the cloned repo (which erases the compiled files), and then remove the cloned repo that the user owns and can rm. --- examples/raspberry/raspberry-pi-pico-w/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/raspberry/raspberry-pi-pico-w/Makefile b/examples/raspberry/raspberry-pi-pico-w/Makefile index 7161ebd0..4e1f3674 100644 --- a/examples/raspberry/raspberry-pi-pico-w/Makefile +++ b/examples/raspberry/raspberry-pi-pico-w/Makefile @@ -1,9 +1,12 @@ NAME = raspberry-pi-pico-w -build: +$(NAME): git clone --depth 1 https://github.com/mongoose-examples/$(NAME) + +build: | $(NAME) cp ./../../../mongoose.[ch] $(NAME) make -C $(NAME) build clean: + make -C $(NAME) clean rm -rf $(NAME)