Files
tuxgyverandClaude Opus 5 599192fd67 build: Makefile categorise, README et compilation Windows depuis Linux
- Makefile avec aide auto-documentee par categories (`make help`) :
  installation, utilisation, compilation, publication, nettoyage.
- packaging/build_windows_wine.sh : produit le .exe Windows natif depuis
  Linux via un PyInstaller Windows execute dans un prefixe Wine dedie
  (PyInstaller ne cross-compilant pas). Installation des dependances
  idempotente, builds suivants incrementaux.
- README.md : fonctionnalites, usage GUI/CLI, compilation, publication.
- `make publish` pousse branche et tags vers tous les depots configures.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-08 22:11:39 +02:00

88 lines
2.7 KiB
Makefile
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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 ""