From fbe8122ebde2043de743d189402fa717fbfe0a90 Mon Sep 17 00:00:00 2001 From: Adnan Maolood Date: Sun, 1 Nov 2020 20:51:43 -0500 Subject: [PATCH] Add Makefile --- .gitignore | 1 + Makefile | 32 ++++++++++++++++++++++++++++++++ README.md | 12 ++++++------ 3 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 .gitignore create mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8c4affa --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +kiln diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..819981e --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +.POSIX: +.SUFFIXES: + +VERSION=0.0.0 + +PREFIX?=/usr/local + +GO?=go +GOFLAGS?= +GOSRC!=find . -name '*.go' +GOSRC+=go.mod go.sum + +all: kiln + +kiln: $(GOSRC) + $(GO) build $(GOFLAGS) \ + -ldflags "-X main.Prefix=$(PREFIX) \ + -X main.ShareDir=$(SHAREDIR) \ + -X main.Version=$(VERSION)" \ + -o $@ + +clean: + rm -f kiln + +install: all + mkdir -p $(DESTDIR)$(PREFIX)/bin + install -m755 kiln $(DESTDIR)$(PREFIX)/bin + +uninstall: + $(RM) $(DESTDIR)$(PREFIX)/bin/kiln + +.PHONY: all clean install uninstall diff --git a/README.md b/README.md index 01ae86c..55a0339 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,14 @@ A simple static site generator for Gemini. ## Installation -``` -go install -``` +First install Go version 1.15 or later. +Then compile: + + $ make + # make install ## Usage -``` -kiln -``` + kiln For more information, consult the [wiki](https://man.sr.ht/~adnano/kiln/).