-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (49 loc) · 1.52 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
FETCH=ftp
CKSUM=sha256
HRSYNCV=1.0.1
all:
make build
hrsync.tar.gz:
${FETCH} https://github.com/timkuijsten/hrsync/archive/refs/tags/v${HRSYNCV}.tar.gz
mv v${HRSYNCV}.tar.gz hrsync.tar.gz
hrsync: hrsync.tar.gz
${CKSUM} -c SHA256SUMS
tar zxf hrsync.tar.gz
mv hrsync-${HRSYNCV} hrsync
# let hrsync patch rsync
cd hrsync && make rsync-3.1.3
# then apply our own patches on top of it
patch hrsync/rsync-3.1.3/rsync.c patch-hrsync-rsync_c
patch hrsync/rsync-3.1.3/util.c patch-hrsync-util_c
prsync: hrsync
cd hrsync && make
cp hrsync/hrsync prsync
snaps: *.[ych]
yacc scfg.y
cc -Wall -g strv.c intv.c util.c y.tab.c rotator.c syncer.c \
parseconfig.c snaps.c -o snaps
build: snaps prsync
install: snaps prsync
install -m 0555 -g bin snaps prsync /usr/local/sbin
install -m 0444 -g bin snaps.8 /usr/local/man/man8
install -m 0444 -g bin snaps.conf.5 /usr/local/man/man5
install -m 0640 snaps.conf.example /etc/examples/snaps.conf
clean:
rm -f snaps prsync y.tab.c y.output tutil tscfg
rm -rf hrsync/ /tmp/snapstestutil
docs:
mandoc -T html -Ostyle=man.css snaps.8 > snaps.8.html
mandoc -T html -Ostyle=man.css snaps.conf.5 > snaps.conf.5.html
# test utilities
tutil: strv.c intv.c util.c test/util.c
rm -rf /tmp/snapstestutil
mkdir /tmp/snapstestutil
cc -Wall -g strv.c intv.c util.c test/util.c -o tutil
# test simple config file parser
tscfg: scfg.y scfg.h strv.c strv.h intv.c intv.h test/scfg.c
yacc -tv scfg.y
cc -Wall -g strv.c intv.c y.tab.c test/scfg.c -o tscfg
./tscfg
runtests: tutil tscfg
./tutil
./tscfg