Threads and Scheduling

ci: Update Makefile requirements.

+26 -16
+25 -11
Makefile
··· 1 - ADDRESS := "127.0.0.1" 2 - PORT := "42069" 1 + SRC := src/ 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 - CLIBS := -lm 6 - SRC := src/main.c 5 + CLIBS := -lm $(SRC)/lib/*.c 7 6 8 - edevice.py: .build/main 9 - ./.build/main "$(ADDRESS)" "$(PORT)" 7 + ADDRESS := 127.0.0.1 8 + PORT := 42069 10 9 11 - .build/main: .build $(SRC) 12 - $(CC) $(CFLAGS) $(CLIBS) $(SRC) -o $@ 10 + run: edevice.py cluster.py 13 11 14 - .build: 15 - mkdir .build 12 + # -- the targets that actually get used -- 13 + 14 + edevice.py: $(BUILD)/edevice # this is the client 15 + ./$^ "$(ADDRESS)" "$(PORT)" 16 + 17 + cluster.py: $(BUILD)/cluster # this is the server 18 + ./$^ "$(ADDRESS)" "$(PORT)" 19 + 20 + $(BUILD)/edevice: $(BUILD) $(SRC)/edevice.c 21 + $(CC) $(CFLAGS) $(CLIBS) $(SRC)/edevice.c -o $@ 22 + 23 + $(BUILD)/cluster: $(BUILD) $(SRC)/cluster.c 24 + $(CC) $(CFLAGS) $(CLIBS) $(SRC)/cluster.c -o $@ 25 + 26 + # -- Cleanup targets -- 27 + 28 + $(BUILD): 29 + mkdir $@ 16 30 17 31 clean: 18 - rm -rf .build 32 + rm -rf $(BUILD)
+1
flake.nix
··· 28 28 packages = with pkgs; [ 29 29 gcc 30 30 gnumake 31 + clang-tools 31 32 ]; 32 33 33 34 # Set any environment variables for your dev shell
-5
src/main.c
··· 1 - #include <stdio.h> 2 - 3 - int main() { 4 - printf("Hello world!\n"); 5 - }