Makefile - sbase - suckless unix tools
(HTM) git clone git://git.suckless.org/sbase
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
Makefile (4129B)
---
1 .POSIX:
2 include config.mk
3
4 .SUFFIXES:
5 .SUFFIXES: .y .o .c
6
7 CPPFLAGS =\
8 -DPREFIX=\"$(PREFIX)\" \
9 -D_DEFAULT_SOURCE \
10 -D_NETBSD_SOURCE \
11 -D_BSD_SOURCE \
12 -D_XOPEN_SOURCE=700 \
13 -D_FILE_OFFSET_BITS=64
14
15 HDR =\
16 arg.h\
17 compat.h\
18 crypt.h\
19 fs.h\
20 md5.h\
21 queue.h\
22 sha1.h\
23 sha224.h\
24 sha256.h\
25 sha384.h\
26 sha512.h\
27 sha512-224.h\
28 sha512-256.h\
29 text.h\
30 utf.h\
31 util.h
32
33 LIBUTFOBJ =\
34 libutf/fgetrune.o\
35 libutf/fputrune.o\
36 libutf/isalnumrune.o\
37 libutf/isalpharune.o\
38 libutf/isblankrune.o\
39 libutf/iscntrlrune.o\
40 libutf/isdigitrune.o\
41 libutf/isgraphrune.o\
42 libutf/isprintrune.o\
43 libutf/ispunctrune.o\
44 libutf/isspacerune.o\
45 libutf/istitlerune.o\
46 libutf/isxdigitrune.o\
47 libutf/lowerrune.o\
48 libutf/rune.o\
49 libutf/runetype.o\
50 libutf/upperrune.o\
51 libutf/utf.o\
52 libutf/utftorunestr.o
53
54 LIBUTILOBJ =\
55 libutil/concat.o\
56 libutil/cp.o\
57 libutil/crypt.o\
58 libutil/confirm.o\
59 libutil/ealloc.o\
60 libutil/enmasse.o\
61 libutil/eprintf.o\
62 libutil/eregcomp.o\
63 libutil/estrtod.o\
64 libutil/fnck.o\
65 libutil/fshut.o\
66 libutil/getlines.o\
67 libutil/human.o\
68 libutil/linecmp.o\
69 libutil/md5.o\
70 libutil/memmem.o\
71 libutil/mkdirp.o\
72 libutil/mode.o\
73 libutil/parseoffset.o\
74 libutil/putword.o\
75 libutil/reallocarray.o\
76 libutil/recurse.o\
77 libutil/rm.o\
78 libutil/sha1.o\
79 libutil/sha224.o\
80 libutil/sha256.o\
81 libutil/sha384.o\
82 libutil/sha512.o\
83 libutil/sha512-224.o\
84 libutil/sha512-256.o\
85 libutil/strcasestr.o\
86 libutil/strlcat.o\
87 libutil/strlcpy.o\
88 libutil/strsep.o\
89 libutil/strnsubst.o\
90 libutil/strtonum.o\
91 libutil/unescape.o\
92 libutil/writeall.o
93
94 LIB = libutf.a libutil.a
95
96 BIN =\
97 basename\
98 bc\
99 cal\
100 cat\
101 chgrp\
102 chmod\
103 chown\
104 chroot\
105 cksum\
106 cmp\
107 cols\
108 comm\
109 cp\
110 cron\
111 cut\
112 date\
113 dd\
114 dirname\
115 du\
116 echo\
117 ed\
118 env\
119 expand\
120 expr\
121 false\
122 find\
123 flock\
124 fold\
125 getconf\
126 grep\
127 head\
128 hostname\
129 join\
130 kill\
131 link\
132 ln\
133 logger\
134 logname\
135 ls\
136 make/make\
137 md5sum\
138 mkdir\
139 mkfifo\
140 mknod\
141 mktemp\
142 mv\
143 nice\
144 nl\
145 nohup\
146 od\
147 paste\
148 pathchk\
149 printenv\
150 printf\
151 pwd\
152 readlink\
153 renice\
154 rev\
155 rm\
156 rmdir\
157 sed\
158 seq\
159 setsid\
160 sha1sum\
161 sha224sum\
162 sha256sum\
163 sha384sum\
164 sha512sum\
165 sha512-224sum\
166 sha512-256sum\
167 sleep\
168 sort\
169 split\
170 sponge\
171 strings\
172 sync\
173 tail\
174 tar\
175 tee\
176 test\
177 tftp\
178 time\
179 touch\
180 tr\
181 true\
182 tsort\
183 tty\
184 uname\
185 unexpand\
186 uniq\
187 unlink\
188 uudecode\
189 uuencode\
190 wc\
191 which\
192 whoami\
193 xargs\
194 xinstall\
195 yes
196
197 MAKEOBJ =\
198 make/defaults.o\
199 make/main.o\
200 make/parser.o\
201 make/posix.o\
202 make/rules.o\
203
204 OBJ = $(LIBUTFOBJ) $(LIBUTILOBJ) $(MAKEOBJ)
205
206 all: scripts/make
207 +@$(SMAKE) $(BIN)
208
209 scripts/make:
210 $(CC) -o $@ make/*.c
211
212 $(BIN): $(LIB)
213
214 $(OBJ) $(BIN): $(HDR)
215
216 .o:
217 $(CC) $(LDFLAGS) -o $@ $< $(LIB)
218
219 .c.o:
220 $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
221
222 .c:
223 $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIB)
224
225 bc: bc.c
226 $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ bc.c $(LIB)
227
228 $(MAKEOBJ): make/make.h
229
230 make/make: $(MAKEOBJ)
231 $(CC) $(LDFLAGS) -o $@ $(MAKEOBJ) $(LIB)
232
233 libutf.a: $(LIBUTFOBJ)
234 $(AR) $(ARFLAGS) $@ $?
235 $(RANLIB) $@
236
237 libutil.a: $(LIBUTILOBJ)
238 $(AR) $(ARFLAGS) $@ $?
239 $(RANLIB) $@
240
241 getconf: getconf.h
242
243 getconf.h:
244 scripts/getconf.sh > $@
245
246 proto: $(BIN)
247 scripts/mkproto $(DESTDIR)$(PREFIX) $(DESTDIR)$(MANPREFIX) proto
248
249 install uninstall: proto
250 scripts/$@ proto
251
252 sbase-box-install: sbase-box proto
253 scripts/install proto
254 $(DESTDIR)$(PREFIX)/bin/sbase-box -i $(DESTDIR)$(PREFIX)/bin/
255
256 sbase-box-uninstall: sbase-box proto
257 $(DESTDIR)$(PREFIX)/bin/sbase-box -d $(DESTDIR)$(PREFIX)/bin/
258 scripts/uninstall proto
259
260 tests: all
261 @cd $@ && $(MAKE)
262
263 dist: clean
264 mkdir -p sbase
265 cp LICENSE Makefile README TODO config.mk *.c *.1 *.h sbase
266 cp -R libutf libutil make scripts tests sbase
267 mv sbase sbase-$(VERSION)
268 tar -cf sbase-$(VERSION).tar sbase-$(VERSION)
269 gzip sbase-$(VERSION).tar
270 rm -rf sbase-$(VERSION)
271
272 sbase-box: $(BIN)
273 scripts/mkbox
274 $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ build/*.c $(LIB)
275
276 clean:
277 @cd tests && $(MAKE) clean
278 rm -f $(BIN) $(OBJ) $(LIB) sbase-box sbase-$(VERSION).tar.gz
279 rm -f scripts/make
280 rm -f getconf.h bc.c
281 rm -f proto
282 rm -rf build
283
284 .PHONY: all install uninstall dist sbase-box-install sbase-box-uninstall clean