tangled
alpha
login
or
join now
stau.space
/
c-template
0
fork
atom
Basic C project template.
0
fork
atom
overview
issues
pulls
pipelines
ci: Using more general Makefile practices.
stau.space
6 months ago
cb02b599
0b52e7f5
+9
-8
1 changed file
expand all
collapse all
unified
split
Makefile
+9
-8
Makefile
···
1
1
-
ADDRESS := "127.0.0.1"
2
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
5
+
BUILD := .build
7
6
8
8
-
edevice.py: .build/main
9
9
-
./.build/main "$(ADDRESS)" "$(PORT)"
7
7
+
run: $(BUILD)/main
8
8
+
./$(BUILD)/main
9
9
+
10
10
+
build: $(BUILD)/main
10
11
11
11
-
.build/main: .build $(SRC)
12
12
+
$(BUILD)/main: $(BUILD) $(SRC)
12
13
$(CC) $(CFLAGS) $(CLIBS) $(SRC) -o $@
13
14
14
14
-
.build:
15
15
-
mkdir .build
15
15
+
$(BUILD):
16
16
+
mkdir $@
16
17
17
18
clean:
18
18
-
rm -rf .build
19
19
+
rm -rf $(BUILD)