Threads and Scheduling
1SRC := src
2BUILD := .build/
3CC := gcc
4CFLAGS := -std=gnu99 -g -Wextra -Wall -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wconversion -Wunreachable-code -pedantic -fsanitize=address -fsanitize=undefined -save-temps -Wno-builtin-declaration-mismatch
5
6CLIBS := $(SRC)/lib/*.c
7
8ADDRESS := 127.0.0.1
9PORT := 42069
10
11run: cluster.py edevice.py
12
13# -- the targets that actually get used --
14
15edevice.py: $(BUILD)/edevice # this is the client
16 @echo
17 ./$^ "$(ADDRESS)" "$(PORT)"
18
19cluster.py: $(BUILD)/cluster # this is the server
20 @echo
21 ./$^ "$(ADDRESS)" "$(PORT)"
22
23$(BUILD)/edevice: $(BUILD) $(SRC)/edevice.c
24 $(CC) $(CFLAGS) $(CLIBS) $(SRC)/edevice.c -o $@
25
26$(BUILD)/cluster: $(BUILD) $(SRC)/cluster.c
27 $(CC) $(CFLAGS) $(CLIBS) $(SRC)/cluster.c -o $@
28
29# -- Cleanup targets --
30
31$(BUILD):
32 mkdir $@
33
34.PHONY: clean
35clean:
36 rm -rf $(BUILD)