makefile: add the makefile to build/install the thing.
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 16 Mar 2019 14:13:47 +0000 (10:13 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sat, 16 Mar 2019 14:13:47 +0000 (10:13 -0400)
makefile [new file with mode: 0644]

diff --git a/makefile b/makefile
new file mode 100644 (file)
index 0000000..fee282e
--- /dev/null
+++ b/makefile
@@ -0,0 +1,25 @@
+OUTPUT = user.js
+SRCS = tracking speculation cookies ui certificates referer
+
+$(OUTPUT): $(SRCS)
+       cat $(SRCS) > $@
+
+clean:
+       rm -f $(OUTPUT)
+
+# Create a symlink from any profile directories under ~/.mozilla/firefox
+# to the output file in this directory. A "profile directory" is any
+# directory that has a "prefs.js" file in it.
+#
+# This will only work if you run "make install" in the same directory
+# as the makefile! This is fine; building the output file only works
+# in that one place too.
+.PHONY: install
+install: $(OUTPUT)
+       for dir in ~/.mozilla/firefox/*.*; do \
+           if [ -f "$${dir}/prefs.js" ]; then \
+             if [ ! -e "$${dir}/$(OUTPUT)" ]; then \
+               ln -s "$(shell pwd)/$(OUTPUT)" "$${dir}/$(OUTPUT)"; \
+             fi; \
+           fi; \
+       done;