From 7e51706ed60eb8a3249ffa0c56f13891f290c1b2 Mon Sep 17 00:00:00 2001 From: Simone Carletti Date: Fri, 23 Feb 2024 14:59:59 +0100 Subject: [PATCH] Makefile best practices https://clarkgrubb.com/makefile-style-guide#phony-targets --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1a96d3bc..8f3a8923 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,29 @@ REBAR:=$(shell which rebar3 || echo ./rebar3) REBAR_URL:="https://s3.amazonaws.com/rebar3/rebar3" -.PHONY: test all: clean build $(REBAR): curl -o rebar3 $(REBAR_URL) && chmod +x rebar3 +.PHONY: build build: $(REBAR) $(REBAR) compile +.PHONY: release release: $(REBAR) $(REBAR) release +.PHONY: fresh fresh: $(REBAR) rm -Rf _build $(REBAR) clean +.PHONY: clean clean: $(REBAR) $(REBAR) clean +.PHONY: test test: $(REBAR) $(REBAR) eunit $(REBAR) dialyzer