tangled
alpha
login
or
join now
stau.space
/
tsched
0
fork
atom
Threads and Scheduling
0
fork
atom
overview
issues
pulls
pipelines
ci: Update Makefile requirements.
stau.space
6 months ago
594e90fa
e8fc1464
+26
-16
3 changed files
expand all
collapse all
unified
split
Makefile
flake.nix
src
main.c
+25
-11
Makefile
···
1
1
-
ADDRESS := "127.0.0.1"
2
2
-
PORT := "42069"
1
1
+
SRC := src/
2
2
+
BUILD := .build/
3
3
CC := gcc
4
4
CFLAGS := -std=c11 -g -Wextra -Wall -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wconversion -Wunreachable-code -pedantic -fsanitize=address -fsanitize=undefined -save-temps
5
5
-
CLIBS := -lm
6
6
-
SRC := src/main.c
5
5
+
CLIBS := -lm $(SRC)/lib/*.c
7
6
8
8
-
edevice.py: .build/main
9
9
-
./.build/main "$(ADDRESS)" "$(PORT)"
7
7
+
ADDRESS := 127.0.0.1
8
8
+
PORT := 42069
10
9
11
11
-
.build/main: .build $(SRC)
12
12
-
$(CC) $(CFLAGS) $(CLIBS) $(SRC) -o $@
10
10
+
run: edevice.py cluster.py
13
11
14
14
-
.build:
15
15
-
mkdir .build
12
12
+
# -- the targets that actually get used --
13
13
+
14
14
+
edevice.py: $(BUILD)/edevice # this is the client
15
15
+
./$^ "$(ADDRESS)" "$(PORT)"
16
16
+
17
17
+
cluster.py: $(BUILD)/cluster # this is the server
18
18
+
./$^ "$(ADDRESS)" "$(PORT)"
19
19
+
20
20
+
$(BUILD)/edevice: $(BUILD) $(SRC)/edevice.c
21
21
+
$(CC) $(CFLAGS) $(CLIBS) $(SRC)/edevice.c -o $@
22
22
+
23
23
+
$(BUILD)/cluster: $(BUILD) $(SRC)/cluster.c
24
24
+
$(CC) $(CFLAGS) $(CLIBS) $(SRC)/cluster.c -o $@
25
25
+
26
26
+
# -- Cleanup targets --
27
27
+
28
28
+
$(BUILD):
29
29
+
mkdir $@
16
30
17
31
clean:
18
18
-
rm -rf .build
32
32
+
rm -rf $(BUILD)
+1
flake.nix
···
28
28
packages = with pkgs; [
29
29
gcc
30
30
gnumake
31
31
+
clang-tools
31
32
];
32
33
33
34
# Set any environment variables for your dev shell
-5
src/main.c
···
1
1
-
#include <stdio.h>
2
2
-
3
3
-
int main() {
4
4
-
printf("Hello world!\n");
5
5
-
}