Worked on runtime and threadpool
This commit is contained in:
43
makefile
Normal file
43
makefile
Normal 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)
|
||||
Reference in New Issue
Block a user