2023-04-29 22:27:11 +00:00
|
|
|
# make
|
|
|
|
# make build
|
|
|
|
# (sudo) make install
|
|
|
|
# make format
|
|
|
|
# make clean
|
|
|
|
# make uninstall
|
|
|
|
|
|
|
|
## C compiler
|
2023-05-02 01:19:46 +00:00
|
|
|
CC=tcc # much faster compilation than gcc
|
2023-05-01 22:23:26 +00:00
|
|
|
COMPILER_FLAGS=#-g3 -Wall -Wextra -Wconversion -Wdouble-promotion -Wno-unused-parameter -Wno-unused-function -Wno-sign-conversion -fsanitize=undefined
|
|
|
|
# exclude: -fsanitize-trap, because I'm using an old version of gcc and couldn't bother getting a new one.
|
2023-05-01 14:30:10 +00:00
|
|
|
## ^ from <https://nullprogram.com/blog/2023/04/29/>
|
|
|
|
## <https://news.ycombinator.com/item?id=35758898>
|
2023-04-29 22:27:11 +00:00
|
|
|
|
2023-04-29 22:56:11 +00:00
|
|
|
## Debugging options
|
|
|
|
DEBUG=-g#-g
|
|
|
|
|
2023-04-29 22:27:11 +00:00
|
|
|
## Main file
|
2023-04-29 22:56:11 +00:00
|
|
|
SRC=./src/mumble.c
|
2023-04-30 04:41:57 +00:00
|
|
|
MPC=./src/mpc/mpc.c
|
|
|
|
|
|
|
|
## Dependencies
|
|
|
|
DEPS_PC=libedit
|
|
|
|
# ^ libm, which doesn't have files which pkg-config can find, grr.
|
|
|
|
DEBUG= #'-g'
|
|
|
|
|
|
|
|
INCS=`pkg-config --cflags ${DEPS_PC}`
|
|
|
|
LIBS_PC=`pkg-config --libs ${DEPS_PC}`
|
|
|
|
LIBS_DIRECT=-lm
|
|
|
|
LIBS=$(LIBS_DIRECT) $(LIBS_PC)
|
|
|
|
# $(CC) $(DEBUG) $(INCS) $(PLUGS) $(SRC) -o rose $(LIBS) $(ADBLOCK)
|
2023-04-29 22:27:11 +00:00
|
|
|
|
|
|
|
## Formatter
|
|
|
|
STYLE_BLUEPRINT=webkit
|
|
|
|
FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
|
|
|
|
|
|
|
|
build: $(SRC)
|
2023-05-01 14:30:10 +00:00
|
|
|
$(CC) $(COMPILER_FLAGS) $(INCS) $(SRC) $(MPC) -o mumble $(LIBS)
|
2023-04-29 22:27:11 +00:00
|
|
|
|
|
|
|
format: $(SRC)
|
|
|
|
$(FORMATTER) $(SRC)
|
|
|
|
|