about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJohn C. Vernaleo <john@netpurgatory.com>2013-10-24 07:08:55 -0700
committerJohn C. Vernaleo <john@netpurgatory.com>2013-10-24 07:08:55 -0700
commit141cc143bdaee811d5b797389168cdaecda134bb (patch)
tree195366fefedf86e39a0eed6aae8cdf1bab3d021c
parent2574b021d3b76ea76ac62ef534810b66c0a3b08f (diff)
parent4cea11d2553c18bc8a8ae3a384c2dfea321f1b7e (diff)
downloadxombrero-141cc143bdaee811d5b797389168cdaecda134bb.tar.gz
Merge pull request #19 from andrewshadura/andrewsh/makefiles
Synchronise makefiles, add BSD makefile for Linux.
-rw-r--r--Makefile4
-rw-r--r--linux/GNUmakefile109
-rw-r--r--linux/Makefile188
-rw-r--r--netbsd/Makefile17
4 files changed, 206 insertions, 112 deletions
diff --git a/Makefile b/Makefile
index d12ca38..39cd2bd 100644
--- a/Makefile
+++ b/Makefile
@@ -59,8 +59,8 @@ beforeinstall:
 	install -m 755 -d ${PREFIX}/man/man1/
 	install -m 755 -d ${PREFIX}/share/xombrero
 	install -m 755 -d ${PREFIX}/share/applications
-	install -m 644 $(.CURDIR)/xombrero.css ${PREFIX}/share/xombrero
-	install -m 644 $(.CURDIR)/xombrero.desktop ${PREFIX}/share/applications
+	install -m 644 ${.CURDIR}/xombrero.css ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/xombrero.desktop ${PREFIX}/share/applications
 	install -m 644 ${.CURDIR}/xombreroicon16.png ${PREFIX}/share/xombrero
 	install -m 644 ${.CURDIR}/xombreroicon32.png ${PREFIX}/share/xombrero
 	install -m 644 ${.CURDIR}/xombreroicon48.png ${PREFIX}/share/xombrero
