This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
156 lines (123 loc) · 3.34 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# rpg makefile
.POSIX:
# Default make target
all::
include config.mk
NAME = rpg
TARNAME = $(NAME)
SHELL = /bin/sh
CFLAGS = -Wall -pedantic
# ---- END OF CONFIGURATION ----
all:: build
DOCHTML = \
rpg-sh-setup.html rpg.html rpg-fetch.html \
rpg-sync.html rpg-upgrade.html rpg-outdated.html \
rpg-package-install.html rpg-package-spec.html rpg-parse-index.html \
rpg-list.html
PROGRAMPROGRAMS = \
rpg-config rpg-fetch rpg-install rpg-uninstall rpg-build \
rpg-env rpg-sync rpg-resolve rpg-upgrade rpg-steal rpg-fsck rpg-list \
rpg-outdated rpg-package-list rpg-package-register rpg-package-install \
rpg-unpack rpg-package-spec rpg-parse-index rpg-shit-list \
rpg-prepare rpg-complete rpg-help rpg-package-index rpg-dependencies \
rpg-leaves rpg-manifest rpg-solve rpg-diff rpg-parse-gemfile
DEADPROGRAMS = \
rpg-update rpg-status rpg-parse-package-list rpg-version-test
OBJECTS = \
strnatcmp.o rpg-solve.o
USERPROGRAMS = rpg rpg-sh-setup
PROGRAMS = $(USERPROGRAMS) $(PROGRAMPROGRAMS)
.SUFFIXES: .sh .rb .html .c .o
.sh:
printf "%13s %-30s" "[SH]" "$@"
$(SHELL) -n $<
rm -f $@
$(RUBY) ./munge.rb __RPGCONFIG__ config.sh <$< >$@+
chmod a-w+x $@+
mv $@+ $@
printf " OK\n"
.sh.html:
printf "%13s %-30s" "[SHOCCO]" "$@"
shocco $< > $@
printf " OK\n"
.rb:
printf "%13s %-30s" "[RUBY]" "$@"
ruby -c $< >/dev/null
rm -f $@
cp $< $@
chmod a-w+x $@
printf " OK\n"
.rb.html:
printf "%13s %-30s" "[ROCCO]" "$@"
rocco $< >/dev/null
printf " OK\n"
.c.o:
printf "%13s %-30s" "[CC]" "$@"
$(CC) -c $(CFLAGS) $<
printf " OK\n"
rpg-sh-setup: config.sh munge.rb rpg-sh-setup.sh
rpg: config.sh munge.rb rpg.sh
rpg-solve: rpg-solve.o strnatcmp.o
printf "%13s %-30s" "[LINK]" "$@"
$(CC) $(CFLAGS) $(LDFLAGS) rpg-solve.o strnatcmp.o -o $@
printf " OK\n"
rpg-solve-fast.o: rpg-solve.c strnatcmp.h
strnatcmp.o: strnatcmp.c strnatcmp.h
build: $(PROGRAMS)
auto:
while true; do $(MAKE) ; sleep 1; done
man:
$(MAKE) -C doc man
doc: $(DOCHTML)
test: build
cd test && $(SHELL) test-rpg.sh
install:
mkdir -p "$(bindir)" || true
for f in $(USERPROGRAMS); do \
echo "$(INSTALL_PROGRAM) $$f $(bindir)"; \
$(INSTALL_PROGRAM) $$f "$(bindir)"; \
done
mkdir -p "$(libexecdir)" || true
for f in $(PROGRAMPROGRAMS); do \
echo "$(INSTALL_PROGRAM) $$f $(libexecdir)"; \
$(INSTALL_PROGRAM) $$f "$(libexecdir)"; \
done
uninstall:
for f in $(USERPROGRAMS); do \
test -e "$(bindir)/$$f" || continue; \
echo "rm -f $(bindir)/$$f"; \
rm "$(bindir)/$$f"; \
done
for f in $(PROGRAMPROGRAMS) $(DEADPROGRAMS); do \
test -e "$(libexecdir)/$$f" || continue; \
echo "rm -f $(libexecdir)/$$f"; \
rm "$(libexecdir)/$$f"; \
done
install-local:
./configure --prefix=/usr/local
sleep 1
make
make install
./configure --development
clean:
rm -vf $(PROGRAMS) $(DOCHTML) $(OBJECTS)
$(MAKE) -C doc clean
tags:
ctags --extra=+f \
--totals=yes \
--fields=+iaS \
--exclude=@.gitignore \
--exclude=/usr/X11 \
-R -f tags . /usr/include
dist:
tarname=$(TARNAME)-$$(git describe --tags); \
mkdir -p dist; \
if test -f dist/$$tarname.tar.gz; \
then echo "$$tarname.tar.gz already exists. not overwriting." 1>&2; \
false; \
else git archive --format=tar --prefix=$${tarname}/ HEAD | \
gzip >dist/$$tarname.tar.gz && \
echo "dist/$$tarname.tar.gz"; \
fi
.SILENT:
.PHONY: install uninstall clean tags dist