code / btui

Lines2.2K C1.2K Python549 Markdown219 make156 Lua49
(66 lines)
1 PREFIX=
2 CC ?= gcc
3 O ?= -O2
4 CFLAGS=-std=c99 -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -Werror -flto
5 CWARN=-Wall -Wpedantic -Wextra \
6 -Wsign-conversion -Wtype-limits -Wunused-result -Wnull-dereference \
7 -Waggregate-return -Walloc-zero -Walloca -Warith-conversion -Wcast-align -Wcast-align=strict \
8 -Wdangling-else -Wdate-time -Wdisabled-optimization -Wdouble-promotion -Wduplicated-branches \
9 -Wduplicated-cond -Wexpansion-to-defined -Wfloat-conversion -Wfloat-equal -Wformat-nonliteral \
10 -Wformat-security -Wformat-signedness -Wframe-address -Winline -Winvalid-pch -Wjump-misses-init \
11 -Wlogical-op -Wlong-long -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn \
12 -Wnull-dereference -Woverlength-strings -Wpacked -Wpacked-not-aligned -Wpointer-arith \
13 -Wredundant-decls -Wshadow -Wshadow=compatible-local -Wshadow=global -Wshadow=local \
14 -Wsign-conversion -Wstack-protector -Wsuggest-attribute=const -Wswitch-default -Wswitch-enum \
15 -Wsync-nand -Wtrampolines -Wundef -Wunused -Wunused-but-set-variable \
16 -Wunused-const-variable -Wunused-local-typedefs -Wvariadic-macros -Wvector-operation-performance \
17 -Wvla -Wwrite-strings
18 #CFLAGS += -fsanitize=address -fno-omit-frame-pointer
19 ifeq ($(shell uname -s),Darwin)
20 CFLAGS += -D_DARWIN_C_SOURCE
21 endif
22 G=
24 all: checksyntax
26 checksyntax: btui.h
27 $(CC) $(CFLAGS) $(CWARN) $(G) $(O) -fsyntax-only $<
29 clean:
30 @cd Lua; make clean
31 @cd C; make clean
32 @cd Python; make clean
34 %: %.c btui.h
35 $(CC) $(CFLAGS) $(CWARN) $(G) $(O) $< -o $@
37 c:
38 @cd C; make
40 testc:
41 @cd C; make G=$(G) O=$(O) test
43 rainbow:
44 @cd C; make rainbowdemo
46 lua:
47 @cd Lua; make
49 testlua:
50 @cd Lua; make test
52 python:
53 @cd Python; make
55 testpython:
56 @cd Python; make test
58 install:
59 mkdir -pv -m 755 "${PREFIX}/include" "${PREFIX}/man/man3" \
60 && cp -v btui.h "${PREFIX}/include/" \
61 && cp -v btui.3 "${PREFIX}/man/man3/"
63 uninstall:
64 rm -f "${PREFIX}/include/btui.h" "${PREFIX}/man/man3/btui.3"
66 .PHONY: all, checksyntax, clean, c, testc, lua, testlua, python, testpython, install, uninstall