From 2d2c872c3d989ea1b13085f9cc0eaa16b075cc41 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Tue, 3 Mar 2020 19:12:30 +0100 Subject: [PATCH] Add install target --- Makefile | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 47f7e7b..74417a2 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,28 @@ LDFLAGS= -#LDFLAGS=--no-debug +DESTDIR=/usr + +BUILDDIR=_build all: build -build: - crystal build $(LDFLAGS) src/pushokku.cr -o pushokku +$(BUILDDIR): + mkdir -p $(BUILDDIR) +build: clean $(BUILDDIR) + crystal build $(LDFLAGS) src/pushokku.cr -o $(BUILDDIR)/pushokku + +build-release: LDFLAGS=--release --no-debug +build-release: build + +install: + install -m 0755 -o root -g root \ + $(BUILDDIR)/pushokku \ + $(DESTDIR)/bin/pushokku test: run: crystal run src/pushokku.cr +clean: + rm -f $(BUILDDIR)/pushokku