tweak: add formatter to makefile

This commit is contained in:
NunoSempere 2023-03-28 11:11:18 -06:00
parent 1fca042b0b
commit 18f4e3e3cb
3 changed files with 27 additions and 9 deletions

View File

@ -1,4 +1,9 @@
# Variables # make
# make build
# (sudo) make install
# make format
# make clean
# make uninstall
## C compiler ## C compiler
CC=clang CC=clang
@ -13,27 +18,31 @@ DEBUG= #'-g'
INCS=`pkg-config --cflags ${DEPS}` INCS=`pkg-config --cflags ${DEPS}`
LIBS=`pkg-config --libs ${DEPS}` LIBS=`pkg-config --libs ${DEPS}`
# Plugins ## Optional adblocking
# REQS=./plugins/stand_in/stand_in.c ## depends on https://github.com/jun7/wyebadblock
ADBLOCK='-L/usr/lib/wyebrowser/adblock.so'
## Plugins
LIBRE_REDIRECT=./plugins/libre_redirect/libre_redirect.c ./plugins/libre_redirect/str_replace_start.c LIBRE_REDIRECT=./plugins/libre_redirect/libre_redirect.c ./plugins/libre_redirect/str_replace_start.c
READABILITY=./plugins/readability/readability.c READABILITY=./plugins/readability/readability.c
STYLE=./plugins/style/style.c CUSTOM_STYLES=./plugins/style/style.c
STAND_IN=./plugins/stand_in/stand_in.c # gives function definitions for the above, which do nothing STAND_IN=./plugins/stand_in/stand_in.c # gives function definitions for the above, which do nothing
PLUGS=$(LIBRE_REDIRECT) $(READABILITY) $(STYLE) PLUGS=$(LIBRE_REDIRECT) $(READABILITY) $(CUSTOM_STYLES)
# PLUGS=$(STAND_IN) # PLUGS=$(STAND_IN)
# Note that if you want some plugins but not others, # Note that if you want some plugins but not others,
# You should edit the stand_in.c file # You should edit the stand_in.c file
# Optional adblocking
# depends on https://github.com/jun7/wyebadblock
ADBLOCK='-L/usr/lib/wyebrowser/adblock.so'
# CONFIG # CONFIG
CONFIG=config.h CONFIG=config.h
# cp -f config.def.h config.h # cp -f config.def.h config.h
## Formatter
STYLE_BLUEPRINT=webkit
FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
## Commands
build: $(SRC) $(PLUGS) $(CONFIG) build: $(SRC) $(PLUGS) $(CONFIG)
$(CC) $(DEBUG) $(INCS) $(PLUGS) $(SRC) -o rose $(LIBS) $(ADBLOCK) $(CC) $(DEBUG) $(INCS) $(PLUGS) $(SRC) -o rose $(LIBS) $(ADBLOCK)
@ -43,3 +52,7 @@ install: rose
cp style.css /usr/share/themes/rose/ cp style.css /usr/share/themes/rose/
cp rose-mklink /usr/bin cp rose-mklink /usr/bin
format: $(SRC) $(PLUGS)
$(FORMATTER) $(SRC) $(PLUGS)

View File

@ -0,0 +1,5 @@
DEPS='webkit2gtk-4.0'
INCS=`pkg-config --cflags ${DEPS}`
LIBS=`pkg-config --libs ${DEPS}`
echo $INCS
echo $LIBS