diff --git a/linux/GNUmakefile b/linux/GNUmakefile
new file mode 100644
index 0000000..f1dbbd1
--- /dev/null
+++ b/linux/GNUmakefile
@@ -0,0 +1,109 @@
+GTK_VERSION?= gtk3
+ifeq ("${GTK_VERSION}", "gtk2")
+JS_CF=$(shell pkg-config --silence-errors --cflags javascriptcoregtk-1.0)
+JS_LD=$(shell pkg-config --silence-errors --libs javascriptcoregtk-1.0)
+else
+JS_CF=$(shell pkg-config --silence-errors --cflags javascriptcoregtk-3.0)
+JS_LD=$(shell pkg-config --silence-errors --libs javascriptcoregtk-3.0)
+endif
+
+LIBS= glib-2.0
+ifeq ("${GTK_VERSION}", "gtk2")
+LIBS+= gtk+-2.0 webkit-1.0
+CFLAGS+=-I/usr/include/gtk-2.0
+else
+LIBS+= gtk+-3.0 webkitgtk-3.0
+CFLAGS+=-I/usr/include/gtk-3.0
+endif
+LIBS+= libsoup-2.4 gnutls libbsd
+
+CFLAGS+= -O2 -Wall -ggdb3 -D_GNU_SOURCE -I. -I.. $(shell pkg-config --cflags $(LIBS)) $(JS_CF)
+LDADD+= $(shell pkg-config --libs $(LIBS)) $(JS_LD) -ldl -lX11
+
+PREFIX?= /usr/local
+BINDIR?= $(PREFIX)/bin
+APPDIR?= $(PREFIX)/share/applications
+MANDIR?= $(PREFIX)/share/man
+RESDIR?= $(PREFIX)/share/xombrero
+
+SRCS= $(shell ls ../*.c)
+SRCS+= linux.c
+OBJS= $(SRCS:.c=.o)
+DEPS= $(addsuffix .depend, $(OBJS))
+
+CC?= gcc
+
+BUILDVERSION= $(shell sh $(CURDIR)/../buildver.sh)
+ifneq ("${BUILDVERSION}", "")
+CFLAGS+= -DXOMBRERO_BUILDSTR=\"$(BUILDVERSION)\"
+endif
+
+all: javascript.h tooltip.h xombrero
+
+javascript.h: ../js-merge-helper.pl ../hinting.js ../autoscroll.js
+	perl ../js-merge-helper.pl ../hinting.js ../input-focus.js \
+	../autoscroll.js > javascript.h
+
+tooltip.h: ../ascii2txt.pl ../txt2tooltip.pl ../xombrero.1
+	nroff -c -Tascii -mandoc ../xombrero.1 | \
+	perl ../ascii2txt.pl | \
+	perl ../txt2tooltip.pl > tooltip.h
+
+xombrero: $(OBJS)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ $(LDADD)
+
+%.o: %.c
+	@echo "Generating $@.depend"
+	@$(CC) -MM $(CPPFLAGS) $(CFLAGS) $< | \
+	sed 's,^.*\.o[ :]*,$@ $@.depend : ,g' > $@.depend
+	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
+
+install: all
+	install -m 755 -d $(DESTDIR)$(BINDIR)
+	install -m 755 -d $(DESTDIR)$(MANDIR)/man1
+	install -m 755 -d $(DESTDIR)$(RESDIR)
+	install -m 755 -d $(DESTDIR)$(APPDIR)
+	install -m 755 xombrero $(DESTDIR)$(BINDIR)
+	install -m 644 ../xombrero.1 $(DESTDIR)$(MANDIR)/man1/xombrero.1
+	install -m 644 ../xombrero.css $(DESTDIR)$(RESDIR)
+	install -m 644 ../xombrero.desktop $(DESTDIR)$(APPDIR)
+	install -m 644 ../xombreroicon16.png $(DESTDIR)$(RESDIR)
+	install -m 644 ../xombreroicon32.png $(DESTDIR)$(RESDIR)
+	install -m 644 ../xombreroicon48.png $(DESTDIR)$(RESDIR)
+	install -m 644 ../xombreroicon64.png $(DESTDIR)$(RESDIR)
+	install -m 644 ../xombreroicon128.png $(DESTDIR)$(RESDIR)
+	install -m 644 ../xombreroicon256.png $(DESTDIR)$(RESDIR)
+	install -m 644 ../favicon.ico $(DESTDIR)$(RESDIR)
+	install -m 644 ../tld-rules $(DESTDIR)$(RESDIR)
+	install -m 644 ../style.css $(DESTDIR)$(RESDIR)
+	install -m 644 ../hsts-preload $(DESTDIR)$(RESDIR)
+	install -m 644 ../torenabled.ico $(DESTDIR)$(RESDIR)
+	install -m 644 ../tordisabled.ico $(DESTDIR)$(RESDIR)
+
+uninstall:
+	rm -f $(DESTDIR)$(BINDIR)/xombrero
+	rm -f $(DESTDIR)$(MANDIR)/man1/xombrero.1
+	rm -f $(DESTDIR)$(APPDIR)/xombrero.desktop
+	rm -f $(DESTDIR)$(RESDIR)/xombreroicon16.png
+	rm -f $(DESTDIR)$(RESDIR)/xombreroicon32.png
+	rm -f $(DESTDIR)$(RESDIR)/xombreroicon48.png
+	rm -f $(DESTDIR)$(RESDIR)/xombreroicon64.png
+	rm -f $(DESTDIR)$(RESDIR)/xombreroicon128.png
+	rm -f $(DESTDIR)$(RESDIR)/xombreroicon256.png
+	rm -f $(DESTDIR)$(RESDIR)/xombrero.css
+	rm -f $(DESTDIR)$(RESDIR)/favicon.ico
+	rm -f $(DESTDIR)$(RESDIR)/tordisabled.ico
+	rm -f $(DESTDIR)$(RESDIR)/torenabled.ico
+	rm -f $(DESTDIR)$(RESDIR)/tld-rules
+	rm -f $(DESTDIR)$(RESDIR)/style.css
+	rm -f $(DESTDIR)$(RESDIR)/hsts-preload
+	if [ -d $(DESTDIR)$(RESDIR) ]; then rmdir $(DESTDIR)$(RESDIR); fi
+clean:
+	rm -f xombrero $(OBJS) $(DEPS)
+	rm -f javascript.h
+	rm -f tooltip.h
+
+
+-include $(DEPS)
+
+.PHONY: all install clean
diff --git a/linux/Makefile b/linux/Makefile
index f1dbbd1..165c6b0 100644
--- a/linux/Makefile
+++ b/linux/Makefile
@@ -1,109 +1,87 @@
-GTK_VERSION?= gtk3
-ifeq ("${GTK_VERSION}", "gtk2")
-JS_CF=$(shell pkg-config --silence-errors --cflags javascriptcoregtk-1.0)
-JS_LD=$(shell pkg-config --silence-errors --libs javascriptcoregtk-1.0)
-else
-JS_CF=$(shell pkg-config --silence-errors --cflags javascriptcoregtk-3.0)
-JS_LD=$(shell pkg-config --silence-errors --libs javascriptcoregtk-3.0)
-endif
+PREFIX?=/usr/local
+BINDIR=${PREFIX}/bin
 
-LIBS= glib-2.0
-ifeq ("${GTK_VERSION}", "gtk2")
-LIBS+= gtk+-2.0 webkit-1.0
-CFLAGS+=-I/usr/include/gtk-2.0
-else
-LIBS+= gtk+-3.0 webkitgtk-3.0
-CFLAGS+=-I/usr/include/gtk-3.0
-endif
-LIBS+= libsoup-2.4 gnutls libbsd
+PROG=xombrero
+MAN=xombrero.1
 
-CFLAGS+= -O2 -Wall -ggdb3 -D_GNU_SOURCE -I. -I.. $(shell pkg-config --cflags $(LIBS)) $(JS_CF)
-LDADD+= $(shell pkg-config --libs $(LIBS)) $(JS_LD) -ldl -lX11
+DEBUG= -g
 
-PREFIX?= /usr/local
-BINDIR?= $(PREFIX)/bin
-APPDIR?= $(PREFIX)/share/applications
-MANDIR?= $(PREFIX)/share/man
-RESDIR?= $(PREFIX)/share/xombrero
-
-SRCS= $(shell ls ../*.c)
+SRCS= cookie.c inspector.c marco.c about.c whitelist.c settings.c inputfocus.c
+SRCS+= history.c completion.c tldlist.c externaleditor.c unix.c xombrero.c
 SRCS+= linux.c
-OBJS= $(SRCS:.c=.o)
-DEPS= $(addsuffix .depend, $(OBJS))
-
-CC?= gcc
-
-BUILDVERSION= $(shell sh $(CURDIR)/../buildver.sh)
-ifneq ("${BUILDVERSION}", "")
-CFLAGS+= -DXOMBRERO_BUILDSTR=\"$(BUILDVERSION)\"
-endif
-
-all: javascript.h tooltip.h xombrero
-
-javascript.h: ../js-merge-helper.pl ../hinting.js ../autoscroll.js
-	perl ../js-merge-helper.pl ../hinting.js ../input-focus.js \
-	../autoscroll.js > javascript.h
-
-tooltip.h: ../ascii2txt.pl ../txt2tooltip.pl ../xombrero.1
-	nroff -c -Tascii -mandoc ../xombrero.1 | \
-	perl ../ascii2txt.pl | \
-	perl ../txt2tooltip.pl > tooltip.h
-
-xombrero: $(OBJS)
-	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ $(LDADD)
-
-%.o: %.c
-	@echo "Generating $@.depend"
-	@$(CC) -MM $(CPPFLAGS) $(CFLAGS) $< | \
-	sed 's,^.*\.o[ :]*,$@ $@.depend : ,g' > $@.depend
-	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
-
-install: all
-	install -m 755 -d $(DESTDIR)$(BINDIR)
-	install -m 755 -d $(DESTDIR)$(MANDIR)/man1
-	install -m 755 -d $(DESTDIR)$(RESDIR)
-	install -m 755 -d $(DESTDIR)$(APPDIR)
-	install -m 755 xombrero $(DESTDIR)$(BINDIR)
-	install -m 644 ../xombrero.1 $(DESTDIR)$(MANDIR)/man1/xombrero.1
-	install -m 644 ../xombrero.css $(DESTDIR)$(RESDIR)
-	install -m 644 ../xombrero.desktop $(DESTDIR)$(APPDIR)
-	install -m 644 ../xombreroicon16.png $(DESTDIR)$(RESDIR)
-	install -m 644 ../xombreroicon32.png $(DESTDIR)$(RESDIR)
-	install -m 644 ../xombreroicon48.png $(DESTDIR)$(RESDIR)
-	install -m 644 ../xombreroicon64.png $(DESTDIR)$(RESDIR)
-	install -m 644 ../xombreroicon128.png $(DESTDIR)$(RESDIR)
-	install -m 644 ../xombreroicon256.png $(DESTDIR)$(RESDIR)
-	install -m 644 ../favicon.ico $(DESTDIR)$(RESDIR)
-	install -m 644 ../tld-rules $(DESTDIR)$(RESDIR)
-	install -m 644 ../style.css $(DESTDIR)$(RESDIR)
-	install -m 644 ../hsts-preload $(DESTDIR)$(RESDIR)
-	install -m 644 ../torenabled.ico $(DESTDIR)$(RESDIR)
-	install -m 644 ../tordisabled.ico $(DESTDIR)$(RESDIR)
-
-uninstall:
-	rm -f $(DESTDIR)$(BINDIR)/xombrero
-	rm -f $(DESTDIR)$(MANDIR)/man1/xombrero.1
-	rm -f $(DESTDIR)$(APPDIR)/xombrero.desktop
-	rm -f $(DESTDIR)$(RESDIR)/xombreroicon16.png
-	rm -f $(DESTDIR)$(RESDIR)/xombreroicon32.png
-	rm -f $(DESTDIR)$(RESDIR)/xombreroicon48.png
-	rm -f $(DESTDIR)$(RESDIR)/xombreroicon64.png
-	rm -f $(DESTDIR)$(RESDIR)/xombreroicon128.png
-	rm -f $(DESTDIR)$(RESDIR)/xombreroicon256.png
-	rm -f $(DESTDIR)$(RESDIR)/xombrero.css
-	rm -f $(DESTDIR)$(RESDIR)/favicon.ico
-	rm -f $(DESTDIR)$(RESDIR)/tordisabled.ico
-	rm -f $(DESTDIR)$(RESDIR)/torenabled.ico
-	rm -f $(DESTDIR)$(RESDIR)/tld-rules
-	rm -f $(DESTDIR)$(RESDIR)/style.css
-	rm -f $(DESTDIR)$(RESDIR)/hsts-preload
-	if [ -d $(DESTDIR)$(RESDIR) ]; then rmdir $(DESTDIR)$(RESDIR); fi
-clean:
-	rm -f xombrero $(OBJS) $(DEPS)
-	rm -f javascript.h
-	rm -f tooltip.h
-
-
--include $(DEPS)
-
-.PHONY: all install clean
+.PATH: ${.CURDIR}/..
+
+CFLAGS+= -O2 -Wall -Wno-format-extra-args -Wunused -Wextra -Wno-unused-parameter 
+CFLAGS+= -Wno-missing-field-initializers -Wno-sign-compare
+CFLAGS+= -Wno-deprecated-declarations -Wfloat-equal ${DEBUG}
+CFLAGS+= -DGTK_DISABLE_SINGLE_INCLUDES -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE
+CFLAGS+= -DGDK_DISABLE_DEPRECATION_WARNINGS -DGLIB_DISABLE_DEPRECATION_WARNINGS
+CFLAGS+= -I. -I..
+CFLAGS+= -D_GNU_SOURCE
+LDADD= -lutil -lbsd -ldl
+GTK_VERSION ?= gtk3
+.if ${GTK_VERSION} == "gtk2"
+LIBS+= gtk+-2.0
+LIBS+= webkit-1.0
+.else
+LIBS+= gtk+-3.0
+LIBS+= webkitgtk-3.0
+.endif
+LIBS+= libsoup-2.4
+LIBS+= gnutls
+GTK_CFLAGS!= pkg-config --cflags $(LIBS)
+GTK_LDFLAGS!= pkg-config --libs $(LIBS)
+CFLAGS+= $(GTK_CFLAGS)
+LDFLAGS+= $(GTK_LDFLAGS)
+BUILDVERSION != sh "${.CURDIR}/../buildver.sh"
+.if !${BUILDVERSION} == ""
+CPPFLAGS+= -DXOMBRERO_BUILDSTR=\"$(BUILDVERSION)\"
+.endif
+
+MANDIR= ${PREFIX}/share/man/
+
+CLEANFILES += ${.CURDIR}/javascript.h javascript.h tooltip.h xombrero.cat1 xombrero.core
+
+JSFILES += ../hinting.js
+JSFILES += ../input-focus.js
+JSFILES += ../autoscroll.js
+
+.for _js in ${JSFILES}
+JSCURDIR += ${.CURDIR}/${_js}
+.endfor
+
+.NOPATH: javascript.h tooltip.h
+javascript.h: ${JSFILES} ../js-merge-helper.pl
+	perl ${.CURDIR}/../js-merge-helper.pl \
+		${JSCURDIR} > javascript.h
+
+tooltip.h: ${MAN} ../ascii2txt.pl ../txt2tooltip.pl
+	mandoc -Tascii ${.CURDIR}/../${MAN} | \
+		perl ${.CURDIR}/../ascii2txt.pl | \
+		perl ${.CURDIR}/../txt2tooltip.pl > tooltip.h
+
+beforeinstall:
+	install -m 755 -d ${PREFIX}/bin
+	install -m 755 -d ${MANDIR}/man1/
+	install -m 755 -d ${PREFIX}/share/xombrero
+	install -m 755 -d ${PREFIX}/share/applications
+	install -m 644 ${.CURDIR}/../xombrero.css ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../xombrero.desktop ${PREFIX}/share/applications
+	install -m 644 ${.CURDIR}/../xombreroicon16.png ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../xombreroicon32.png ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../xombreroicon48.png ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../xombreroicon64.png ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../xombreroicon128.png ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../xombreroicon256.png ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../favicon.ico ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../tld-rules ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../style.css ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../hsts-preload ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../user-agent-headers ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../http-accept-headers ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../torenabled.ico ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../tordisabled.ico ${PREFIX}/share/xombrero
+
+${PROG} ${OBJS} beforedepend: javascript.h tooltip.h
+
+.include <bsd.prog.mk>
diff --git a/netbsd/Makefile b/netbsd/Makefile
index b77fd25..de7e892 100644
--- a/netbsd/Makefile
+++ b/netbsd/Makefile
@@ -11,8 +11,9 @@ SRCS+= history.c completion.c tldlist.c externaleditor.c unix.c xombrero.c
 SRCS+= netbsd.c
 .PATH: ${.CURDIR}/..
 
-CFLAGS+= -O2 -Wall -Wno-format-extra-args -Wunused
-CFLAGS+= -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare ${DEBUG}
+CFLAGS+= -O2 -Wall -Wno-format-extra-args -Wunused -Wextra -Wno-unused-parameter 
+CFLAGS+= -Wno-missing-field-initializers -Wno-sign-compare
+CFLAGS+= -Wno-deprecated-declarations -Wfloat-equal ${DEBUG}
 CFLAGS+= -DGTK_DISABLE_SINGLE_INCLUDES -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE
 CFLAGS+= -DGDK_DISABLE_DEPRECATION_WARNINGS -DGLIB_DISABLE_DEPRECATION_WARNINGS
 CFLAGS+= -I. -I..
@@ -60,10 +61,12 @@ tooltip.h: ${MAN} ../ascii2txt.pl ../txt2tooltip.pl
 
 beforeinstall:
 	install -m 755 -d ${PREFIX}/bin
-	install -m 755 -d ${PREFIX}/man/man1/
-	install -m 755 -d ${PREFIX}/man/html1/
+	install -m 755 -d ${MANDIR}/man1/
+	install -m 755 -d ${MANDIR}/html1/
 	install -m 755 -d ${PREFIX}/share/xombrero
-	install -m 644 $(.CURDIR)/../xombrero.css ${PREFIX}/share/xombrero
+	install -m 755 -d ${PREFIX}/share/applications
+	install -m 644 ${.CURDIR}/../xombrero.css ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../xombrero.desktop ${PREFIX}/share/applications
 	install -m 644 ${.CURDIR}/../xombreroicon16.png ${PREFIX}/share/xombrero
 	install -m 644 ${.CURDIR}/../xombreroicon32.png ${PREFIX}/share/xombrero
 	install -m 644 ${.CURDIR}/../xombreroicon48.png ${PREFIX}/share/xombrero
@@ -74,6 +77,10 @@ beforeinstall:
 	install -m 644 ${.CURDIR}/../tld-rules ${PREFIX}/share/xombrero
 	install -m 644 ${.CURDIR}/../style.css ${PREFIX}/share/xombrero
 	install -m 644 ${.CURDIR}/../hsts-preload ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../user-agent-headers ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../http-accept-headers ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../torenabled.ico ${PREFIX}/share/xombrero
+	install -m 644 ${.CURDIR}/../tordisabled.ico ${PREFIX}/share/xombrero
 
 ${PROG} ${OBJS} beforedepend: javascript.h tooltip.h
 
837' href='#n837'>837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934