aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-11-04 21:57:21 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2023-11-04 21:57:21 +0100
commitfc8bdd6c8ad23868dc3722104eb710f01da03ef9 (patch)
treebc47ade8eb832d003e062ffaa2be6e26c185413a
parent93260168ed02de2eebd456e345c25f9066bb3a2c (diff)
downloadnissy-core-fc8bdd6c8ad23868dc3722104eb710f01da03ef9.tar.gz
nissy-core-fc8bdd6c8ad23868dc3722104eb710f01da03ef9.zip
Revert "Makefile changes"
This reverts commit 93260168ed02de2eebd456e345c25f9066bb3a2c.
-rw-r--r--Makefile9
-rw-r--r--README.md14
-rwxr-xr-xconfigure.sh18
3 files changed, 22 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index b2e6da6..082b740 100644
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,11 @@
1# Set TYPE="AVX2" manually for advanced vector instructions 1include config.mk
2CUBETYPE = CUBE_${TYPE}
3 2
4CFLAGS = -std=c99 -pthread -pedantic -Wall -Wextra -Wno-unused-parameter -O3 -mavx2
5DBGFLAGS = -DDEBUG -std=c99 -pthread -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -g3 -fsanitize=address -fsanitize=undefined -mavx2
6
7CC = cc
8all: cube.o debugcube.o 3all: cube.o debugcube.o
9 4
10cube.o: clean 5cube.o: clean
11 ${CC} -D${CUBETYPE} ${CFLAGS} -c -o cube.o src/cube.c 6 ${CC} -D${CUBETYPE} ${CFLAGS} -c -o cube.o src/cube.c
12 7
13debugcube.o: clean 8debugcube.o:
14 ${CC} -D${CUBETYPE} ${DBGFLAGS} -c -o debugcube.o src/cube.c 9 ${CC} -D${CUBETYPE} ${DBGFLAGS} -c -o debugcube.o src/cube.c
15 10
16clean: 11clean:
diff --git a/README.md b/README.md
index aab3e61..b95977e 100644
--- a/README.md
+++ b/README.md
@@ -4,23 +4,13 @@ Work in progress. There is some documentation at the bottom of this page,
4but do not believe it. Everything is in a state of flux and can change 4but do not believe it. Everything is in a state of flux and can change
5without notice. 5without notice.
6 6
7## Building and running tests 7## Running tests
8
9Tests:
10 8
11``` 9```
10$ ./configure.sh # Run 'TYPE=AVX2 ./configure.sh' to use AVX2 instead
12$ make test 11$ make test
13``` 12```
14 13
15Benchmarks:
16
17```
18$ make benchmark
19```
20
21Prefix each make instruction with `TYPE=AVX2` to try the AVX2 version
22(e.g. `TYPE=AVX2 make benchmark`).
23
24## TODO: 14## TODO:
25 15
26### Cleanup / refactor 16### Cleanup / refactor
diff --git a/configure.sh b/configure.sh
new file mode 100755
index 0000000..17673fc
--- /dev/null
+++ b/configure.sh
@@ -0,0 +1,18 @@
1#!/bin/sh
2
3CFLAGS="-std=c99 -pthread -pedantic -Wall -Wextra -Wno-unused-parameter -O3"
4DBGFLAGS="-DDEBUG -std=c99 -pthread -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -g3 -fsanitize=address -fsanitize=undefined"
5
6if [ "$TYPE" = "AVX2" ]; then
7 CFLAGS="$CFLAGS -mavx2"
8 DBGFLAGS="$DBGFLAGS -mavx2"
9fi
10
11{
12echo "CUBETYPE = CUBE_$TYPE";
13echo "";
14echo "CFLAGS = $CFLAGS";
15echo "DBGFLAGS = $DBGFLAGS";
16echo "";
17echo "CC = cc"
18} > config.mk

Generated with cgit - Back to sebastiano.tronto.net