source: code/trunk/Makefile@ 789

Last change on this file since 789 was 775, checked in by contact, 3 years ago

makefile: switch to BSD/GNU make

Let's stop using POSIX make, it's too much of a pain.

File size: 703 bytes
Line 
1GO ?= go
2RM ?= rm
3SCDOC ?= scdoc
4GOFLAGS ?=
5PREFIX ?= /usr/local
6BINDIR ?= bin
7MANDIR ?= share/man
8
9all: soju sojuctl doc/soju.1
10
11soju:
12 $(GO) build $(GOFLAGS) ./cmd/soju
13sojuctl:
14 $(GO) build $(GOFLAGS) ./cmd/sojuctl
15doc/soju.1: doc/soju.1.scd
16 $(SCDOC) <doc/soju.1.scd >doc/soju.1
17
18clean:
19 $(RM) -f soju sojuctl doc/soju.1
20install:
21 mkdir -p $(DESTDIR)$(PREFIX)/$(BINDIR)
22 mkdir -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
23 mkdir -p $(DESTDIR)/etc/soju
24 mkdir -p $(DESTDIR)/var/lib/soju
25 cp -f soju sojuctl $(DESTDIR)$(PREFIX)/$(BINDIR)
26 cp -f doc/soju.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
27 [ -f $(DESTDIR)/etc/soju/config ] || cp -f config.in $(DESTDIR)/etc/soju/config
28
29.PHONY: soju sojuctl clean install
Note: See TracBrowser for help on using the repository browser.