From e6a6da7a78b1be106d69db8e519594910ea72988 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Thu, 15 Feb 2024 18:56:31 +0100 Subject: [PATCH] feat: add more targets to makefile (ex: install) --- Makefile | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3ea87f8..2fe15e3 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,37 @@ +# SPDX-License-Identifier: GPL-3.0-or-later +# +# SPDX-FileCopyrightText: 2023 Glenn Y. Rolland +# Copyright © 2023 Glenn Y. Rolland + +CURRENT_UID := $(shell id -u) +CURRENT_GID := $(shell id -g) +ifeq ($(CURRENT_UID),0) +PREFIX=/usr +else +PREFIX=$(HOME)/.local +endif all: build +prepare: + shards install + build: - shards build --error-trace + shards build --error-trace -Dpreview_mt + @echo SUCCESS + +watch: + watchexec --restart --delay-run 3 -c -e cr make build + +spec: test +test: + crystal spec --error-trace + +install: + install \ + -m 755 \ + bin/docmachine \ + $(PREFIX)/bin + +.PHONY: spec test build all prepare install