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