cleanup makefile slightly, restore ubuntu-20.04 files

This commit is contained in:
NunoSempere 2024-03-14 14:58:59 -03:00
parent e75605959e
commit 9a27469a52
16 changed files with 27 additions and 25 deletions

0
.gitignore vendored
View File

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2022-2023 Nuño Sempere Copyright (c) 2022-2024 Nuño Sempere
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -2,9 +2,9 @@
CC=gcc # other options: tcc, clang, zig cc CC=gcc # other options: tcc, clang, zig cc
WARNINGS=-Wall WARNINGS=-Wall
DEBUG=#'-g' DEBUG=#'-g'
COMPILETIME_DEPRECATION_WARNINGS=#-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED # turns out that webkit2gtk-4.1 is using some deprecated stuff, lol
OPTIMIZED_SOME=-O3 OPTIMIZED_SOME=-O3
OPTIMIZED_MORE=-Ofast -march=native -funit-at-a-time -flto # binary will not be compatible with other computers, but may be much faster OPTIMIZED_MORE=-Ofast -march=native -funit-at-a-time -flto # binary will not be compatible with other computers, but may be much faster
# COMPILETIME_DEPRECATION_WARNINGS=#-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED # turns out that webkit2gtk-4.1 is using some deprecated stuff, lol
# Dependencies # Dependencies
DEPS='webkit2gtk-4.1' DEPS='webkit2gtk-4.1'
@ -32,8 +32,8 @@ FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
## Data dirs ## Data dirs
USER=`whoami` USER=`whoami`
DEFAULT_DATA_DIR=/home/nuno/.cache/rose DEFAULT_DATA_DIR=/home/nuno/.cache/rose
CURRENT_DATA_DIR=/home/$(USER)/.cache/rose USER_DATA_DIR=/home/$(USER)/.cache/rose
## dir ## Startup image dir
DEFAULT_DIR=/home/nuno/Documents/workspace/rosenrot DEFAULT_DIR=/home/nuno/Documents/workspace/rosenrot
CURRENT_DIR=`pwd` CURRENT_DIR=`pwd`
@ -42,32 +42,16 @@ build: $(SRC) $(PLUGINS) $(CONFIG)
cd plugins/readability/ && sh recompute_READABILITY_N.sh cd plugins/readability/ && sh recompute_READABILITY_N.sh
cd plugins/style && sh recompute_STYLE_N.sh cd plugins/style && sh recompute_STYLE_N.sh
# Make cache # Make cache
mkdir -p $(CURRENT_DATA_DIR) mkdir -p $(USER_DATA_DIR)
# Hardcode cache path # Hardcode cache path
find $(CURRENT_DIR) -type f -not -path "*.git*" -not -path "*makefile*" -exec \ find $(CURRENT_DIR) -type f -not -path "*.git*" -not -path "*makefile*" -exec \
sed -i "s|$(DEFAULT_DATA_DIR)|$(CURRENT_DATA_DIR)|g" {} + sed -i "s|$(DEFAULT_DATA_DIR)|$(USER_DATA_DIR)|g" {} +
# Hardcode git repository path # Hardcode git repository path
find $(CURRENT_DIR) -type f -not -path "*.git*" -not -path "*makefile*" -exec \ find $(CURRENT_DIR) -type f -not -path "*.git*" -not -path "*makefile*" -exec \
sed -i "s|$(DEFAULT_DIR)|$(CURRENT_DIR)|g" {} + sed -i "s|$(DEFAULT_DIR)|$(CURRENT_DIR)|g" {} +
# Compile rosenrot # Compile rosenrot
GIO_MODULE_DIR=/usr/lib/x86_64-linux-gnu/gio/modules/ GIO_MODULE_DIR=/usr/lib/x86_64-linux-gnu/gio/modules/
$(CC) $(WARNINGS) $(OPTIMIZED_MORE) $(DEBUG) $(INCS) $(PLUGINS) $(SRC) $(COMPILETIME_DEPRECATION_WARNINGS) -o rose $(LIBS) $(ADBLOCK) $(CC) $(WARNINGS) $(OPTIMIZED_MORE) $(DEBUG) $(INCS) $(PLUGINS) $(SRC) -o rose $(LIBS) $(ADBLOCK)
fast: $(SRC) $(PLUGINS) $(CONFIG)
rm -f *.gcda
GIO_MODULE_DIR=/usr/lib/x86_64-linux-gnu/gio/modules/
$(CC) $(WARNINGS) $(OPTIMIZED_MORE) -fprofile-generate $(INCS) $(PLUGINS) $(SRC) -o rose $(LIBS) $(ADBLOCK)
@echo "Now use the browser for a while to gather some profiling data"
sleep 2
./rose
$(CC) $(WARNINGS) $(OPTIMIZED_MORE) -fprofile-use $(INCS) $(PLUGINS) $(SRC) -o rose $(LIBS) $(ADBLOCK)
rm -f *.gcda
lint:
clang-tidy $(SRC) $(PLUGINS) -- -Wall -O3 `pkg-config --cflags 'webkit2gtk-4.1'` -o rose `pkg-config --libs 'webkit2gtk-4.1'`
inspect: build
GTK_DEBUG=interactive ./rose
install: rose install: rose
GIO_MODULE_DIR=/usr/lib/x86_64-linux-gnu/gio/modules/ GIO_MODULE_DIR=/usr/lib/x86_64-linux-gnu/gio/modules/
@ -91,6 +75,24 @@ clean:
format: $(SRC) $(PLUGINS) format: $(SRC) $(PLUGINS)
$(FORMATTER) $(SRC) $(PLUGINS) $(rose.h) $(FORMATTER) $(SRC) $(PLUGINS) $(rose.h)
lint:
clang-tidy $(SRC) $(PLUGINS) -- -Wall -O3 `pkg-config --cflags 'webkit2gtk-4.1'` -o rose `pkg-config --libs 'webkit2gtk-4.1'`
## A few more commands:
fast: $(SRC) $(PLUGINS) $(CONFIG)
rm -f *.gcda
GIO_MODULE_DIR=/usr/lib/x86_64-linux-gnu/gio/modules/
$(CC) $(WARNINGS) $(OPTIMIZED_MORE) -fprofile-generate $(INCS) $(PLUGINS) $(SRC) -o rose $(LIBS) $(ADBLOCK)
@echo "Now use the browser for a while to gather some profiling data"
sleep 2
./rose
$(CC) $(WARNINGS) $(OPTIMIZED_MORE) -fprofile-use $(INCS) $(PLUGINS) $(SRC) -o rose $(LIBS) $(ADBLOCK)
rm -f *.gcda
inspect: build
GTK_DEBUG=interactive ./rose
diagnose_deprecations: diagnose_deprecations:
G_ENABLE_DIAGNOSTIC=1 ./rose G_ENABLE_DIAGNOSTIC=1 ./rose

View File

@ -1 +0,0 @@
This uses the libwebkit2gtk-4.0 api. It is deprecated. See the debian version for how to use the -4.1 version instead. Package names might vary.

View File

@ -0,0 +1 @@
Code here uses the libwebkit2gtk-4.0 api. It is deprecated. See the debian version for how to use the -4.1 version instead. Package names might vary.

View File

Before

Width:  |  Height:  |  Size: 625 KiB

After

Width:  |  Height:  |  Size: 625 KiB

View File

Before

Width:  |  Height:  |  Size: 474 KiB

After

Width:  |  Height:  |  Size: 474 KiB

View File

Before

Width:  |  Height:  |  Size: 739 KiB

After

Width:  |  Height:  |  Size: 739 KiB

View File

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

View File

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 142 KiB

View File

Before

Width:  |  Height:  |  Size: 474 KiB

After

Width:  |  Height:  |  Size: 474 KiB