source: code/trunk/Makefile@ 731

Last change on this file since 731 was 613, checked in by contact, 4 years ago

build: don't clobber config file

Use test -f instead of cp -n, because the former is POSIX.

References: https://github.com/emersion/soju/pull/32

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