(48 lines)
1 PREFIX=2 CC ?= gcc3 O ?= -O24 CFLAGS=-std=c99 -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -Werror5 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-strings18 #CFLAGS += -fsanitize=address -fno-omit-frame-pointer19 ifeq ($(shell uname -s),Darwin)20 CFLAGS += -D_DARWIN_C_SOURCE21 endif22 G=23 LUA_DIR=/usr/local24 LUA_INC=$(LUA_DIR)/include25 LUA_BIN=$(LUA_DIR)/bin26 LUA= lua27 LUA_O_FLAGS=-fPIC28 ifeq ($(shell uname -s),Darwin)29 LUA_SHARED_FLAGS=-bundle -undefined dynamic_lookup30 else31 LUA_SHARED_FLAGS=-shared -fPIC32 endif34 all: btui.so36 clean:37 rm -f lbtui.o btui.so39 test: btui.so test.lua40 $(LUA) test.lua42 btui.so: lbtui.o ../btui.h43 $(CC) $(CFLAGS) $(CWARN) $(G) $(O) $(LUA_SHARED_FLAGS) -I$(LUA_INC) -o $@ $<45 lbtui.o: lbtui.c46 $(CC) $(CFLAGS) $(CWARN) $(G) $(O) $(LUA_O_FLAGS) -c -o $@ $<48 .PHONY: all, clean, testlua, test