From 1fca042b0bdb5978bd6ff3a2e982ced4154ceed3 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Tue, 28 Mar 2023 10:59:38 -0600 Subject: tweak: add rudimentary makefile --- .gitignore | 2 -- README.md | 1 + build.sh | 17 ---------------- install.sh | 8 -------- makefile | 45 +++++++++++++++++++++++++++++++++++++++++ plugins/stand_in/stand_in.c | 27 +++++++++++++++++++++++++ plugins/stand_in/stand_in.c.old | 27 ------------------------- 7 files changed, 73 insertions(+), 54 deletions(-) delete mode 100755 build.sh delete mode 100755 install.sh create mode 100644 makefile create mode 100644 plugins/stand_in/stand_in.c delete mode 100644 plugins/stand_in/stand_in.c.old diff --git a/.gitignore b/.gitignore index a72bfe9..49c7891 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ rose -# config.h -.clang-format diff --git a/README.md b/README.md index 596b271..3205ad6 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ You can see some screenshots in the [screenshots](./screenshots) folder. ### To do +- [ ] Look into using a makefile. - [ ] Look at using relative rather than absolute paths - [ ] Figure out if downloading files is doable. - [ ] Figure out better way to have plugins diff --git a/build.sh b/build.sh deleted file mode 100755 index 3518b0a..0000000 --- a/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -CC=clang -SRC=rose.c -# REQS=./plugins/stand_in/stand_in.c -REQS=./plugins/*/*.c -DEPS='webkit2gtk-4.0' -DEBUG= #'-g' - -INCS=`pkg-config --cflags ${DEPS}` -LIBS=`pkg-config --libs ${DEPS}` - -# Optional adblocking depends on https://github.com/jun7/wyebadblock -WYEBAB='-L/usr/lib/wyebrowser/adblock.so' - -# cp -f config.def.h config.h -$CC $DEBUG $INCS $REQS $SRC -o rose $LIBS $WYEBAB diff --git a/install.sh b/install.sh deleted file mode 100755 index 09c83e8..0000000 --- a/install.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -./build.sh && { - cp -f rose /usr/bin - mkdir -p /usr/share/themes/rose - cp style.css /usr/share/themes/rose/ - cp rose-mklink /usr/bin -} diff --git a/makefile b/makefile new file mode 100644 index 0000000..aca96da --- /dev/null +++ b/makefile @@ -0,0 +1,45 @@ +# Variables + +## C compiler +CC=clang + +## Main file +SRC=rose.c + +## Dependencies +DEPS='webkit2gtk-4.0' +DEBUG= #'-g' + +INCS=`pkg-config --cflags ${DEPS}` +LIBS=`pkg-config --libs ${DEPS}` + +# Plugins +# REQS=./plugins/stand_in/stand_in.c +LIBRE_REDIRECT=./plugins/libre_redirect/libre_redirect.c ./plugins/libre_redirect/str_replace_start.c +READABILITY=./plugins/readability/readability.c +STYLE=./plugins/style/style.c + +STAND_IN=./plugins/stand_in/stand_in.c # gives function definitions for the above, which do nothing + +PLUGS=$(LIBRE_REDIRECT) $(READABILITY) $(STYLE) +# PLUGS=$(STAND_IN) +# Note that if you want some plugins but not others, +# 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.h +# cp -f config.def.h config.h + +build: $(SRC) $(PLUGS) $(CONFIG) + $(CC) $(DEBUG) $(INCS) $(PLUGS) $(SRC) -o rose $(LIBS) $(ADBLOCK) + +install: rose + cp -f rose /usr/bin + mkdir -p /usr/share/themes/rose + cp style.css /usr/share/themes/rose/ + cp rose-mklink /usr/bin + diff --git a/plugins/stand_in/stand_in.c b/plugins/stand_in/stand_in.c new file mode 100644 index 0000000..dbcc7e8 --- /dev/null +++ b/plugins/stand_in/stand_in.c @@ -0,0 +1,27 @@ +/* Why this file is needed: + * If the plugins are disabled, + * their conditionals will never resolve + * and their functionality never comes into play + * but the compiler still wants to know their type +*/ + +int libre_redirect(const char* uri, char* uri_filtered){ + return 0; +} +void str_init(char* str, int n){ + +}; + +int str_replace_start(const char* string, const char* target, + const char* replacement, char* output){ + return 1; +}; + +void read_readability_js(char* string){ + +} + +void read_style_js(char* string){ + +} + diff --git a/plugins/stand_in/stand_in.c.old b/plugins/stand_in/stand_in.c.old deleted file mode 100644 index dbcc7e8..0000000 --- a/plugins/stand_in/stand_in.c.old +++ /dev/null @@ -1,27 +0,0 @@ -/* Why this file is needed: - * If the plugins are disabled, - * their conditionals will never resolve - * and their functionality never comes into play - * but the compiler still wants to know their type -*/ - -int libre_redirect(const char* uri, char* uri_filtered){ - return 0; -} -void str_init(char* str, int n){ - -}; - -int str_replace_start(const char* string, const char* target, - const char* replacement, char* output){ - return 1; -}; - -void read_readability_js(char* string){ - -} - -void read_style_js(char* string){ - -} - -- cgit v1.2.3