-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
435 lines (360 loc) · 16.4 KB
/
Copy pathMakefile
File metadata and controls
435 lines (360 loc) · 16.4 KB
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
# rawhide - find files using pretty C expressions
# https://raf.org/rawhide
# https://github.com/raforg/rawhide
# https://codeberg.org/raforg/rawhide
#
# Copyright (C) 1990 Ken Stauffer, 2022-2023 raf <raf@raf.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <https://www.gnu.org/licenses/>.
#
# 20231013 raf <raf@raf.org>
DESTDIR =
#PREFIX = /usr
#PREFIX = /usr/pkg
#PREFIX = /usr/local
#PREFIX = /opt/local
PREFIX = /usr/local
ETCDIR = /etc
#ETCDIR = $(PREFIX)/etc
APP_INSDIR = $(PREFIX)/bin
APP_CFGDIR = $(ETCDIR)
MAN_INSDIR = $(PREFIX)/share/man
APP_MANSECT = 1
APP_MANSECTNAME = User Commands
APP_MANDIR = $(MAN_INSDIR)/man$(APP_MANSECT)
FMT_MANSECT = 5
FMT_MANSECTNAME = File Formats
FMT_MANDIR = $(MAN_INSDIR)/man$(FMT_MANSECT)
MAN_GZIP = 0
RAWHIDE_NAME = rawhide
RAWHIDE_VERSION = 3.3
RAWHIDE_DATE = 20231013
RAWHIDE_PROG_NAME = rh
RAWHIDE_ID = $(RAWHIDE_NAME)-$(RAWHIDE_VERSION)
RAWHIDE_DIST = $(RAWHIDE_ID).tar.gz
RAWHIDE_CONF = rawhide.conf
RAWHIDE_CONFD = rawhide.conf.d
RAWHIDE_CONFD_ATTRIBUTES = attributes
RAWHIDE_CONFD_ATTRIBUTES_LINUX = attributes.linux
RAWHIDE_CONFD_ATTRIBUTES_RESERVE = attributes.reserve # Linux only
RAWHIDE_CONFD_ATTRIBUTES_FREEBSD = attributes.freebsd
RAWHIDE_CONFD_ATTRIBUTES_OPENBSD = attributes.openbsd
RAWHIDE_CONFD_ATTRIBUTES_NETBSD = attributes.netbsd
RAWHIDE_CONFD_ATTRIBUTES_MACOS = attributes.macos
RAWHIDE_CONFD_ATTRIBUTES_SOLARIS = attributes.solaris
RAWHIDE_APP_MANFILE = $(RAWHIDE_PROG_NAME).$(APP_MANSECT)
RAWHIDE_FMT_MANFILE = $(RAWHIDE_CONF).$(FMT_MANSECT)
RAWHIDE_PROG_NAME_UPPER = RH
RAWHIDE_CONF_UPPER = RAWHIDE.CONF
# Note: Changing the MAX defines breaks t12 parser error tests, so run them first.
# With MAX_*_SIZE at default values, RSS is 6.5M and VSZ is 46.6M (on a VM).
# Reducing MAX_*_SIZE to 1/10 reduces RSS to 4.5M and VSZ to 12.1M.
# Reducing MAX_*_SIZE to 1/100 reduces RSS to 2.6M and VSZ to 8.7M.
# They're all fine choices. The default is probably overkill.
# Reducing to 1/1000 made no further difference, and could be too small.
# With GNU find(1), RSS is 4.4M and VSZ is 9.2M for the same task.
#
# See ./configure --static=SIZE (large=default, small=1/10, tiny=1/100)
RAWHIDE_DEFINES = \
-DETCDIR=\"$(ETCDIR)\" \
-DRAWHIDE_NAME=\"$(RAWHIDE_NAME)\" \
-DRAWHIDE_PROG_NAME=\"$(RAWHIDE_PROG_NAME)\" \
-DRAWHIDE_VERSION=\"$(RAWHIDE_VERSION)\" \
-DRAWHIDE_DATE=\"$(RAWHIDE_DATE)\" \
# -DMAX_PROGRAM_SIZE=2000000 \
# -DMAX_STACK_SIZE=1000000 \
# -DMAX_DATA_SIZE=200000 \
# -DMAX_FILEREF_SIZE=10000 \
# -DMAX_IDENT_LENGTH=200
# Perl-compatible regular expressions (regexes)
#PCRE2_DEFINES =
#PCRE2_CFLAGS =
#PCRE2_LDFLAGS =
# Access control lists
#ACL_DEFINES =
#ACL_CFLAGS =
#ACL_LDFLAGS =
# Extended attributes
#EA_DEFINES =
#EA_CFLAGS =
#EA_LDFLAGS =
# Linux ext2-style file attributes (like FreeBSD/OpenBSD/NetBSD/macOS file flags)
#ATTR_DEFINES =
#ATTR_CFLAGS =
#ATTR_LDFLAGS =
# FreeBSD/OpenBSD/NetBSD/macOS file flags (like Linux file attributes)
#FLAG_DEFINES =
#FLAG_CFLAGS =
#FLAG_LDFLAGS =
# Solaris file attributes (like Linux file attributes and FreeBSD/OpenBSD/NetBSD/macOS file flags) and birth/created time
#SOLARIS_ATTR_DEFINES =
#SOLARIS_ATTR_CFLAGS =
#SOLARIS_ATTR_LDFLAGS =
# File type and mimetype identification by libmagic
#MAGIC_DEFINES =
#MAGIC_CFLAGS =
#MAGIC_LDFLAGS =
# For major() and minor() on Linux
#HAVE_SYS_SYSMACROS = -DHAVE_SYS_SYSMACROS=1
# For major() and minor() on Solaris
#HAVE_SYS_MKDEV = -DHAVE_SYS_MKDEV=1
# For timestamp nanoseconds on Linux, FreeBSD, OpenBSD, NetBSD, Solaris, Cygwin
#HAVE_POSIX_NSEC = -DHAVE_POSIX_NSEC=1
# For timestamp nanoseconds on macOS
#HAVE_SPEC_NSEC = -DHAVE_SPEC_NSEC=1
# For birthtime on Linux
#HAVE_STATX_BTIME = -DHAVE_STATX_BTIME=1
# For birthtime on FreeBSD, NetBSD (zero), Cygwin
#HAVE_POSIX_BTIME = -DHAVE_POSIX_BTIME=1
# For birthtime on macOS
#HAVE_SPEC_BTIME = -DHAVE_SPEC_BTIME=1
# Uncomment this to exclude debug code (~10%/12KiB smaller stripped binary)
# Note: This breaks the "invalid -? option argument: wrong" test in t20 (OK)
#DEBUG_DEFINES = -DNDEBUG
# Test coverage (gcov): Uncomment this, run tests (as non-root and as root),
# then run gcov *.c then examine *.c.gcov or run gcov_summary (98.75% on Linux)
#GCOV_CFLAGS = -fprofile-arcs -ftest-coverage
# Undefined behaviour sanitizer: Uncomment this, run tests (as non-root and as root)
#UBSAN_CFLAGS = -fsanitize=undefined
#UBSAN_LDFLAGS = -fsanitize=undefined
# Address sanitizer for gcc: Uncomment this, run tests (as non-root and as root)
#ASAN_CFLAGS = -fsanitize=address
#ASAN_LDFLAGS = -fsanitize=address -static-libasan
# Address sanitizer for clang: Uncomment this, run tests (as non-root and as root)
#SAN_CFLAGS = -fsanitize=address
#SAN_LDFLAGS = -fsanitize=address -static-libsan
# Memory sanitizer: Uncomment this, run tests (as non-root and as root)
#MSAN_CFLAGS = -fsanitize=memory
#MSAN_LDFLAGS = -fsanitize=memory
CC = cc
#CC = gcc
#CC = other
ALL_CPPFLAGS = $(CPPFLAGS) $(RAWHIDE_DEFINES) $(PCRE2_DEFINES) $(ACL_DEFINES) $(EA_DEFINES) $(ATTR_DEFINES) $(FLAG_DEFINES) $(SOLARIS_ATTR_DEFINES) $(MAGIC_DEFINES) $(DEBUG_DEFINES) $(HAVE_SYS_SYSMACROS) $(HAVE_SYS_MKDEV) $(HAVE_POSIX_NSEC) $(HAVE_SPEC_NSEC) $(HAVE_STATX_BTIME) $(HAVE_POSIX_BTIME) $(HAVE_SPEC_BTIME)
ALL_CFLAGS = -O3 -g -Wall -pedantic $(CFLAGS) $(ALL_CPPFLAGS) $(PCRE2_CFLAGS) $(ACL_CFLAGS) $(EA_CFLAGS) $(ATTR_CFLAGS) $(FLAG_CFLAGS) $(SOLARIS_ATTR_CFLAGS) $(MAGIC_CFLAGS) $(GCOV_CFLAGS) $(UBSAN_CFLAGS) $(ASAN_CFLAGS) $(SAN_CFLAGS)
ALL_LDFLAGS = $(LDFLAGS) $(PCRE2_LDFLAGS) $(ACL_LDFLAGS) $(EA_LDLAGS) $(ATTR_LDFLAGS) $(FLAG_LDFLAGS) $(SOLARIS_ATTR_LDFLAGS) $(MAGIC_LDFLAGS) $(UBSAN_LDFLAGS) $(ASAN_LDFLAGS) $(SAN_LDFLAGS)
OBJS = rhcmds.o rh.o rhparse.o rhdir.o rhdata.o rhstr.o rherr.o rhfnmatch.o rhgetopt.o
all: $(RAWHIDE_PROG_NAME)
$(RAWHIDE_PROG_NAME): Makefile $(OBJS)
$(CC) $(ALL_CFLAGS) -o $(RAWHIDE_PROG_NAME) $(OBJS) $(ALL_LDFLAGS)
rh.o: Makefile rh.c rh.h rhparse.h rhdata.h rhdir.h rhstr.h rherr.h rhfnmatch.h rhgetopt.h
$(CC) $(ALL_CFLAGS) -c rh.c
rhcmds.o: Makefile rhcmds.c rh.h rhdir.h rherr.h rhstr.h
$(CC) $(ALL_CFLAGS) -c rhcmds.c
rhdata.o: Makefile rhdata.c rh.h rhdata.h rhcmds.h rherr.h
$(CC) $(ALL_CFLAGS) -c rhdata.c
rhdir.o: Makefile rhdir.c rh.h rhdata.h rhcmds.h rhdir.h rhstr.h rherr.h
$(CC) $(ALL_CFLAGS) -c rhdir.c
rherr.o: Makefile rherr.c rh.h
$(CC) $(ALL_CFLAGS) -c rherr.c
rhparse.o: Makefile rhparse.c rh.h rhdata.h rhcmds.h rhstr.h
$(CC) $(ALL_CFLAGS) -c rhparse.c
rhstr.o: Makefile rhstr.c rh.h rhstr.h
$(CC) $(ALL_CFLAGS) -c rhstr.c
rhfnmatch.o: Makefile rhfnmatch.c rhfnmatch.h
$(CC) $(ALL_CFLAGS) -c rhfnmatch.c
rhgetopt.o: Makefile rhgetopt.c rhgetopt.h
$(CC) $(ALL_CFLAGS) -c rhgetopt.c
clean:
rm -rf $(RAWHIDE_PROG_NAME) $(OBJS) tags $(RAWHIDE_APP_MANFILE).html $(RAWHIDE_FMT_MANFILE).html README.html CONTRIBUTING.html tests/.t[0-9][0-9]*
@rm -f valgrind.out *.gcda *.gcno *.gcov
clobber: clean
rm -f $(RAWHIDE_APP_MANFILE) $(RAWHIDE_FMT_MANFILE)
install: install-bin install-config install-man
install-bin:
mkdir -p $(DESTDIR)$(APP_INSDIR)
cp $(RAWHIDE_PROG_NAME) $(DESTDIR)$(APP_INSDIR)
chmod 755 $(DESTDIR)$(APP_INSDIR)/$(RAWHIDE_PROG_NAME)
strip $(DESTDIR)$(APP_INSDIR)/$(RAWHIDE_PROG_NAME)
install-config:
mkdir -p $(DESTDIR)$(APP_CFGDIR)
cp $(RAWHIDE_CONF) $(DESTDIR)$(APP_CFGDIR)
chmod 644 $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONF)
mkdir -p $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD)
case "`uname`" in \
Linux) \
if ./$(RAWHIDE_PROG_NAME) -h | grep -wq attr; \
then \
cp $(RAWHIDE_CONFD_ATTRIBUTES_LINUX) $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD)/$(RAWHIDE_CONFD_ATTRIBUTES); \
else \
cp $(RAWHIDE_CONFD_ATTRIBUTES_RESERVE) $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD)/$(RAWHIDE_CONFD_ATTRIBUTES); \
fi; \
chmod 644 $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD)/$(RAWHIDE_CONFD_ATTRIBUTES); \
;; \
FreeBSD) \
cp $(RAWHIDE_CONFD_ATTRIBUTES_FREEBSD) $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD)/$(RAWHIDE_CONFD_ATTRIBUTES); \
chmod 644 $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD)/$(RAWHIDE_CONFD_ATTRIBUTES); \
;; \
OpenBSD) \
cp $(RAWHIDE_CONFD_ATTRIBUTES_OPENBSD) $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD)/$(RAWHIDE_CONFD_ATTRIBUTES); \
chmod 644 $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD)/$(RAWHIDE_CONFD_ATTRIBUTES); \
;; \
NetBSD) \
cp $(RAWHIDE_CONFD_ATTRIBUTES_NETBSD) $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD)/$(RAWHIDE_CONFD_ATTRIBUTES); \
chmod 644 $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD)/$(RAWHIDE_CONFD_ATTRIBUTES); \
;; \
Darwin) \
cp $(RAWHIDE_CONFD_ATTRIBUTES_MACOS) $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD)/$(RAWHIDE_CONFD_ATTRIBUTES); \
chmod 644 $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD)/$(RAWHIDE_CONFD_ATTRIBUTES); \
;; \
SunOS|Solaris) \
cp $(RAWHIDE_CONFD_ATTRIBUTES_SOLARIS) $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD)/$(RAWHIDE_CONFD_ATTRIBUTES); \
chmod 644 $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD)/$(RAWHIDE_CONFD_ATTRIBUTES); \
;; \
esac
install-man: install-man-app install-man-fmt
install-man-app: $(RAWHIDE_APP_MANFILE)
mkdir -p $(DESTDIR)$(APP_MANDIR)
cp $(RAWHIDE_APP_MANFILE) $(DESTDIR)$(APP_MANDIR)
chmod 644 $(DESTDIR)$(APP_MANDIR)/$(RAWHIDE_APP_MANFILE)
[ "$(MAN_GZIP)" = 0 ] || rm -f $(DESTDIR)$(APP_MANDIR)/$(RAWHIDE_APP_MANFILE).gz
[ "$(MAN_GZIP)" = 0 ] || gzip $(DESTDIR)$(APP_MANDIR)/$(RAWHIDE_APP_MANFILE)
install-man-fmt: $(RAWHIDE_FMT_MANFILE)
mkdir -p $(DESTDIR)$(FMT_MANDIR)
cp $(RAWHIDE_FMT_MANFILE) $(DESTDIR)$(FMT_MANDIR)
chmod 644 $(DESTDIR)$(FMT_MANDIR)/$(RAWHIDE_FMT_MANFILE)
[ "$(MAN_GZIP)" = 0 ] || rm -f $(DESTDIR)$(FMT_MANDIR)/$(RAWHIDE_FMT_MANFILE).gz
[ "$(MAN_GZIP)" = 0 ] || gzip $(DESTDIR)$(FMT_MANDIR)/$(RAWHIDE_FMT_MANFILE)
uninstall: uninstall-bin uninstall-config uninstall-man
uninstall-bin:
[ ! -f $(DESTDIR)$(APP_INSDIR)/$(RAWHIDE_PROG_NAME) ] || rm $(DESTDIR)$(APP_INSDIR)/$(RAWHIDE_PROG_NAME)
uninstall-config:
[ ! -f $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONF) ] || rm $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONF)
[ ! -f $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD)/$(RAWHIDE_CONFD_ATTRIBUTES) ] || rm $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD)/$(RAWHIDE_CONFD_ATTRIBUTES)
-[ ! -d $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD) ] || rmdir $(DESTDIR)$(APP_CFGDIR)/$(RAWHIDE_CONFD)
uninstall-man: uninstall-man-app uninstall-man-fmt
uninstall-man-app:
[ ! -f $(DESTDIR)$(APP_MANDIR)/$(RAWHIDE_APP_MANFILE) ] || rm $(DESTDIR)$(APP_MANDIR)/$(RAWHIDE_APP_MANFILE)
[ ! -f $(DESTDIR)$(APP_MANDIR)/$(RAWHIDE_APP_MANFILE).gz ] || rm $(DESTDIR)$(APP_MANDIR)/$(RAWHIDE_APP_MANFILE).gz
uninstall-man-fmt:
[ ! -f $(DESTDIR)$(FMT_MANDIR)/$(RAWHIDE_FMT_MANFILE) ] || rm $(DESTDIR)$(FMT_MANDIR)/$(RAWHIDE_FMT_MANFILE)
[ ! -f $(DESTDIR)$(FMT_MANDIR)/$(RAWHIDE_FMT_MANFILE).gz ] || rm $(DESTDIR)$(FMT_MANDIR)/$(RAWHIDE_FMT_MANFILE).gz
man: $(RAWHIDE_APP_MANFILE) $(RAWHIDE_FMT_MANFILE)
html: $(RAWHIDE_APP_MANFILE).html $(RAWHIDE_FMT_MANFILE).html
$(RAWHIDE_APP_MANFILE): $(RAWHIDE_APP_MANFILE).pod
sed 's/C</B</g' $(RAWHIDE_APP_MANFILE).pod | pod2man --section='$(APP_MANSECT)' --center='$(APP_MANSECTNAME)' --name='$(RAWHIDE_PROG_NAME_UPPER)' --release='$(RAWHIDE_ID)' --date='$(RAWHIDE_DATE)' --quotes=none > $@
$(RAWHIDE_APP_MANFILE).html: $(RAWHIDE_APP_MANFILE).pod
pod2html --noindex --title='$(RAWHIDE_ID) - $(RAWHIDE_PROG_NAME)($(APP_MANSECT))' < $(RAWHIDE_APP_MANFILE).pod > $@ 2>/dev/null
rm -r pod2htm*.tmp
$(RAWHIDE_FMT_MANFILE): $(RAWHIDE_FMT_MANFILE).pod
sed 's/C</B</g' $(RAWHIDE_FMT_MANFILE).pod | pod2man --section='$(FMT_MANSECT)' --center='$(FMT_MANSECTNAME)' --name='$(RAWHIDE_CONF_UPPER)' --release='$(RAWHIDE_ID)' --date='$(RAWHIDE_DATE)' --quotes=none > $@
$(RAWHIDE_FMT_MANFILE).html: $(RAWHIDE_FMT_MANFILE).pod
pod2html --noindex --title='$(RAWHIDE_ID) - $(RAWHIDE_CONF)($(FMT_MANSECT))' < $(RAWHIDE_FMT_MANFILE).pod > $@ 2>/dev/null
rm -r pod2htm*.tmp
# html2 is for internal use (requires python3 and its markdown module)
html2: README.html CONTRIBUTING.html
README.html: README.md
./md2html README.md $@ '$(RAWHIDE_ID) - README'
CONTRIBUTING.html: CONTRIBUTING.md
./md2html CONTRIBUTING.md $@ '$(RAWHIDE_ID) - CONTRIBUTING'
tags: Makefile rh.h rh.c rhcmds.h rhcmds.c rhdata.h rhdata.c rhdir.h rhdir.c rhparse.h rhparse.c rherr.h rherr.c rhstr.h rhstr.c rhfnmatch.h rhfnmatch.c rhgetopt.h rhgetopt.c
ctags Makefile rh.h rh.c rhcmds.h rhcmds.c rhdata.h rhdata.c rhdir.h rhdir.c rhparse.h rhparse.c rherr.h rherr.c rhstr.h rhstr.c rhfnmatch.h rhfnmatch.c rhgetopt.h rhgetopt.c
test: $(RAWHIDE_PROG_NAME)
./runtests
gcov:
gcov *.c; ./gcov_summary
check: test
tests: test
default:
./configure --default
dist: clobber man default
@set -e; \
up="`pwd`/.."; \
src=`basename \`pwd\``; \
dst=$(RAWHIDE_ID); \
cd ..; \
[ "$$src" != "$$dst" -a ! -d "$$dst" ] && ln -s $$src $$dst; \
tar chzf $$up/$(RAWHIDE_DIST) --exclude='.git*' $$dst; \
[ -h "$$dst" ] && rm -f $$dst; \
tar tzfv $$up/$(RAWHIDE_DIST); \
ls -l $$up/$(RAWHIDE_DIST)
help:
@echo "First, see: ./configure --help"
@echo
@echo " ./configure - Configure for the local system"
@echo " make - Compile rh"
@echo " sudo make install - Install rh"
@echo " sudo make uninstall - Uninstall rh"
@echo
@echo "To run tests (quiet, verbose, valgrind):"
@echo
@echo " make test - Run tests with just one line per test suite"
@echo " make quiet=0 test - Run tests showing every test (thousands)"
@echo " make vg=1 test - Run tests and produce valgrind.out analysis (~2h)"
@echo " vim valgrind.out - Examine the results (delete the noise, check the rest)"
@echo
@echo "To run tests for test coverage analysis (98.75% on Linux):"
@echo
@echo " ./configure --enable-gcov"
@echo " make"
@echo " make test"
@echo " sudo make RAWHIDE_TEST_MULTIBYTE_USER_GROUP=1 test"
@echo " make gcov"
@echo
@echo "But be warned that including RAWHIDE_TEST_MULTIBYTE_USER_GROUP=1 above"
@echo "includes tests that add and remove new users and groups (Linux only)."
@echo "Note: Do not install the resulting binary."
@echo
@echo "To run tests with the undefined behaviour sanitizer:"
@echo
@echo " ./configure --enable-ubsan"
@echo " make"
@echo " make ubsan=1 test"
@echo " sudo make ubsan=1 RAWHIDE_TEST_MULTIBYTE_USER_GROUP=1 test"
@echo
@echo "The ubsan=1 variable suppresses a test that deliberately performs"
@echo "an integer overflow in the search criteria."
@echo "Note: Do not install the resulting binary."
@echo
@echo "To run tests with the address sanitizer (like valgrind but fast):"
@echo
@echo " ./configure --enable-asan"
@echo " make"
@echo " make test"
@echo " sudo make asan=1 RAWHIDE_TEST_MULTIBYTE_USER_GROUP=1 test"
@echo
@echo "To run tests with the memory sanitizer (like valgrind but fast):"
@echo
@echo " ./configure --enable-msan"
@echo " make"
@echo " make test"
@echo " sudo make RAWHIDE_TEST_MULTIBYTE_USER_GROUP=1 test"
@echo
@echo "The asan=1 variable suppresses setuid/setgid tests that would trigger a"
@echo "fatal error for the LeakSanitizer which doesn't work with setuid/setgid"
@echo "programs."
@echo "Note: Do not install the resulting binary."
@echo
@echo "Other make targets:"
@echo
@echo " help - Show this information"
@echo " dist - Create the source distribution in .."
@echo " clean - Delete everything except the manual entries"
@echo " clobber - Delete the manual entries as well"
@echo " man - Create the manual entries (needs pod2man)"
@echo " tags - Create the tags file for vim (needs ctags)"
@echo " html - Create manual entries as HTML (needs pod2html)"
@echo " html2 - Create README/CONTRIBUTING as HTML (needs python3, markdown module)"
@echo " check - Same as test"
@echo " tests - Same as test"
@echo " default - Reset Makefile to its default configuration"
@echo
@echo "See also:"
@echo
@echo " samples/README - Explains the optional files below"
@echo " samples/.rh.sh - Shell functions/aliases to save keystrokes"
@echo " samples/brevity.rh - Extra concise aliases for some built-ins"
@echo " samples/rawhide.conf-tiny - Small rawhide.conf for use with tiny static size"
@echo " samples/perlsh - Wrapper script to adapt perl for use with .ush"
@echo
# vi:set ts=4 sw=4: