subdirs=common
targets=download,surfer
#cppflags=-D EMBEDDED
cflags=-W -Wall -g -O2 -fPIE -D_FORTIFY_SOURCE=2 -fstack-protector
ldflags=-pie -Wl,-z,relro -Wl,-z,now
dist=Makefile,callbacks.h,common.h,download.h,ghtml.h,surfer.h,ghtml-gtkhtml.c,ghtml-gtkmozembed.c,ghtml-gtktextview.c,ghtml-webkit.c

[download]
type=binary
#cflags=`pkg-config --cflags libSystem gtk+-2.0 gnet-2.0`
#ldflags=`pkg-config --libs libSystem gtk+-2.0 gnet-2.0` -lintl
cppflags=-D WITH_WEBKIT
#cflags=`pkg-config --cflags libSystem gtk+-2.0 webkit-1.0`
#ldflags=`pkg-config --libs libSystem gtk+-2.0 webkit-1.0` -lintl
cflags=`pkg-config --cflags libSystem gtk+-x11-3.0 webkitgtk-3.0`
ldflags=`pkg-config --libs libSystem gtk+-x11-3.0 webkitgtk-3.0` -lintl
sources=download.c
install=$(BINDIR)

[download.c]
depends=download.h,../config.h
cppflags=-D WITH_MAIN

[surfer]
type=binary
#cppflags=-D WITH_GTKMOZEMBED
#cflags=`pkg-config --cflags libDesktop mozilla-gtkmozembed`
#ldflags=`pkg-config --libs libDesktop mozilla-gtkmozembed` -lintl
#cppflags=-D WITH_GTKHTML
#cflags=`pkg-config --cflags libDesktop libgtkhtml-2.0 gnet-2.0`
#ldflags=`pkg-config --libs libDesktop libgtkhtml-2.0 gnet-2.0` -lintl
#cppflags=-D WITH_GTKTEXTVIEW
#cflags=`pkg-config --cflags libParser libDesktop gnet-2.0`
#ldflags=`pkg-config --libs libParser libDesktop gnet-2.0` -lintl
cppflags=-D WITH_WEBKIT
#cflags=`pkg-config --cflags libDesktop webkit-1.0`
#ldflags=`pkg-config --libs libDesktop webkit-1.0` -lintl
cflags=`pkg-config --cflags libDesktop webkitgtk-3.0`
ldflags=`pkg-config --libs libDesktop webkitgtk-3.0` -lintl
sources=surfer.c,ghtml.c,callbacks.c,main.c
install=$(BINDIR)

[callbacks.c]
depends=surfer.h,ghtml.h,callbacks.h,../config.h

[ghtml.c]
depends=ghtml.h,ghtml-gtkhtml.c,ghtml-gtkmozembed.c,ghtml-gtktextview.c,ghtml-webkit.c,common/conn.c,common/history.c,common/url.c,../config.h
cppflags=-D PREFIX=\"$(PREFIX)\"

[main.c]
depends=surfer.h,../config.h

[surfer.c]
depends=callbacks.h,common/find.c,download.c,download.h,surfer.h,../config.h
