summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudius Holeksa <mail@keldu.de>2023-05-09 17:45:17 +0200
committerClaudius Holeksa <mail@keldu.de>2023-05-09 17:45:17 +0200
commitecfee1ff28824eaef7cf9ff7bc422e5e99202121 (patch)
tree7a74b57df26d482c06f69cd21da31551a01eb908
parentaccd05e6c5f41c536a97a7313ea1e635b0863205 (diff)
downloadmini-test-ecfee1ff28824eaef7cf9ff7bc422e5e99202121.tar.gz
Added Makefile and ammended README and nix files for that change
-rw-r--r--.nix/derivation.nix1
-rw-r--r--Makefile17
-rw-r--r--README.md4
3 files changed, 20 insertions, 2 deletions
diff --git a/.nix/derivation.nix b/.nix/derivation.nix
index a779c57..ff76034 100644
--- a/.nix/derivation.nix
+++ b/.nix/derivation.nix
@@ -10,6 +10,7 @@ stdenvNoCC.mkDerivation {
nativeBuildInputs = [
clang
+ gnumake
];
output = [ "out" "dev" ];
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..2e56cbb
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,17 @@
+.PHONY: all clean
+
+all: build/libkeltest.a
+
+build/libkeltest.a:
+ mkdir -p ./build
+ c++ -std=c++17 -DKELTEST_COMPILE_TEST_BINARY src/keltest/test.cpp -o build/test.o
+ ar build/libkeltest.a build/test.o
+
+clean:
+ rm -rf ./build
+
+install: build/libkeltest.a
+ mkdir -p ${prefix}/lib
+ mkdir -p ${prefix}/include/keltest
+ cp build/libkeltest.a ${prefix}/lib/libkeltest.a
+ cp src/keltest/test.h ${prefix}/include/keltest/test.h
diff --git a/README.md b/README.md
index 7f9c1b9..6695df3 100644
--- a/README.md
+++ b/README.md
@@ -19,13 +19,13 @@ Currently just compile each test file with a compiler of your choice with
and generate a test binary with
-`c++ -std=c++17 -DKEL_COMPILE_TEST_BINARY keltest.a test_file_a.o test_file_b.o -o tests`
+`c++ -std=c++17 libkeltest.a test_file_a.o test_file_b.o -o tests`
## Modified commands if not available in env
`c++ -std=c++17 test_file_a.cpp -I${keltest_src} -c -o test_file_a.o`
`c++ -std=c++17 test_file_b.cpp -I${keltest_src} -c -o test_file_b.o`
-`c++ -std=c++17 -DKEL_COMPILE_TEST_BINARY ${keltest_src}/keltest/test.cpp test_file_a.o test_file_b.o -o tests`
+`c++ -std=c++17 -DKELTEST_COMPILE_TEST_BINARY ${keltest_src}/keltest/test.cpp test_file_a.o test_file_b.o -o tests`
# Writing tests