CFLAGS += -Wno-unused-parameter -Wunknown-warning-option -D_XOPEN_SOURCE="700" LIBS = `pkg-config --cflags --libs gtk+-3.0 glib-2.0 webkit2gtk-4.0` EXTENSIONS = extensions/we_adblock PREFIX = /usr/local bindir = $(DESTDIR)$(PREFIX)/bin libdir = $(DESTDIR)$(PREFIX)/lib datadir = $(DESTDIR)$(PREFIX)/share mandir = $(DESTDIR)/$(PREFIX)/man .PHONY: chorizo clean uninstall install extensions update-darkreader all: chorizo chorizo: $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) -o chorizo *.c format: for i in *.c *.h; do clang-format $$i > tmp; mv tmp $$i; done headers: mv config.h tmp rm chorizo.h makeheaders -h *.[ch] > tmp2 mv tmp config.h mv tmp2 chorizo.h $(EXTENSIONS): $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@.so -fPIC $@.c $(LIBS); extensions: $(EXTENSIONS) install: all mkdir -p $(bindir) \ $(mandir)/man1 \ $(libdir)/chorizo/web-extensions \ $(datadir)/chorizo/user-scripts cp chorizo $(bindir)/ cp chorizo.1 $(mandir)/man1/ makewhatis /usr/local/man cp -r extensions/*.so $(libdir)/chorizo/web-extensions/ cp -r user-scripts/* $(datadir)/chorizo/user-scripts/ uninstall: rm -rf $(bindir)/chorizo \ $(libdir)/chorizo \ $(mandir)/man1/chorizo* \ $(datadir)/chorizo reinstall: uninstall install update-darkreader: curl -L "https://cdn.jsdelivr.net/npm/darkreader/darkreader.min.js" \ -o user-scripts/darkreader.js echo >> user-scripts/darkreader.js echo 'DarkReader.enable({brightness:100,contrast:100,sepia:0});' \ >> user-scripts/darkreader.js clean: rm -fv chorizo extensions/*.so