]> git.armaanb.net Git - chorizo.git/blobdiff - Makefile
draft 8
[chorizo.git] / Makefile
index 40a4089b68f4726bc17888261b033dc31a375230..f634e8864d8d3961746872c9948b771f9aa7a5b3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
-CFLAGS += -std=c11 -Wall -Wextra -Wno-unused-parameter -D_XOPEN_SOURCE="700"
+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
@@ -8,7 +9,7 @@ mandir = $(DESTDIR)/$(PREFIX)/man
 
 .PHONY: chorizo clean uninstall install extensions update-darkreader
 
-all: extensions chorizo
+all: chorizo
 
 chorizo:
        $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) -o chorizo *.c
@@ -16,23 +17,27 @@ chorizo:
 format:
        for i in *.c *.h; do clang-format $$i > tmp; mv tmp $$i; done
 
-extensions:
-       for i in extensions/*.c; do \
-               outp=$$(echo "$$i" | sed 's/\$\.c/.so/g'); \
-               $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $$outp -fPIC $$i $(LIBS); \
-       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 \
-               $(mandir)/man7 \
                $(libdir)/chorizo/web-extensions \
                $(datadir)/chorizo/user-scripts
 
        cp chorizo $(bindir)/
 
        cp chorizo.1 $(mandir)/man1/
-       cp chorizo-usage.7 $(mandir)/man7/
        makewhatis /usr/local/man
 
        cp -r extensions/*.so $(libdir)/chorizo/web-extensions/
@@ -42,7 +47,6 @@ uninstall:
        rm -rf $(bindir)/chorizo \
                $(libdir)/chorizo \
                $(mandir)/man1/chorizo* \
-               $(mandir)/man7/chorizo* \
                $(datadir)/chorizo
 
 reinstall: uninstall install