forked from bmizerany/roundup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
107 lines (82 loc) · 2.07 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
.POSIX:
SHELL = /bin/sh
RM = rm
CP = cp
CD = cd
# The default target ...
all::
config.mk:
@echo "Please run ./configure before running make"
exit 1
include config.mk
sourcedir = .
PROGRAMS = roundup
DISTFILES = config.mk config.sh
RONNS = $(wildcard *.ronn)
ROFFS = $(RONNS:.ronn=)
SCRIPTS = roundup.sh $(wildcard *-test.sh)
CODE_DOCS = $(SCRIPTS:=.html)
MAN_DOCS = $(RONNS:.ronn=.html)
DOCS = index.html $(CODE_DOCS) $(MAN_DOCS)
all:: sup build
sup:
echo "==========================================================="
head -7 < README
echo "==========================================================="
build: roundup
echo "roundup built at \`$(sourcedir)/roundup' ..."
echo "run \`make install' to install under $(bindir) ..."
echo "or, just copy the \`$(sourcedir)/roundup' file where you need it."
roundup: roundup.sh FORCE
$(SHELL) -n roundup.sh
sed "s~#!/bin/sh~#!${SHELL}~" roundup.sh > roundup
chmod 0755 roundup
test: roundup
@echo This is expected to fail \`make\`.
@echo
./roundup
doc: $(DOCS)
%.sh.html: %.sh
ifdef SHOCCO
$(SHOCCO) $< > $@
endif
$(MAN_DOCS): $(RONNS)
ifdef RONN
$(RONN) -W5 -s toc $?
else
@echo "Unable to find ronn to recompile man pages; Skipping man page docs."
endif
man: $(ROFFS)
$(ROFFS): $(RONNS)
ifdef RONN
ronn -Wr $?
else
@echo Unable to find ronn to recompile man pages.
@echo See http://bmizerany.github.com/roundup for install instructions
exit 1
endif
install: $(INSTALL_PREREQUISITES)
test -f roundup
mkdir -p "$(bindir)"
cp roundup "$(bindir)/roundup"
chmod 0755 $(bindir)/roundup
install-man: man
-for i in {1..9} ; do cp *.$$i $(mandir)/man$$i 2>/dev/null ; done
.PHONY: pages
pages : doc
-$(RM) -rf pages
$(GIT) fetch -q origin
$(GIT) branch -f gh-pages origin/gh-pages
$(GIT) clone -q -o local -b gh-pages . pages
$(CP) $(DOCS) $(PWD)/pages
$(CP) Pages.mk pages/Makefile
$(CD) pages && $(MAKE) $(MFLAGS) all
read: sup doc
$(BROWSER) ./roundup.html
clean:
$(RM) -rf $(PROGRAMS) $(CODE_DOCS) $(MAN_DOCS) $(ROFFS) pages/
distclean: clean
$(RM) -rf $(DISTFILES)
.PHONY: FORCE
.SUFFIXES:
.SILENT: build sup roundup test