# JoinDomainGUI โ€” diagnostic reseau AD + jointure de domaine # `make` seul (ou `make help`) affiche les cibles disponibles. .DEFAULT_GOAL := help VENV := .build-venv-linux PY := $(VENV)/bin/python PIP := $(VENV)/bin/pip VERSION := $(shell sed -n 's/^__version__ = "\(.*\)"/\1/p' domainjoin/__init__.py) DOMAIN ?= h3adm.lan BRANCH := $(shell git rev-parse --abbrev-ref HEAD) REMOTES := $(shell git remote) ##@ ๐Ÿ“ฆ Installation $(VENV)/bin/python: python3 -m venv --system-site-packages $(VENV) $(PIP) install --upgrade pip -q $(PIP) install -q -r requirements.txt .PHONY: install install: $(VENV)/bin/python ## Cree l'environnement virtuel et installe les dependances @echo "โœ… Environnement pret : $(VENV)" ##@ ๐Ÿš€ Utilisation .PHONY: run run: install ## Lance l'interface graphique $(PY) main.py .PHONY: diagnose diagnose: install ## Lance le diagnostic reseau en CLI (make diagnose DOMAIN=exemple.lan) $(PY) main.py diagnose --domain $(DOMAIN) ##@ ๐Ÿ—๏ธ Compilation .PHONY: build build: build-linux build-windows ## Compile les binaires Linux et Windows .PHONY: build-linux build-linux: ## Compile le binaire Linux autonome (dist/JoinDomainGUI) ./packaging/build_linux.sh .PHONY: build-windows build-windows: ## Compile le .exe Windows depuis Linux via Wine (dist/windows/JoinDomainGUI.exe) ./packaging/build_windows_wine.sh ##@ ๐Ÿšข Publication .PHONY: remotes remotes: ## Liste les depots distants configures @git remote -v | awk '$$3 == "(push)" { printf " %-10s %s\n", $$1, $$2 }' .PHONY: publish publish: ## Pousse la branche courante et les tags vers tous les depots (Gitea) @git diff --quiet HEAD || { echo "โŒ Modifications non commitees โ€” commit avant de publier."; exit 1; } @for remote in $(REMOTES); do \ echo "๐Ÿš€ $$remote โ† $(BRANCH)"; \ git push $$remote $(BRANCH) || exit 1; \ git push $$remote --tags || exit 1; \ done @echo "โœ… Publie sur : $(REMOTES)" ##@ ๐Ÿงน Nettoyage .PHONY: clean clean: ## Supprime les artefacts de compilation et les caches Python rm -rf build dist find . -path ./$(VENV) -prune -o -name '__pycache__' -type d -print0 | xargs -0 rm -rf .PHONY: distclean distclean: clean ## Nettoyage complet : + environnements virtuels, prefixe Wine et telechargements rm -rf $(VENV) .build-venv-windows .build-wine .build-wine-cache ##@ โ„น๏ธ Aide .PHONY: version version: ## Affiche la version courante @echo "JoinDomainGUI $(VERSION)" .PHONY: help help: ## Affiche cette aide @echo "JoinDomainGUI $(VERSION)" @awk 'BEGIN {FS = ":.*?## "} \ /^[a-zA-Z0-9_.-]+:.*?##/ { printf " \033[36m%-16s\033[0m %s\n", $$1, $$2 } \ /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) }' $(MAKEFILE_LIST) @echo ""