summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-03-20 03:38:00 -0300
committerEuAndreh <eu@euandre.org>2024-03-20 03:38:05 -0300
commit4ce404bc32e46b7cdcb834f0077cda2219988e44 (patch)
treeb86a2735e20e876c08718986f8d32a514df4a502 /Makefile
parenttests/js/hero.mjs: Fix function ordering (diff)
downloadpapod-4ce404bc32e46b7cdcb834f0077cda2219988e44.tar.gz
papod-4ce404bc32e46b7cdcb834f0077cda2219988e44.tar.xz
tests/rand.mjs: Add MersenneTwister random number generator
The `tests/rand.c` is also added: a simplified adaptation of the original algorithm implementation in C. A 10k numbers test case shows that the JavaScript version behaves the same that the C one does.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 1870773..6ea0735 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ DESTDIR =
.SUFFIXES:
-.SUFFIXES: .in
+.SUFFIXES: .in .c .bin
.in:
sed \
@@ -34,6 +34,9 @@ DESTDIR =
< $< > $@
if [ -x $< ]; then chmod +x $@; fi
+.c.bin:
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)
+
all:
@@ -53,6 +56,8 @@ installable = \
derived-assets = \
$(manpages) \
+ tests/rand.bin \
+ tests/bigger-rand-output.txt \
side-assets = \
tests/hero-*.pipe \
@@ -68,8 +73,13 @@ side-assets = \
## and installation.
all: $(derived-assets)
+tests/bigger-rand-output.txt: tests/rand.bin
+ printf '[\n\t%s\n]\n' \
+ "`./$? | tr '\n' ',' | sed -e 's|,$$||' -e 's|,|,\n\t|g'`" > $@
+
-$(manpages): Makefile deps.mk
+tests/rand.bin $(manpages): Makefile deps.mk
+tests/js/rand.mjs-check: tests/bigger-rand-output.txt