diff --git a/Makefile b/Makefile index 48d4421..4da1550 100644 --- a/Makefile +++ b/Makefile @@ -111,13 +111,23 @@ lb_update_copy_files: @mkdir -p $(DIST_DIR) @mkdir -p $(TEMP_DIR) - @echo "[INFO] Copying modified or added files from 'src/'..." + @echo "[INFO] Copying modified or added files from 'src/' that are in LB_FILES..." @for file in $$(git diff --name-status $(LAST_TAG)..HEAD | grep -E '^[AM]' | cut -f2 | grep '^src/'); do \ rel_path=$$(echo "$$file" | sed 's|^src/||'); \ - if [ -f "$$file" ]; then \ + # Check if the file belongs to one of the allowed directories LB_FILES \ + allowed=0; \ + for lb_item in $(LB_FILES); do \ + if echo "$$rel_path" | grep -q "^$$lb_item/"; then \ + allowed=1; \ + break; \ + fi; \ + done; \ + if [ "$$allowed" -eq 1 ] && [ -f "$$file" ]; then \ echo "[COPY] $$file -> $(TEMP_DIR)/$$rel_path"; \ mkdir -p "$(TEMP_DIR)/$$(dirname $$rel_path)"; \ cp "$$file" "$(TEMP_DIR)/$$rel_path"; \ + else \ + echo "[SKIP] $$file (not in LB_FILES)"; \ fi \ done