From b49a808739c12a220e8f90cc3ea928cd914489cf Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Tue, 28 Mar 2023 22:07:25 -0600 Subject: [PATCH] feat: makefile handles git and cache paths --- makefile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index ec755d5..520a734 100644 --- a/makefile +++ b/makefile @@ -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) -