aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: dc0e08db162f566876af3550e848e0bc32c9d0a0 (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
31
32
33
34
35
36
37
38
39
LIBS = libdrm

FLAGS = -std=gnu99 -Og -g -Wall -Wextra -pedantic -Wdouble-promotion -Wformat=2  \
        -Winit-self -Wmissing-include-dirs -Wtrampolines -Wfloat-equal -Wshadow  \
        -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls            \
        -Wnested-externs -Winline -Wno-variadic-macros -Wswitch-default          \
        -Wsync-nand -Wunsafe-loop-optimizations -Wcast-align -Wstrict-overflow   \
        -Wdeclaration-after-statement -Wundef -Wbad-function-cast -Wcast-qual    \
        -Wwrite-strings -Wlogical-op -Waggregate-return -Wstrict-prototypes      \
        -Wold-style-definition -Wpacked -Wvector-operation-performance           \
        -Wunsuffixed-float-constants -Wsuggest-attribute=const                   \
        -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure                    \
        -Wsuggest-attribute=format -Wnormalized=nfkc -Wconversion                \
        -fstrict-aliasing -fstrict-overflow -fipa-pure-const -ftree-vrp          \
        -fstack-usage -funsafe-loop-optimizations -Wtraditional-conversion

LD_FLAGS = -lm $(shell pkg-config --libs $(LIBS)) $(FLAGS) $(LDFLAGS)
C_FLAGS = $(shell pkg-config --cflags $(LIBS)) $(FLAGS) $(CFLAGS) $(CPPFLAGS)

OBJS = calibrator drmgamma framebuffer gamma state



.PHONY: all
all: bin/crt-calibrator

bin/crt-calibrator: $(foreach O,$(OBJS),obj/$(O).o)
	@mkdir -p bin
	$(CC) $(LD_FLAGS) -o $@ $^

obj/%.o: src/%.c src/*.h
	@mkdir -p obj
	$(CC) $(C_FLAGS) -c -o $@ $<


.PHONY: clean
clean:
	-rm -r bin obj