From ecfee1ff28824eaef7cf9ff7bc422e5e99202121 Mon Sep 17 00:00:00 2001 From: Claudius Holeksa Date: Tue, 9 May 2023 17:45:17 +0200 Subject: Added Makefile and ammended README and nix files for that change --- .nix/derivation.nix | 1 + Makefile | 17 +++++++++++++++++ README.md | 4 ++-- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 Makefile 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 -- cgit v1.2.3