aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-11-04 11:06:12 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2023-11-04 11:06:12 +0100
commit93260168ed02de2eebd456e345c25f9066bb3a2c (patch)
treeb727262a0437c0ecbd2c613186372e9f3b4eed78
parent3051b2342d67dcba2fdc0010fb26f5850964c4d9 (diff)
downloadnissy-core-93260168ed02de2eebd456e345c25f9066bb3a2c.tar.gz
nissy-core-93260168ed02de2eebd456e345c25f9066bb3a2c.zip
Makefile changes
-rw-r--r--Makefile9
-rw-r--r--README.md14
-rwxr-xr-xconfigure.sh18
3 files changed, 19 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index 082b740..b2e6da6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,16 @@
1include config.mk 1# Set TYPE="AVX2" manually for advanced vector instructions
2CUBETYPE = CUBE_${TYPE}
2 3
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
3all: cube.o debugcube.o 8all: cube.o debugcube.o
4 9
5cube.o: clean 10cube.o: clean
6 ${CC} -D${CUBETYPE} ${CFLAGS} -c -o cube.o src/cube.c 11 ${CC} -D${CUBETYPE} ${CFLAGS} -c -o cube.o src/cube.c
7 12
8debugcube.o: 13debugcube.o: clean
9 ${CC} -D${CUBETYPE} ${DBGFLAGS} -c -o debugcube.o src/cube.c 14 ${CC} -D${CUBETYPE} ${DBGFLAGS} -c -o debugcube.o src/cube.c
10 15
11clean: 16clean:
diff --git a/README.md b/README.md
index b95977e..aab3e61 100644
--- a/README.md
+++ b/README.md
@@ -4,13 +4,23 @@ 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## Running tests 7## Building and running tests
8
9Tests:
8 10
9``` 11```
10$ ./configure.sh # Run 'TYPE=AVX2 ./configure.sh' to use AVX2 instead
11$ make test 12$ make test
12``` 13```
13 14
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
14## TODO: 24## TODO:
15 25
16### Cleanup / refactor 26### Cleanup / refactor
diff --git a/configure.sh b/configure.sh
deleted file mode 100755
index 17673fc..0000000
--- a/configure.sh
+++ /dev/null
@@ -1,18 +0,0 @@
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