-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.ninja
57 lines (40 loc) · 1.32 KB
/
build.ninja
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
ninja_required_version = 1.10
builddir = ./build
include config.ninja
rule install
command = mkdir -p ${DESTDIR}${PREFIX}/bin && $
install -Dm755 ./sei ${DESTDIR}${PREFIX}/bin && $
mkdir -p ${DESTDIR}${PREFIX}/share/sei && $
cp -f sei.desktop /usr/share/xsessions/sei.desktop
rule uninstall
command = rm -f ${DESTDIR}${PREFIX}/bin/sei $
/usr/share/xsessions/sei.desktop
rule options
command = echo "CFLAGS = ${CFLAGS}" && $
echo "LDFLAGS = ${LDFLAGS}" && $
echo "CC = ${CC}"
rule clean
command = rm -rf ${builddir} sei
rule compile
command = ${CC} -c ${in} -o ${out} ${CFLAGS} -MMD -MF ${out}.d
depfile = ${out}.d
rule link
command = ${CC} ${in} -o ${out} ${LDFLAGS}
rule clang_tidy
command = ninja -t compdb > compile_commands.json && clang-tidy -checks="${CLANG_TIDY_CHECKS}" ./*.{c,h}
build tidy: clang_tidy
build clean: clean
build all: phony options sei
build options: options
pool = console
build ${builddir}/drw.o: compile drw.c
build ${builddir}/dwm.o: compile dwm.c
build ${builddir}/util.o: compile util.c
build sei: link ${builddir}/drw.o ${builddir}/dwm.o ${builddir}/util.o
build install: install sei
pool = console
restat = 1
build uninstall: uninstall
pool = console
restat = 1
default sei