about summary refs log tree commit diff stats
path: root/Makefile
blob: 8a8d04d3f77a89c3451e80219ea8888121e6e3f8 (plain) (blame)
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
CFLAGS:=-Wall -Wextra -Wpedantic -std=c11
ALL:=mkgpt

dev: CFLAGS+=-g3 -Og -fsanitize=address -fsanitize=undefined
dev: LDFLAGS+=-fsanitize=address -fsanitize=undefined
dev: $(ALL)

prod: CFLAGS+=-g0 -Os
prod: LDFLAGS+=-s
prod: $(ALL)

static: CC:=musl-gcc
static: CFLAGS+=-g0 -Os
static: LDFLAGS+=-static -s
static: $(ALL)

mkgpt: mkgpt.o crc32.o fstypes.o guid.o

mkgpt.o: mkgpt.c guid.h fstypes.h part.h
fstypes.o: fstypes.c fstypes.h guid.h
guid.o: guid.c guid.h
crc32.o: crc32.c

.PHONY: check clean format
check:
	cppcheck --enable=all --inconclusive --std=c11 .
clean:
	$(RM) *.o $(ALL)
format:
	clang-format -verbose -i *.[ch]