From 1ae7775ce1dc26ea5e1362773e5c8aecfa68d73c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Tue, 31 Dec 2019 20:04:52 +0000 Subject: [PATCH] Cleanup Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- Makefile | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 52020cb..c803c04 100644 --- a/Makefile +++ b/Makefile @@ -2,11 +2,12 @@ NAME := glorytun VERSION := $(shell ./version.sh) DIST := $(NAME)-$(VERSION) +CC ?= cc DESTDIR ?= -CC ?= gcc -INSTALL ?= install prefix ?= /usr -CFLAGS ?= -std=c11 -O2 -Wall -fstack-protector-strong +Q := @ + +CFLAGS := -std=c11 -O2 -Wall -fstack-protector-strong FLAGS := $(CFLAGS) $(LDFLAGS) $(CPPFLAGS) FLAGS += -DPACKAGE_NAME=\"$(NAME)\" -DPACKAGE_VERSION=\"$(VERSION)\" @@ -19,22 +20,15 @@ HDR := argz/argz.h mud/mud.h mud/aegis256/aegis256.h $(wildcard src/*.h) $(NAME): $(SRC) $(HDR) @echo "$(NAME)" - @$(CC) $(FLAGS) -o $(NAME) $(SRC) -lsodium + $(Q)$(CC) $(FLAGS) -o $(NAME) $(SRC) -lsodium .PHONY: install install: $(NAME) @echo "$(DESTDIR)$(prefix)/bin/$(NAME)" - @$(INSTALL) -m 755 -d $(DESTDIR)$(prefix)/bin - @$(INSTALL) -m 755 -s $(NAME) $(DESTDIR)$(prefix)/bin + $(Q)install -m 755 -d $(DESTDIR)$(prefix)/bin + $(Q)install -m 755 -s $(NAME) $(DESTDIR)$(prefix)/bin .PHONY: clean clean: - @rm -f "$(NAME)" - @rm -f "$(DIST).tar.gz" - -.PHONY: dist -dist: - @echo "$(DIST).tar.gz" - @(git --git-dir=.git ls-files --recurse-submodules -- ':!:.*' ':!:**/.*' && echo VERSION) | ( \ - tar zcf $(DIST).tar.gz -T- --transform 's:^:$(DIST)/:' || \ - tar zcf $(DIST).tar.gz -T- -s ':^:$(DIST)/:' ) 2>/dev/null + $(Q)rm -f "$(NAME)" + $(Q)rm -f "$(DIST).tar.gz"