feat: makefile handles git and cache paths

This commit is contained in:
NunoSempere 2023-03-28 22:07:25 -06:00
parent fc9cc67538
commit b49a808739

View File

@ -43,7 +43,25 @@ STYLE_BLUEPRINT=webkit
FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
## Commands
## Hardcoded paths
## Cache
USER=`whoami`
DEFAULT_CACHE_DIR=/home/loki/.cache/rose
CURRENT_CACHE_DIR=/home/$(USER)/.cache/rose
## dir
DEFAULT_DIR='/home/loki/Documents/core/software/fresh/C/rose-browser/rosenrot'
CURRENT_DIR=`pwd`
build: $(SRC) $(PLUGS) $(CONFIG)
# Make cache
mkdir -p $(CURRENT_CACHE_DIR)
# Hardcode cache path
find $(CURRENT_DIR) -type f -not -path "*.git*" -not -path "*makefile*" -exec \
sed -i "s|$(DEFAULT_CACHE_DIR)|$(CURRENT_CACHE_DIR)|g" {} +
# Hardcode git repository path
find $(CURRENT_DIR) -type f -not -path "*.git*" -not -path "*makefile*" -exec \
sed -i "s|$(DEFAULT_DIR)|$(CURRENT_DIR)|g" {} +
# Compile rosenrot
$(CC) $(DEBUG) $(INCS) $(PLUGS) $(SRC) -o rose $(LIBS) $(ADBLOCK)
install: rose
@ -56,11 +74,12 @@ uninstall:
rm -r /usr/share/themes/rose
rm /usr/bin/rose
rm /usr/bin/rose-mklink
rm $(CACHE_DIR)
clean:
rm rose
rm $(CACHE_DIR)
format: $(SRC) $(PLUGS)
$(FORMATTER) $(SRC) $(PLUGS)