Worked on runtime and threadpool

This commit is contained in:
2025-06-19 19:21:08 +01:00
commit 0be61851a4
7 changed files with 279 additions and 0 deletions

43
makefile Normal file
View File

@ -0,0 +1,43 @@
CC=gcc
C_FLAGS=-Wall -Wextra -pedantic -Wno-unknown-pragmas -g -DDEBUG
DIR_SRC=src
DIR_INC=include
DIR_BUILD=build
DEPS=dl pthread m atomic pigpio rt sus
OUTBIN=$(DIR_BUILD)/bin/main
SRCS=$(shell find $(DIR_SRC) -type f -name '*.c')
OBJS=$(patsubst $(DIR_SRC)/%.c,$(DIR_BUILD)/obj/%.o,$(SRCS))
DEPS_EXT=$(patsubst %,-l%,$(DEPS))
.PHONY: all build rebuild loc clean run
# Compatibility
.WAIT: # No dependencies
# No code
all: $(OUTBIN)
build: $(OUTBIN)
rebuild: clean .WAIT build
run: $(OUTBIN)
sudo ./$(OUTBIN)
$(OUTBIN): $(OBJS)
@mkdir -p $(@D)
$(CC) $(OBJS) $(DEPS_EXT) -o $@
$(DIR_BUILD)/obj/%.o: $(DIR_SRC)/%.c
@mkdir -p $(@D)
$(CC) $(C_FLAGS) -I$(DIR_INC) -c $< -o $@
loc:
@scc -s lines --no-cocomo --no-gitignore -w --size-unit binary src
clean:
@$(RM) -r $(DIR_BUILD)