forked from ioi/isolate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (56 loc) · 2.14 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Makefile for Isolate
# (c) 2015--2024 Martin Mares <mj@ucw.cz>
# (c) 2017 Bernard Blackham <bernard@blackham.com.au>
# (c) 2024 Sort Me <guys@sort-me.org>
all: isolate isolate.1 isolate.1.html isolate-check-environment
CC=gcc
CFLAGS=-std=gnu99 -static -Wall -Wextra -Wno-parentheses -Wno-unused-result -Wno-missing-field-initializers -Wstrict-prototypes -Wmissing-prototypes -D_GNU_SOURCE
LIBS=-lcap
VERSION=2.0
YEAR=2024
BUILD_DATE:=$(shell date '+%Y-%m-%d')
BUILD_COMMIT:=$(shell if git rev-parse >/dev/null 2>/dev/null ; then git describe --always --tags ; else echo '<unknown>' ; fi)
PREFIX = $(DESTDIR)/usr/local
VARPREFIX = $(DESTDIR)/var/local
CONFIGDIR = $(PREFIX)/etc
CONFIG = $(CONFIGDIR)/isolate
BINDIR = $(PREFIX)/bin
SBINDIR = $(PREFIX)/sbin
DATAROOTDIR = $(PREFIX)/share
DATADIR = $(DATAROOTDIR)
MANDIR = $(DATADIR)/man
MAN1DIR = $(MANDIR)/man1
BOXDIR = $(VARPREFIX)/lib/isolate
isolate: isolate.o util.o rules.o cg.o config.o
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
%.o: %.c isolate.h
$(CC) $(CFLAGS) -c -o $@ $<
isolate.o: CFLAGS += -DVERSION='"$(VERSION)"' -DYEAR='"$(YEAR)"' -DBUILD_DATE='"$(BUILD_DATE)"' -DBUILD_COMMIT='"$(BUILD_COMMIT)"'
config.o: CFLAGS += -DCONFIG_FILE='"$(CONFIG)"'
isolate.1: isolate.1.txt
a2x -f manpage $<
# The dependency on isolate.1 is there to serialize both calls of asciidoc,
# which does not name temporary files safely.
isolate.1.html: isolate.1.txt isolate.1
a2x -f xhtml -D . $<
clean:
rm -f *.o
rm -f isolate
rm -f isolate.1 isolate.1.html
rm -f docbook-xsl.css
install: isolate isolate-check-environment
install -d $(BINDIR) $(SBINDIR) $(BOXDIR) $(CONFIGDIR)
install isolate-check-environment $(BINDIR)
install -m 4755 isolate $(BINDIR)
install -m 644 default.cf $(CONFIG)
install-doc: isolate.1
install -d $(MAN1DIR)
install -m 644 $< $(MAN1DIR)/$<
release: isolate.1.html
git tag v$(VERSION)
git push --tags
git archive --format=tar --prefix=isolate-$(VERSION)/ HEAD | gzip >isolate-$(VERSION).tar.gz
rsync isolate-$(VERSION).tar.gz jw:/home/ftp/pub/mj/isolate/
rsync isolate.1.html jw:/var/www/moe/
ssh jw 'cd web && bin/release-prog isolate $(VERSION)'
.PHONY: all clean install install-doc release