-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile.regen
123 lines (116 loc) · 3.06 KB
/
Makefile.regen
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
.PHONY: distcheck
VERSION = 0.3.14
COMPATS = compat_arc4random.c \
compat_blowfish.c \
compat_crypt_newhash.c \
compat_err.c \
compat_b64_ntop.c \
compat_explicit_bzero.c \
compat_fts.c \
compat_getprogname.c \
compat_md5.c \
compat_memmem.c \
compat_memrchr.c \
compat_mkfifoat.c \
compat_mknodat.c \
compat_readpassphrase.c \
compat_reallocarray.c \
compat_recallocarray.c \
compat_scan_scaled.c \
compat_setresgid.c \
compat_setresuid.c \
compat_sha2.c \
compat_strlcat.c \
compat_strlcpy.c \
compat_strndup.c \
compat_strnlen.c \
compat_strtonum.c \
compat_timingsafe_bcmp.c
TESTS = test-__progname.c \
test-arc4random.c \
test-blowfish.c \
test-b64_ntop.c \
test-capsicum.c \
test-crypt.c \
test-crypt_newhash.c \
test-endian_h.c \
test-err.c \
test-explicit_bzero.c \
test-fts.c \
test-getexecname.c \
test-getprogname.c \
test-INFTIM.c \
test-landlock.c \
test-lib_socket.c \
test-md5.c \
test-memmem.c \
test-memrchr.c \
test-memset_s.c \
test-mkfifoat.c \
test-mknodat.c \
test-osbyteorder_h.c \
test-PASSWORD_LEN.c \
test-PATH_MAX.c \
test-pledge.c \
test-program_invocation_short_name.c \
test-readpassphrase.c \
test-reallocarray.c \
test-recallocarray.c \
test-sandbox_init.c \
test-scan_scaled.c \
test-seccomp_filter.c \
test-setresgid.c \
test-setresuid.c \
test-sha2.c \
test-SOCK_NONBLOCK.c \
test-static.c \
test-strlcat.c \
test-strlcpy.c \
test-strndup.c \
test-strnlen.c \
test-strtonum.c \
test-sys_byteorder_h.c \
test-sys_endian_h.c \
test-sys_mkdev_h.c \
test-sys_queue.c \
test-sys_sysmacros_h.c \
test-sys_tree.c \
test-termios.c \
test-timingsafe_bcmp.c \
test-unveil.c \
test-WAIT_ANY.c
all: compats.c tests.c configure
distcheck:
grep "^## $(VERSION)$$" versions.md >/dev/null
configure: configure.in Makefile.regen configure-sys_queue.h
rm -f $@
( sed -n '/^@CONFIGURE_SYS_QUEUE_H@$$/!p;//q' configure.in ; \
sed -e 's!\\$$!\\\\!g' -e 's!\$$!\\$$!g' configure-sys_queue.h ; \
sed '1,/^@CONFIGURE_SYS_QUEUE_H@$$/d' configure.in ; ) > configure.1
( sed -n '/^@CONFIGURE_SYS_TREE_H@$$/!p;//q' configure.1 ; \
sed -e 's!\\$$!\\\\!g' -e 's!\$$!\\$$!g' configure-sys_tree.h ; \
sed '1,/^@CONFIGURE_SYS_TREE_H@$$/d' configure.1 ; ) > configure.2
sed "s!@VERSION@!$(VERSION)!g" configure.2 >$@
rm -f configure.1 configure.2
chmod 555 $@
compats.c: $(COMPATS) Makefile.regen
echo "#include \"config.h\"" >$@
for f in $(COMPATS) ; \
do \
ff="`echo $$f | sed -e 's!\.c$$!!' -e 's!^compat_!!'`" ; \
up="`echo $$ff | tr '[:lower:]' '[:upper:]'`" ; \
echo "#if !HAVE_$${up}" ; \
cat "$$f" ; \
echo "#endif /* !HAVE_$${up} */" ; \
done >>$@
tests.c: $(TESTS) Makefile.regen
for f in $(TESTS) ; \
do \
ff="`echo $$f | sed -e 's!\.c$$!!' -e 's!^test-!!'`" ; \
up="`echo $$ff | tr '[:lower:]' '[:upper:]'`" ; \
echo "#if TEST_$${up}" ; \
cat "$$f" ; \
echo "#endif /* TEST_$${up} */" ; \
done >$@
clean:
rm -f configure compats.c tests.c