2024-02-11 21:13:53 +00:00
|
|
|
# C compiler
|
2024-03-14 22:31:04 +00:00
|
|
|
CC=gcc # alternatives: tcc, clang, zig cc
|
2023-03-28 16:59:38 +00:00
|
|
|
|
2024-02-11 21:13:53 +00:00
|
|
|
# Dependencies
|
2024-03-12 16:37:28 +00:00
|
|
|
DEPS='webkit2gtk-4.1'
|
2023-03-28 16:59:38 +00:00
|
|
|
INCS=`pkg-config --cflags ${DEPS}`
|
|
|
|
LIBS=`pkg-config --libs ${DEPS}`
|
|
|
|
|
2024-02-11 21:13:53 +00:00
|
|
|
# Code
|
2024-03-14 18:47:36 +00:00
|
|
|
SRC=rosenrot.c
|
2024-02-11 21:13:53 +00:00
|
|
|
CONFIG=config.h
|
2023-03-28 17:11:18 +00:00
|
|
|
|
|
|
|
## Formatter
|
2024-03-23 21:10:59 +00:00
|
|
|
STYLE_BLUEPRINT="{BasedOnStyle: webkit, AllowShortIfStatementsOnASingleLine: true, IndentCaseLabels: true, AllowShortEnumsOnASingleLine: true}"
|
2023-03-28 17:11:18 +00:00
|
|
|
FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
|
|
|
|
|
2024-03-24 00:51:55 +00:00
|
|
|
build: $(SRC) $(CONFIG) user_cache
|
|
|
|
$(CC) $(INCS) $(SRC) -o rosenrot $(LIBS) $(ADBLOCK)
|
2023-05-09 02:48:22 +00:00
|
|
|
|
2024-03-14 22:31:04 +00:00
|
|
|
user_cache:
|
2024-03-15 00:05:56 +00:00
|
|
|
@if [ `id -u` -eq 0 ]; then echo "can't run make user_cache with sudo, because USER_CACHE_DIR would be /home/root/.cache"; return 1; fi
|
|
|
|
@echo "# Create user cache"
|
2024-03-14 22:31:04 +00:00
|
|
|
mkdir -p $(USER_CACHE_DIR)
|
|
|
|
find . -type f -not -path "*.git*" -not -path "*makefile*" -exec \
|
|
|
|
sed -i "s|$(MAINTAINER_CACHE_DIR)|$(USER_CACHE_DIR)|g" {} +
|
2024-03-15 00:05:56 +00:00
|
|
|
@echo
|
2024-03-14 22:31:04 +00:00
|
|
|
|
2024-03-24 00:51:55 +00:00
|
|
|
install: rosenrot
|
2024-03-14 18:47:36 +00:00
|
|
|
cp -f rosenrot /usr/bin
|
2023-03-28 16:59:38 +00:00
|
|
|
|
2023-03-28 17:44:54 +00:00
|
|
|
uninstall:
|
2024-03-14 18:47:36 +00:00
|
|
|
rm /usr/bin/rosenrot
|
2024-03-14 22:31:04 +00:00
|
|
|
rm $(USER_CACHE_DIR)
|
2023-03-28 17:44:54 +00:00
|
|
|
|
|
|
|
clean:
|
2024-03-14 18:47:36 +00:00
|
|
|
rm rosenrot
|
2024-03-14 22:31:04 +00:00
|
|
|
rm $(USER_CACHE_DIR)
|
2023-03-28 17:44:54 +00:00
|
|
|
|
2024-02-11 14:56:53 +00:00
|
|
|
format: $(SRC) $(PLUGINS)
|
2024-03-14 18:47:36 +00:00
|
|
|
$(FORMATTER) $(SRC) $(PLUGINS) $(rosenrot.h)
|
2024-03-12 17:16:29 +00:00
|
|
|
|
2024-03-14 17:58:59 +00:00
|
|
|
lint:
|
2024-03-24 00:51:55 +00:00
|
|
|
clang-tidy $(SRC) -- -Wall $(INCS) -o rosenrot $(LIBS)
|