diff options
author | euxane | 2024-11-30 12:16:50 +0100 |
---|---|---|
committer | euxane | 2024-11-30 12:16:50 +0100 |
commit | 62f23d9a24e349f57e8857c75bdf2c0ca32c4f70 (patch) | |
tree | 60a6dbfa8de7bcc7dd6c08654f1f62e3dc717992 | |
parent | f6d0572984f78f400166fc585dd3b3a120101647 (diff) | |
download | tickwatch-62f23d9a24e349f57e8857c75bdf2c0ca32c4f70.tar.gz |
makefile: add
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | flake.nix | 18 | ||||
-rw-r--r-- | makefile | 39 | ||||
-rw-r--r-- | readme.md | 7 |
4 files changed, 50 insertions, 15 deletions
@@ -1,6 +1,7 @@ | |||
1 | # ignore binaries | 1 | # ignore binaries |
2 | * | 2 | * |
3 | !*.* | 3 | !*.* |
4 | !makefile | ||
4 | !*/ | 5 | !*/ |
5 | 6 | ||
6 | nimcache/ | 7 | nimcache/ |
@@ -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 | |||
6 | tickwatch: $(wildcard *.nim) | ||
7 | nim c \ | ||
8 | ${NIM_FLAGS} \ | ||
9 | -d:release \ | ||
10 | -o:tickwatch \ | ||
11 | main.nim | ||
12 | |||
13 | .PHONY: clean | ||
14 | clean: | ||
15 | rm -f tickwatch | ||
16 | |||
17 | .PHONY: check | ||
18 | check: | ||
19 | nim r \ | ||
20 | ${NIM_FLAGS} \ | ||
21 | -d:test \ | ||
22 | main.nim | ||
23 | |||
24 | .PHONY: check-loop | ||
25 | check-loop: | ||
26 | watchexec -cclear -r \ | ||
27 | nim r \ | ||
28 | ${NIM_FLAGS} \ | ||
29 | -d:test \ | ||
30 | main.nim | ||
31 | |||
32 | .PHONY: install | ||
33 | install: | ||
34 | nim c \ | ||
35 | ${NIM_FLAGS} \ | ||
36 | -d:release \ | ||
37 | -o:tickwatch \ | ||
38 | --outdir=${DESTDIR}/bin \ | ||
39 | main.nim | ||
@@ -68,12 +68,11 @@ Contributions | |||
68 | Issues and patches: email the author. | 68 | Issues and patches: email the author. |
69 | 69 | ||
70 | 70 | ||
71 | Development commands | 71 | Development |
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 | ||
79 | Copyright and Licence | 78 | Copyright and Licence |