Basic C project template.

ci: Using more general Makefile practices.

+9 -8
+9 -8
Makefile
··· 1 - ADDRESS := "127.0.0.1" 2 - PORT := "42069" 3 1 CC := gcc 4 2 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 3 CLIBS := -lm 6 4 SRC := src/main.c 5 + BUILD := .build 7 6 8 - edevice.py: .build/main 9 - ./.build/main "$(ADDRESS)" "$(PORT)" 7 + run: $(BUILD)/main 8 + ./$(BUILD)/main 9 + 10 + build: $(BUILD)/main 10 11 11 - .build/main: .build $(SRC) 12 + $(BUILD)/main: $(BUILD) $(SRC) 12 13 $(CC) $(CFLAGS) $(CLIBS) $(SRC) -o $@ 13 14 14 - .build: 15 - mkdir .build 15 + $(BUILD): 16 + mkdir $@ 16 17 17 18 clean: 18 - rm -rf .build 19 + rm -rf $(BUILD)