blob: 87e7ff9a85d5b98ee201240d7d225a50b031fe77 (
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
PKGNAME = coopgammad
COMMAND = coopgammad
KERNEL = $(shell uname | tr '[A-Z]_' '[a-z]-')
SRC = \
coopgammad \
util \
communication \
state \
servers/master \
servers/kernel \
servers/crtc \
servers/gamma \
servers/coopgamma \
types/filter \
types/output \
types/ramps \
types/message \
types/ring
OPTIMISE = -Og -g
WARN = -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 -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
FFLAGS = -fstrict-aliasing -fstrict-overflow -fipa-pure-const -ftree-vrp -fstack-usage \
-funsafe-loop-optimizations
CPP_linux = -DHAVE_LINUX_PROCFS
CPP_linux-libre = $(CPP_linux)
CCFLAGS = -std=c99 $(WARN) $(FFLAGS) $(OPTIMISE)
LDFLAGS = $(OPTIMISE) -lgamma
CPPFLAGS = -D'PKGNAME="$(PKGNAME)"' -D'COMMAND="$(COMMAND)"' -D_XOPEN_SOURCE=700 $(CPP_$(KERNEL))
.PHONY: all
all: bin/coopgammad
bin/coopgammad: $(foreach S,$(SRC),obj/$(S).o)
@mkdir -p -- "$$(dirname -- "$@")"
$(CC) $(LDFLAGS) -o $@ $^
obj/%.o: src/%.c src/*.h src/*/*.h
@mkdir -p -- "$$(dirname -- "$@")"
$(CC) $(CCFLAGS) $(CPPFLAGS) -c -o $@ $<
.PHONY: clean
clean:
-rm -r bin obj
|