aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreuxane2024-11-30 12:16:50 +0100
committereuxane2024-11-30 12:16:50 +0100
commit62f23d9a24e349f57e8857c75bdf2c0ca32c4f70 (patch)
tree60a6dbfa8de7bcc7dd6c08654f1f62e3dc717992
parentf6d0572984f78f400166fc585dd3b3a120101647 (diff)
downloadtickwatch-62f23d9a24e349f57e8857c75bdf2c0ca32c4f70.tar.gz
makefile: add
-rw-r--r--.gitignore1
-rw-r--r--flake.nix18
-rw-r--r--makefile39
-rw-r--r--readme.md7
4 files changed, 50 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore
index 41bcc3d..f07dd37 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
1# ignore binaries 1# ignore binaries
2* 2*
3!*.* 3!*.*
4!makefile
4!*/ 5!*/
5 6
6nimcache/ 7nimcache/
diff --git a/flake.nix b/flake.nix
index bbfd8f0..2118e42 100644
--- a/flake.nix
+++ b/flake.nix
@@ -39,18 +39,14 @@
39 version = "SNAPSHOT"; 39 version = "SNAPSHOT";
40 src = ./.; 40 src = ./.;
41 buildInputs = [ pkgs.nim ]; 41 buildInputs = [ pkgs.nim ];
42 buildPhase = ''
43 export VERSION=${final.version}
44 nim c --nimcache:. -d:release main.nim
45 '';
46 doCheck = true; 42 doCheck = true;
47 checkPhase = '' 43 makeFlags = [
48 nim r --nimcache:. -d:test main.nim 44 "NIM_FLAGS=--nimcache:."
49 ''; 45 "VERSION=${final.version}"
50 installPhase = '' 46 ];
51 mkdir -p $out/bin 47 installFlags = [
52 mv main $out/bin/${final.meta.mainProgram} 48 "DESTDIR=$(out)"
53 ''; 49 ];
54 }); 50 });
55 }); 51 });
56} 52}
diff --git a/makefile b/makefile
new file mode 100644
index 0000000..8ab718e
--- /dev/null
+++ b/makefile
@@ -0,0 +1,39 @@
1# tickwatch
2# Author: Euxane TRAN-GIRARD
3# Licence: EUPL-1.2
4
5
6tickwatch: $(wildcard *.nim)
7 nim c \
8 ${NIM_FLAGS} \
9 -d:release \
10 -o:tickwatch \
11 main.nim
12
13.PHONY: clean
14clean:
15 rm -f tickwatch
16
17.PHONY: check
18check:
19 nim r \
20 ${NIM_FLAGS} \
21 -d:test \
22 main.nim
23
24.PHONY: check-loop
25check-loop:
26 watchexec -cclear -r \
27 nim r \
28 ${NIM_FLAGS} \
29 -d:test \
30 main.nim
31
32.PHONY: install
33install:
34 nim c \
35 ${NIM_FLAGS} \
36 -d:release \
37 -o:tickwatch \
38 --outdir=${DESTDIR}/bin \
39 main.nim
diff --git a/readme.md b/readme.md
index 52c8a9e..7e0424b 100644
--- a/readme.md
+++ b/readme.md
@@ -68,12 +68,11 @@ Contributions
68Issues and patches: email the author. 68Issues and patches: email the author.
69 69
70 70
71Development commands 71Development
72-------------------- 72-----------
73 73
74* Enter the development shell: `nix develop` 74* Enter the development shell: `nix develop`
75* Run tests in loop: `watchexec -cclear -r nim r -d:test main.nim` 75* Make targets: `tickwatch`, `check`, `check-loop`, `install`, `clean`
76* Build executable: `nim c -d:release main.nim`
77 76
78 77
79Copyright and Licence 78Copyright and Licence