fix(makefile): alinear targets amb ../aee i ../projecte_2026
Abans: make / make build -> Debug make release -> Release (sense empaquetar) Ara, mateixa convenció que els dos projectes germans: make -> Release (binari d'ús normal) make debug -> Debug (flux amb debug.yaml) make release -> Release + empaquetat distribució (empaquetat TODO) Afegit make run / make run-debug per conveniència i make help. docs/convencions.md actualitzat amb la nova taula target -> comportament.
This commit is contained in:
1 parent
6800786194
commit
03f1c5f926
2 files changed
+77
-22
No files matched your search
@@ -14,47 +14,66 @@ endif
|
||||
|
||||
CMAKE_DEFS := -DGIT_HASH=$(GIT_HASH)
|
||||
|
||||
.PHONY: all configure build run clean rebuild release show-version format format-check tidy tidy-fix cppcheck hooks-install
|
||||
.PHONY: all debug release run run-debug clean rebuild show-version format format-check tidy tidy-fix cppcheck hooks-install help
|
||||
|
||||
all: build
|
||||
# ==============================================================================
|
||||
# COMPILACIÓ
|
||||
# ==============================================================================
|
||||
# Convenció alineada amb ../aee i ../projecte_2026:
|
||||
# make → Release (binari d'ús normal)
|
||||
# make debug → Debug (flux complet + `debug.yaml` per triar escena inicial)
|
||||
# make release → Release + empaquetat per a distribució (TODO, pendent)
|
||||
# ==============================================================================
|
||||
|
||||
configure:
|
||||
@cmake -S . -B $(BUILDDIR) -DCMAKE_BUILD_TYPE=Debug $(CMAKE_DEFS)
|
||||
|
||||
build: configure
|
||||
@cmake --build $(BUILDDIR) -j$(JOBS)
|
||||
|
||||
run: build
|
||||
@./$(BUILDDIR)/$(PROJECT)
|
||||
|
||||
release:
|
||||
all:
|
||||
@cmake -S . -B $(BUILDDIR) -DCMAKE_BUILD_TYPE=Release $(CMAKE_DEFS)
|
||||
@cmake --build $(BUILDDIR) -j$(JOBS)
|
||||
|
||||
debug:
|
||||
@cmake -S . -B $(BUILDDIR) -DCMAKE_BUILD_TYPE=Debug $(CMAKE_DEFS)
|
||||
@cmake --build $(BUILDDIR) -j$(JOBS)
|
||||
|
||||
run: all
|
||||
@./$(BUILDDIR)/$(PROJECT)
|
||||
|
||||
run-debug: debug
|
||||
@./$(BUILDDIR)/$(PROJECT)
|
||||
|
||||
# Release + empaquetat per distribució (zip/dmg/tar.gz). De moment només
|
||||
# compila amb CMAKE_BUILD_TYPE=Release; l'empaquetat OS-specific està
|
||||
# pendent (veure Makefile de ../aee com a referència).
|
||||
release: all
|
||||
@echo "TODO: empaquetat per a distribució (zip/dmg/tar.gz) — pendent"
|
||||
|
||||
show-version:
|
||||
@echo "$(PROJECT) $(VERSION) ($(GIT_HASH))"
|
||||
|
||||
clean:
|
||||
@rm -rf $(BUILDDIR)
|
||||
|
||||
rebuild: clean build
|
||||
rebuild: clean all
|
||||
|
||||
# ==============================================================================
|
||||
# CODE QUALITY (delegados a cmake)
|
||||
# ==============================================================================
|
||||
format: configure
|
||||
format:
|
||||
@cmake -S . -B $(BUILDDIR) -DCMAKE_BUILD_TYPE=Release $(CMAKE_DEFS)
|
||||
@cmake --build $(BUILDDIR) --target format
|
||||
|
||||
format-check: configure
|
||||
format-check:
|
||||
@cmake -S . -B $(BUILDDIR) -DCMAKE_BUILD_TYPE=Release $(CMAKE_DEFS)
|
||||
@cmake --build $(BUILDDIR) --target format-check
|
||||
|
||||
tidy: configure
|
||||
tidy:
|
||||
@cmake -S . -B $(BUILDDIR) -DCMAKE_BUILD_TYPE=Release $(CMAKE_DEFS)
|
||||
@cmake --build $(BUILDDIR) --target tidy
|
||||
|
||||
tidy-fix: configure
|
||||
tidy-fix:
|
||||
@cmake -S . -B $(BUILDDIR) -DCMAKE_BUILD_TYPE=Release $(CMAKE_DEFS)
|
||||
@cmake --build $(BUILDDIR) --target tidy-fix
|
||||
|
||||
cppcheck: configure
|
||||
cppcheck:
|
||||
@cmake -S . -B $(BUILDDIR) -DCMAKE_BUILD_TYPE=Release $(CMAKE_DEFS)
|
||||
@cmake --build $(BUILDDIR) --target cppcheck
|
||||
|
||||
# ==============================================================================
|
||||
@@ -63,3 +82,35 @@ cppcheck: configure
|
||||
hooks-install:
|
||||
@git config core.hooksPath .githooks
|
||||
@echo "Git hooks activats: $(shell pwd)/.githooks"
|
||||
|
||||
# ==============================================================================
|
||||
# AJUDA
|
||||
# ==============================================================================
|
||||
help:
|
||||
@echo "Makefile per a $(PROJECT)"
|
||||
@echo ""
|
||||
@echo " Compilació:"
|
||||
@echo " make - Compilar amb cmake (Release)"
|
||||
@echo " make debug - Compilar amb cmake (Debug)"
|
||||
@echo ""
|
||||
@echo " Execució:"
|
||||
@echo " make run - Compilar (Release) i executar"
|
||||
@echo " make run-debug - Compilar (Debug) i executar"
|
||||
@echo ""
|
||||
@echo " Release:"
|
||||
@echo " make release - Release + empaquetat (TODO pendent)"
|
||||
@echo ""
|
||||
@echo " Qualitat de codi:"
|
||||
@echo " make format - Formatar codi amb clang-format"
|
||||
@echo " make format-check - Verificar format sense modificar"
|
||||
@echo " make tidy - Anàlisi estàtic amb clang-tidy"
|
||||
@echo " make tidy-fix - Anàlisi estàtic amb auto-fix"
|
||||
@echo " make cppcheck - Anàlisi estàtic amb cppcheck"
|
||||
@echo ""
|
||||
@echo " Altres:"
|
||||
@echo " make clean - Esborrar carpeta $(BUILDDIR)/"
|
||||
@echo " make rebuild - clean + all"
|
||||
@echo " make show-version - Mostrar versió"
|
||||
@echo " make hooks-install - Activar git hooks del projecte"
|
||||
@echo ""
|
||||
@echo " Versió actual: $(VERSION) ($(GIT_HASH))"
|
||||
Reference in new issue
Block a user