Commit 54fdfc960a631efcc4eab44d2289e844f7a790ee

Thomas de Grivel 2023-01-20T19:58:39

rename files

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
diff --git a/c3s/Makefile b/c3s/Makefile
index 52ad7b3..a25ab5d 100644
--- a/c3s/Makefile
+++ b/c3s/Makefile
@@ -11,7 +11,7 @@
 ## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
 ## THIS SOFTWARE.
 
-CLEANFILES = *.a c3s c3s.asan c3s.cov c3s.debug *.css *.gcno *.html *.o .libs *.lo
+CLEANFILES = *.a c3s c3s_asan c3s_cov c3s_debug *.css *.gcno *.html *.o .libs *.lo
 
 CLEANFILES_COV = *.css *.gcda *.html .libs/*.gcda
 CLEANFILES += ${CLEANFILES_COV}
@@ -26,7 +26,7 @@ all:
 	${MAKE} debug
 	if ${HAVE_ASAN}; then ${MAKE} asan; fi
 
-asan: c3s.asan
+asan: c3s_asan
 
 clean:
 	rm -rf ${CLEANFILES}
@@ -34,9 +34,9 @@ clean:
 clean_cov:
 	rm -rf ${CLEANFILES_COV}
 
-cov:   c3s.cov
+cov:   c3s_cov
 
-debug: c3s.debug
+debug: c3s_debug
 
 distclean:
 	rm -rf ${DISTCLEANFILES}
@@ -45,7 +45,7 @@ gcovr:
 	gcovr --gcov-executable ${GCOV} --html-details c3s.html
 
 gdb_c3s: debug
-	if [ -f c3s.debug.core ]; then gdb c3s.debug c3s.debug.core; else gdb c3s.debug; fi
+	if [ -f c3s_debug.core ]; then gdb c3s_debug c3s_debug.core; else gdb c3s_debug; fi
 
 install:
 	install -m 755 c3s ${PREFIX}/bin
diff --git a/c3s/configure b/c3s/configure
index 20a3266..f781fdc 100755
--- a/c3s/configure
+++ b/c3s/configure
@@ -14,12 +14,14 @@
 
 set -e
 
+export SRC_TOP="$(pwd)/.."
+
 . ../config.subr
 
 PROG=c3s
-PROG_ASAN=c3s.asan
-PROG_COV=c3s.cov
-PROG_DEBUG=c3s.debug
+PROG_ASAN=c3s_asan
+PROG_COV=c3s_cov
+PROG_DEBUG=c3s_debug
 
 . ./sources.sh
 
@@ -55,19 +57,19 @@ pkg_config libmd
 # Asan config
 CFLAGS_ASAN="$CFLAGS -fsanitize=address -O1 -fno-omit-frame-pointer -g"
 LDFLAGS_ASAN="$LDFLAGS"
-LIBC3_ASAN=../libc3/libc3.asan.a
+LIBC3_ASAN=../libc3/libc3_asan.a
 LIBS_ASAN="$LIBC3_ASAN $LIBS"
 
 # Coverage config
 CFLAGS_COV="$CFLAGS -ftest-coverage -fprofile-arcs"
 LDFLAGS_COV="$LDFLAGS"
-LIBC3_COV=../libc3/libc3.cov.a
+LIBC3_COV=../libc3/libc3_cov.a
 LIBS_COV="$LIBC3_COV $LIBS"
 
 # Debug config
 CFLAGS_DEBUG="$CFLAGS -DDEBUG -O0 -ggdb"
 LDFLAGS_DEBUG="$LDFLAGS"
-LIBC3_DEBUG=../libc3/libc3.debug.a
+LIBC3_DEBUG=../libc3/libc3_debug.a
 LIBS_DEBUG="$LIBC3_DEBUG $LIBS"
 
 # Main config
diff --git a/config.subr b/config.subr
index eeac8f6..5ff4699 100644
--- a/config.subr
+++ b/config.subr
@@ -1,6 +1,6 @@
 #!/bin/sh
 ## c3
-## Copyright 2022 kmx.io <contact@kmx.io>
+## Copyright 2022,2023 kmx.io <contact@kmx.io>
 ##
 ## Permission is hereby granted to use this software excepted
 ## on Apple computers granted the above copyright notice and
@@ -11,7 +11,6 @@
 ## PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
 ## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
 ## THIS SOFTWARE.
-
 set -e
 
 echo "$(basename "$PWD")/$(basename "$0")"
@@ -122,7 +121,7 @@ SOURCES_SH=".sources.sh.tmp"
 
 VER=0.1
 echo "VER = $VER" >> ${CONFIG_MK}
-echo "C3_TOP = $C3_TOP" >> ${CONFIG_MK}
+echo "SRC_TOP = $SRC_TOP" >> ${CONFIG_MK}
 
 if [ "x$CC" = "x" ]; then
     if test -n $(which cc); then
@@ -170,13 +169,7 @@ if [ "x$LIBTOOL" = "x" ]; then
 fi
 echo "LIBTOOL = $LIBTOOL" >> ${CONFIG_MK}
 
-if [ "x$PREFIX" = "x" ]; then
-    if [ -d "$HOME/.c3" ]; then
-        PREFIX="$HOME/.c3"
-    else
-        PREFIX=/usr/local
-    fi
-fi
+PREFIX="${PREFIX:-/usr/local}"
 echo "PREFIX = $PREFIX" >> ${CONFIG_MK}
 
 if [ "x$OWNER" = "x" ]; then
diff --git a/configure b/configure
index 9d092b1..e694ae4 100755
--- a/configure
+++ b/configure
@@ -14,9 +14,9 @@
 
 set -e
 
-export C3_TOP="$(pwd)"
+export SRC_TOP="$(pwd)"
 
-PREFIX=${PREFIX:-/usr/local}
+PREFIX="${PREFIX:-/usr/local}"
 if [ "x$1" = "x--prefix" ]; then
     PREFIX="$2"
     shift 2
diff --git a/ic3/Makefile b/ic3/Makefile
index 94487fe..536c96d 100644
--- a/ic3/Makefile
+++ b/ic3/Makefile
@@ -11,7 +11,7 @@
 ## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
 ## THIS SOFTWARE.
 
-CLEANFILES = *.a ic3 ic3.asan ic3.cov ic3.debug *.css *.gcno *.html *.o .libs *.lo
+CLEANFILES = *.a ic3 ic3_asan ic3_cov ic3_debug *.css *.gcno *.html *.o .libs *.lo
 
 CLEANFILES_COV = *.css *.gcda *.html .libs/*.gcda
 CLEANFILES += ${CLEANFILES_COV}
@@ -26,7 +26,7 @@ all:
 	${MAKE} debug
 	if ${HAVE_ASAN}; then ${MAKE} asan; fi
 
-asan: ic3.asan
+asan: ic3_asan
 
 clean:
 	rm -rf ${CLEANFILES}
@@ -34,9 +34,9 @@ clean:
 clean_cov:
 	rm -rf ${CLEANFILES_COV}
 
-cov:   ic3.cov
+cov:   ic3_cov
 
-debug: ic3.debug
+debug: ic3_debug
 
 distclean:
 	rm -rf ${DISTCLEANFILES}
@@ -45,7 +45,7 @@ gcovr:
 	gcovr --gcov-executable ${GCOV} --html-details ic3.html
 
 gdb_ic3: debug
-	if [ -f ic3.debug.core ]; then gdb ic3.debug ic3.debug.core; else gdb ic3.debug; fi
+	if [ -f ic3_debug.core ]; then gdb ic3_debug ic3_debug.core; else gdb ic3_debug; fi
 
 install:
 	install -m 755 ic3 ${PREFIX}/bin
diff --git a/ic3/configure b/ic3/configure
index 14151aa..00d0af0 100755
--- a/ic3/configure
+++ b/ic3/configure
@@ -14,12 +14,14 @@
 
 set -e
 
+export SRC_TOP="$(pwd)/.."
+
 . ../config.subr
 
 PROG=ic3
-PROG_ASAN=ic3.asan
-PROG_COV=ic3.cov
-PROG_DEBUG=ic3.debug
+PROG_ASAN=ic3_asan
+PROG_COV=ic3_cov
+PROG_DEBUG=ic3_debug
 
 . ./sources.sh
 
@@ -55,19 +57,19 @@ pkg_config libmd
 # Asan config
 CFLAGS_ASAN="$CFLAGS -fsanitize=address -O1 -fno-omit-frame-pointer -g"
 LDFLAGS_ASAN="$LDFLAGS"
-LIBC3_ASAN=../libc3/libc3.asan.a
+LIBC3_ASAN=../libc3/libc3_asan.a
 LIBS_ASAN="$LIBC3_ASAN $LIBS"
 
 # Coverage config
 CFLAGS_COV="$CFLAGS -ftest-coverage -fprofile-arcs"
 LDFLAGS_COV="$LDFLAGS"
-LIBC3_COV=../libc3/libc3.cov.a
+LIBC3_COV=../libc3/libc3_cov.a
 LIBS_COV="$LIBC3_COV $LIBS"
 
 # Debug config
 CFLAGS_DEBUG="$CFLAGS -DDEBUG -O0 -ggdb"
 LDFLAGS_DEBUG="$LDFLAGS"
-LIBC3_DEBUG=../libc3/libc3.debug.a
+LIBC3_DEBUG=../libc3/libc3_debug.a
 LIBS_DEBUG="$LIBC3_DEBUG $LIBS"
 
 # Main config
diff --git a/libc3/configure b/libc3/configure
index 1e45e67..ae4177f 100755
--- a/libc3/configure
+++ b/libc3/configure
@@ -11,17 +11,16 @@
 ## PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
 ## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
 ## THIS SOFTWARE.
-
 set -e
 
-export C3_TOP="$(pwd)/.."
+export SRC_TOP="$(pwd)/.."
 
 . ../config.subr
 
 LIB=libc3.la
-LIB_ASAN=libc3.asan.la
-LIB_COV=libc3.cov.la
-LIB_DEBUG=libc3.debug.la
+LIB_ASAN=libc3_asan.la
+LIB_COV=libc3_cov.la
+LIB_DEBUG=libc3_debug.la
 
 . ./sources.sh
 
@@ -94,11 +93,9 @@ echo >> ${CONFIG_MK}
 echo "$LIB_ASAN: $OBJECTS_ASAN" >> ${CONFIG_MK}
 echo "	${LIBTOOL} --tag=CC --mode=link \${CC} \${LDFLAGS_ASAN} ${OBJECTS_ASAN} \${LIBS_ASAN} -o ${LIB_ASAN}" >> ${CONFIG_MK}
 
-if [ -n "$GCOV" ]; then
-    echo >> ${CONFIG_MK}
-    echo "$LIB_COV: $OBJECTS_COV" >> ${CONFIG_MK}
-    echo "	${LIBTOOL} --tag=CC --mode=link \${CC} \${LDFLAGS_COV} ${OBJECTS_COV} \${LIBS_COV} -o ${LIB_COV}" >> ${CONFIG_MK}
-fi
+echo >> ${CONFIG_MK}
+echo "$LIB_COV: $OBJECTS_COV" >> ${CONFIG_MK}
+echo "	${LIBTOOL} --tag=CC --mode=link \${CC} \${LDFLAGS_COV} ${OBJECTS_COV} \${LIBS_COV} -o ${LIB_COV}" >> ${CONFIG_MK}
 
 echo >> ${CONFIG_MK}
 echo "$LIB_DEBUG: $OBJECTS_DEBUG" >> ${CONFIG_MK}
@@ -120,12 +117,10 @@ for SRC in $SOURCES; do
     ext_rule .asan.lo "$SRC" >> ${CONFIG_MK}
     echo "	${LIBTOOL} --tag=CC --mode=compile \${CC} \${CPPFLAGS} \${CFLAGS_ASAN} -c $SRC -o $SRC_ASAN_LO" >> ${CONFIG_MK}
 
-    if [ -n "$GCOV" ]; then
-       echo >> ${CONFIG_MK}
-       SRC_COV_LO="$(c2ext .cov.lo "$SRC")"
-       ext_rule .cov.lo "$SRC" >> ${CONFIG_MK}
-       echo "	${LIBTOOL} --tag=CC --mode=compile \${CC} \${CPPFLAGS} \${CFLAGS_COV} -c $SRC -o $SRC_COV_LO" >> ${CONFIG_MK}
-    fi
+    echo >> ${CONFIG_MK}
+    SRC_COV_LO="$(c2ext .cov.lo "$SRC")"
+    ext_rule .cov.lo "$SRC" >> ${CONFIG_MK}
+    echo "	${LIBTOOL} --tag=CC --mode=compile \${CC} \${CPPFLAGS} \${CFLAGS_COV} -c $SRC -o $SRC_COV_LO" >> ${CONFIG_MK}
 
     echo >> ${CONFIG_MK}
     SRC_DEBUG_LO="$(c2ext .debug.lo "$SRC")"
diff --git a/test/Makefile b/test/Makefile
index 3ba93e7..cd4fa8d 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -11,7 +11,7 @@
 ## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
 ## THIS SOFTWARE.
 
-CLEANFILES = *.a *.css *.gcno *.html ic3/*.diff ic3/*.err ic3/*.out ic3/*.ret *.o libc3_test libc3_test.asan libc3_test.cov libc3_test.debug .libs *.lo
+CLEANFILES = *.a *.css *.gcno *.html ic3/*.diff ic3/*.err ic3/*.out ic3/*.ret *.o libc3_test libc3_test_asan libc3_test_cov libc3_test_debug .libs *.lo
 
 CLEANFILES_COV = *.css *.gcda *.html .libs/*.gcda
 CLEANFILES += ${CLEANFILES_COV}
@@ -26,7 +26,7 @@ all:
 	${MAKE} debug
 	if ${HAVE_ASAN}; then ${MAKE} asan; fi
 
-asan: libc3_test.asan
+asan: libc3_test_asan
 
 clean:
 	rm -rf ${CLEANFILES}
@@ -34,9 +34,9 @@ clean:
 clean_cov:
 	rm -rf ${CLEANFILES_COV}
 
-cov:   libc3_test.cov
+cov:   libc3_test_cov
 
-debug: libc3_test.debug
+debug: libc3_test_debug
 
 distclean:
 	rm -rf ${DISTCLEANFILES}
@@ -45,30 +45,30 @@ gcovr:
 	gcovr --gcov-executable ${GCOV} --html-details test.html
 
 gdb_test: debug
-	if [ -f libc3_test.debug.core ]; then gdb libc3_test.debug libc3_test.debug.core; else gdb libc3_test.debug; fi
+	if [ -f libc3_test_debug.core ]; then gdb libc3_test_debug libc3_test_debug.core; else gdb libc3_test_debug; fi
 
 ic3_test_cov:
-	IC3=${C3_TOP}/ic3/ic3.cov time ./ic3_test
+	IC3=${SRC_TOP}/ic3/ic3_cov time ./ic3_test
 
-libc3_test_cov: libc3_test.cov
-	time ./libc3_test.cov
+libc3_test_cov: libc3_test_cov
+	time ./libc3_test_cov
 
 test: libc3_test
 	time ./libc3_test
-	IC3=${C3_TOP}/ic3/ic3 time ./ic3_test
+	IC3=${SRC_TOP}/ic3/ic3 time ./ic3_test
 
-test_asan: libc3_test.asan
-	time ./libc3_test.asan
-	IC3=${C3_TOP}/ic3/ic3.asan time ./ic3_test
+test_asan: libc3_test_asan
+	time ./libc3_test_asan
+	IC3=${SRC_TOP}/ic3/ic3_asan time ./ic3_test
 
 test_cov: libc3_test_cov ic3_test_cov
 
-test_debug: libc3_test.debug
-	time ./libc3_test.debug
-	IC3=${C3_TOP}/ic3/ic3.debug time ./ic3_test
+test_debug: libc3_test_debug
+	time ./libc3_test_debug
+	IC3=${SRC_TOP}/ic3/ic3_debug time ./ic3_test
 
 test_ic3:
-	IC3=${C3_TOP}/ic3/ic3 time ./ic3_test
+	IC3=${SRC_TOP}/ic3/ic3 time ./ic3_test
 
 test_valgrind: libc3_test
 	valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./libc3_test
diff --git a/test/configure b/test/configure
index d2bf220..acccef6 100755
--- a/test/configure
+++ b/test/configure
@@ -14,14 +14,14 @@
 
 set -e
 
-export C3_TOP="$(pwd)/.."
+export SRC_TOP="$(dirname "$PWD")"
 
 . ../config.subr
 
 PROG=libc3_test
-PROG_ASAN=libc3_test.asan
-PROG_COV=libc3_test.cov
-PROG_DEBUG=libc3_test.debug
+PROG_ASAN=libc3_test_asan
+PROG_COV=libc3_test_cov
+PROG_DEBUG=libc3_test_debug
 
 . ./sources.sh
 
@@ -57,19 +57,19 @@ pkg_config libmd
 # Asan config
 CFLAGS_ASAN="$CFLAGS -fsanitize=address -O1 -fno-omit-frame-pointer -g"
 LDFLAGS_ASAN="$LDFLAGS"
-LIBC3_ASAN=../libc3/libc3.asan.a
+LIBC3_ASAN=../libc3/libc3_asan.a
 LIBS_ASAN="$LIBC3_ASAN $LIBS"
 
 # Coverage config
 CFLAGS_COV="$CFLAGS -ftest-coverage -fprofile-arcs"
 LDFLAGS_COV="$LDFLAGS"
-LIBC3_COV=../libc3/libc3.cov.a
+LIBC3_COV=../libc3/libc3_cov.a
 LIBS_COV="$LIBC3_COV $LIBS"
 
 # Debug config
 CFLAGS_DEBUG="$CFLAGS -DDEBUG -O0 -ggdb"
 LDFLAGS_DEBUG="$LDFLAGS"
-LIBC3_DEBUG=../libc3/libc3.debug.a
+LIBC3_DEBUG=../libc3/libc3_debug.a
 LIBS_DEBUG="$LIBC3_DEBUG $LIBS"
 
 # Main config