-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (30 loc) · 860 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
CC ?= cc
CP ?= cp -f
RM ?= rm -f
MKDIR ?= mkdir -p
INSTALL ?= install
PREFIX ?= /usr/local
#CFLAGS += -Wall -std=c99 -pedantic
CFLAGS += -Wall -std=c11 -pedantic
.PHONY:
all: test
.PHONY: readme_update
readme_update:
# Library Version (From clib package metadata)
jq -r '.version' clib.json | xargs -I{} sed -i 's|<version>.*</version>|<version>{}</version>|' README.md
jq -r '.version' clib.json | xargs -I{} sed -i 's|<versionBadge>.*</versionBadge>|<versionBadge></versionBadge>|' README.md
.PHONY: format
format:
# pip install clang-format
clang-format -i *.c
clang-format -i *.h
.PHONY:
test: test.c char-utils.h
$(CC) $(CFLAGS) $(LDFLAGS) -o test test.c
./test
.PHONY:
%.o: %.c
$(CC) $(DEP_FLAG) $(CFLAGS) $(LDFLAGS) -o $@ -c $<
.PHONY:
clean:
rm -f test