]> gitweb.michael.orlitzky.com - firefox-user-prefs.git/blobdiff - makefile
makefile: add the makefile to build/install the thing.
[firefox-user-prefs.git] / makefile
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;