summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2010-10-29 00:54:27 +0000
committerVincent Sanders <vince@netsurf-browser.org>2010-10-29 00:54:27 +0000
commit802f58f10d1d733093b0c285a2ee8bfdf68de414 (patch)
tree56f8882897e9ca64a1257c11afec6caba22345e2
parent8814bca33e515bcb9110dbdc9e0f44285dd5bb47 (diff)
downloadnetsurf-802f58f10d1d733093b0c285a2ee8bfdf68de414.tar.gz
netsurf-802f58f10d1d733093b0c285a2ee8bfdf68de414.tar.bz2
Futher simplification of the makefile
Use target makefiles to set build sources svn path=/trunk/netsurf/; revision=10916
-rw-r--r--Makefile30
-rw-r--r--Makefile.resources60
-rw-r--r--Makefile.sources135
-rw-r--r--amiga/Makefile.target65
-rw-r--r--beos/Makefile.target23
-rw-r--r--framebuffer/Makefile.target192
-rw-r--r--gtk/Makefile.target18
-rw-r--r--riscos/Makefile.target37
-rw-r--r--windows/Makefile.target22
9 files changed, 307 insertions, 275 deletions
diff --git a/Makefile b/Makefile
index 438df6803..1859b0ad5 100644
--- a/Makefile
+++ b/Makefile
@@ -189,7 +189,11 @@ else
endif
endif
+# Target paths
+
OBJROOT = build-$(HOST)-$(TARGET)$(SUBTARGET)
+DEPROOT := $(OBJROOT)/deps
+TOOLROOT := $(OBJROOT)/tools
# 1: Feature name (ie, NETSURF_USE_BMP -> BMP)
@@ -284,11 +288,6 @@ LDFLAGS += -lz
CFLAGS += -DNETSURF_UA_FORMAT_STRING=\"$(NETSURF_UA_FORMAT_STRING)\"
CFLAGS += -DNETSURF_HOMEPAGE=\"$(NETSURF_HOMEPAGE)\"
-# ----------------------------------------------------------------------------
-# Target specific setup
-# ----------------------------------------------------------------------------
-
-include $(TARGET)/Makefile.target
# ----------------------------------------------------------------------------
# General make rules
@@ -299,13 +298,11 @@ $(OBJROOT)/created:
$(Q)$(MKDIR) $(OBJROOT)
$(Q)$(TOUCH) $(OBJROOT)/created
-DEPROOT := $(OBJROOT)/deps
$(DEPROOT)/created: $(OBJROOT)/created
$(VQ)echo " MKDIR: $(DEPROOT)"
$(Q)$(MKDIR) $(DEPROOT)
$(Q)$(TOUCH) $(DEPROOT)/created
-TOOLROOT := $(OBJROOT)/tools
$(TOOLROOT)/created: $(OBJROOT)/created
$(VQ)echo " MKDIR: $(TOOLROOT)"
$(Q)$(MKDIR) $(TOOLROOT)
@@ -315,9 +312,26 @@ CLEANS := clean-target
POSTEXES :=
-include Makefile.resources
+# ----------------------------------------------------------------------------
+# General source file setup
+# ----------------------------------------------------------------------------
+
include Makefile.sources
+# ----------------------------------------------------------------------------
+# Target specific setup
+# ----------------------------------------------------------------------------
+
+include $(TARGET)/Makefile.target
+
+# ----------------------------------------------------------------------------
+# Source file setup
+# ----------------------------------------------------------------------------
+
+ifeq ($(SOURCES),)
+$(error Unable to build NetSurf, could not determine set of sources to build)
+endif
+
OBJECTS := $(sort $(addprefix $(OBJROOT)/,$(subst /,_,$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(patsubst %.s,%.o,$(SOURCES)))))))
$(EXETARGET): $(OBJECTS) $(RESOURCES)
diff --git a/Makefile.resources b/Makefile.resources
index 285275367..519499d19 100644
--- a/Makefile.resources
+++ b/Makefile.resources
@@ -8,72 +8,12 @@
ifeq ($(TARGET),framebuffer)
-# We make convert_image depend on fb_bitmap.h so that if we change
-# that header, we get new images built just in case.
-$(TOOLROOT)/convert_image: $(TOOLROOT)/created framebuffer/convert_image.c framebuffer/bitmap.h
- $(VQ)echo " HOST CC: $@"
- $(Q)$(HOST_CC) -o $@ framebuffer/convert_image.c -lpng
-
-FB_IMAGE_left_arrow := framebuffer/res/icons/back.png
-FB_IMAGE_right_arrow := framebuffer/res/icons/forward.png
-FB_IMAGE_reload := framebuffer/res/icons/reload.png
-FB_IMAGE_stop_image := framebuffer/res/icons/stop.png
-FB_IMAGE_history_image := framebuffer/res/icons/history.png
-
-FB_IMAGE_left_arrow_g := framebuffer/res/icons/back_g.png
-FB_IMAGE_right_arrow_g := framebuffer/res/icons/forward_g.png
-FB_IMAGE_reload_g := framebuffer/res/icons/reload_g.png
-FB_IMAGE_stop_image_g := framebuffer/res/icons/stop_g.png
-FB_IMAGE_history_image_g := framebuffer/res/icons/history_g.png
-
-FB_IMAGE_scrolll := framebuffer/res/icons/scrolll.png
-FB_IMAGE_scrollr := framebuffer/res/icons/scrollr.png
-FB_IMAGE_scrollu := framebuffer/res/icons/scrollu.png
-FB_IMAGE_scrolld := framebuffer/res/icons/scrolld.png
-
-
-FB_IMAGE_pointer_image := framebuffer/res/pointers/default.png
-FB_IMAGE_hand_image := framebuffer/res/pointers/point.png
-FB_IMAGE_caret_image := framebuffer/res/pointers/caret.png
-FB_IMAGE_menu_image := framebuffer/res/pointers/menu.png
-FB_IMAGE_progress_image := framebuffer/res/pointers/progress.png
-
-FB_IMAGE_throbber0 := framebuffer/res/throbber/throbber0.png
-FB_IMAGE_throbber1 := framebuffer/res/throbber/throbber1.png
-FB_IMAGE_throbber2 := framebuffer/res/throbber/throbber2.png
-FB_IMAGE_throbber3 := framebuffer/res/throbber/throbber3.png
-FB_IMAGE_throbber4 := framebuffer/res/throbber/throbber4.png
-FB_IMAGE_throbber5 := framebuffer/res/throbber/throbber5.png
-FB_IMAGE_throbber6 := framebuffer/res/throbber/throbber6.png
-FB_IMAGE_throbber7 := framebuffer/res/throbber/throbber7.png
-FB_IMAGE_throbber8 := framebuffer/res/throbber/throbber8.png
-
-# 1: input file
-# 2: output file
-# 3: bitmap name
-define convert_image
-
-S_IMAGES += $(2)
-
-$(2): $(1) $(TOOLROOT)/convert_image
- $(Q)$(TOOLROOT)/convert_image $(1) $(2) $(3)
-
-endef
-
-S_IMAGES :=
-
-$(eval $(foreach V,$(filter FB_IMAGE_%,$(.VARIABLES)),$(call convert_image,$($(V)),$(OBJROOT)/$(patsubst FB_IMAGE_%,%,$(V)).c,$(patsubst FB_IMAGE_%,%,$(V)))))
# End of framebuffer resource definitions
endif
ifeq ($(TARGET),windows)
-$(OBJROOT)/windows_resource.o: windows/res/resource.rc
- $(VQ)echo " WINDRES: compiling windows resources"
- ${Q}$(MINGW_PREFIX)windres $< -O coff -o $@
-
-S_RESOURCES := windows_resource.o
# End of windows resource definitions
endif
diff --git a/Makefile.sources b/Makefile.sources
index f7d7ab37c..5de961289 100644
--- a/Makefile.sources
+++ b/Makefile.sources
@@ -1,18 +1,21 @@
#
# NetSurf source file inclusion
#
-# Included by main makefile -- indicates sources
-# for each build.
+# Included by main makefile -- indicates generic sources for every build.
#
S_CONTENT := content.c dirlist.c fetch.c hlcache.c llcache.c urldb.c \
fetchers/fetch_curl.c fetchers/fetch_data.c fetchers/fetch_file.c
+
S_CSS := css.c dump.c internal.c select.c utils.c
-S_RENDER := box.c box_construct.c box_normalise.c favicon.c \
+
+S_RENDER := box.c box_construct.c box_normalise.c favicon.c \
font.c form.c html.c html_interaction.c html_redraw.c \
hubbub_binding.c imagemap.c layout.c list.c table.c textplain.c
+
S_UTILS := base64.c filename.c hashtable.c http.c locale.c messages.c \
talloc.c url.c utf8.c utils.c useragent.c findresource.c log.c
+
S_DESKTOP := cookies.c history_global_core.c hotlist.c knockout.c \
options.c plot_style.c print.c search.c searchweb.c scroll.c \
sslcert.c textarea.c tree.c tree_url_node.c version.c \
@@ -39,86 +42,6 @@ S_BROWSER := browser.c download.c frames.c history_core.c netsurf.c \
save_complete.c save_text.c selection.c textinput.c
S_BROWSER := $(addprefix desktop/,$(S_BROWSER))
-# S_RISCOS are sources purely for the RISC OS build
-S_RISCOS := 401login.c artworks.c assert.c awrender.s bitmap.c buffer.c \
- cookies.c configure.c debugwin.c dialog.c download.c draw.c \
- filetype.c font.c global_history.c gui.c help.c history.c \
- hotlist.c image.c menus.c message.c palettes.c plotters.c \
- plugin.c print.c query.c save.c save_draw.c save_pdf.c \
- schedule.c search.c searchweb.c sprite.c sslcert.c \
- textarea.c textselection.c theme.c theme_install.c thumbnail.c \
- treeview.c ucstables.c uri.c url_complete.c url_protocol.c \
- url_suggest.c wimp.c wimp_event.c window.c gui/progress_bar.c \
- gui/status_bar.c \
- $(addprefix configure/,con_cache.c con_connect.c con_content.c \
- con_fonts.c con_home.c con_image.c con_inter.c con_language.c \
- con_memory.c con_secure.c con_theme.c)
-S_RISCOS := $(addprefix riscos/,$(S_RISCOS))
-TPL_RISCOS := de en fr nl # TODO: It'd be nice to auto-detect these
-TPL_RISCOS := $(addprefix riscos/templates/,$(TPL_RISCOS))
-
-# S_GTK are sources purely for the GTK build
-S_GTK := font_pango.c gtk_bitmap.c gtk_gui.c gtk_schedule.c \
- gtk_thumbnail.c gtk_plotters.c gtk_treeview.c gtk_scaffolding.c \
- gtk_completion.c gtk_login.c gtk_throbber.c gtk_selection.c \
- gtk_history.c gtk_window.c gtk_filetype.c gtk_download.c \
- gtk_menu.c gtk_print.c gtk_save.c gtk_search.c gtk_tabs.c \
- gtk_theme.c gtk_toolbar.c sexy_icon_entry.c gtk_compat.c \
- gtk_cookies.c gtk_hotlist.c \
- $(addprefix dialogs/,gtk_options.c gtk_about.c gtk_source.c)
-S_GTK := $(addprefix gtk/,$(S_GTK)) $(addprefix utils/,container.c)
-# code in utils/container.ch is non-universal it seems
-
-# S_WINDOWS are sources purely for the windows build
-S_WINDOWS := about.c bitmap.c download.c filetype.c findfile.c font.c \
- gui.c localhistory.c login.c misc.c plot.c prefs.c schedule.c \
- thumbnail.c tree.c windbg.c
-S_WINDOWS := $(addprefix windows/,$(S_WINDOWS))
-
-# S_BEOS are sources purely for the BeOS build
-S_BEOS := beos_about.cpp beos_bitmap.cpp beos_fetch_rsrc.cpp \
- beos_filetype.cpp beos_font.cpp beos_gui.cpp beos_login.cpp \
- beos_options.cpp beos_plotters.cpp beos_save_complete.cpp \
- beos_scaffolding.cpp beos_search.cpp beos_schedule.cpp \
- beos_thumbnail.cpp beos_treeview.cpp beos_throbber.cpp \
- beos_window.cpp
-S_BEOS := $(addprefix beos/,$(S_BEOS))
-RDEF_BEOS := beos_res.rdef
-RDEF_BEOS := $(addprefix beos/,$(RDEF_BEOS))
-RDEP_BEOS := adblock.css beosdefault.css default.css ca-bundle.txt \
- messages
-RDEP_BEOS := $(addprefix beos/res/,$(RDEP_BEOS)) \
- $(wildcard beos/res/throbber/throbber*.png)
-
-# S_AMIGA are sources purely for the Amiga build
-S_AMIGA := compat.c gui.c tree.c history.c hotlist.c schedule.c \
- thumbnail.c misc.c bitmap.c font.c filetype.c utf8.c login.c \
- plotters.c object.c menu.c save_pdf.c arexx.c version.c \
- cookies.c context_menu.c clipboard.c save_complete.c \
- fetch_mailto.c search.c history_local.c \
- download.c iff_dr2d.c sslcert.c gui_options.c print.c \
- theme.c \
- stringview/stringview.c stringview/urlhistory.c
-S_AMIGA := $(addprefix amiga/,$(S_AMIGA))
-
-
-# S_FRAMEBUFFER are sources purely for the framebuffer build
-S_FRAMEBUFFER := gui.c framebuffer.c tree.c save.c schedule.c \
- thumbnail.c misc.c bitmap.c filetype.c login.c findfile.c \
- localhistory.c
-
-S_FRAMEBUFFER_FBTK := fbtk.c event.c fill.c bitmap.c user.c window.c \
- text.c scroll.c osk.c
-
-S_FRAMEBUFFER += font_$(NETSURF_FB_FONTLIB).c
-
-ifeq ($(NETSURF_FB_FONTLIB),internal)
-S_FRAMEBUFFER += nsfont_regular.c nsfont_italic.c nsfont_bold.c \
- nsfont_italic_bold.c
-endif
-
-S_FRAMEBUFFER := $(addprefix framebuffer/,$(S_FRAMEBUFFER)) $(addprefix framebuffer/fbtk/,$(S_FRAMEBUFFER_FBTK))
-
# Some extra rules for building the transliteration table.
ifeq ($(HOST),riscos)
@@ -138,49 +61,3 @@ clean-intermediates:
$(Q)$(RM) utils/translit.c
CLEANS += clean-intermediates
-
-# Finally select the correct set of sources for this build...
-
-ifeq ($(TARGET),riscos)
-SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_PDF) $(S_RISCOS)
-EXETARGET := !NetSurf/!RunImage$(EXEEXT)
-
-!NetSurf/!Run$(RUNEXT): riscos/scripts/Run $(EXETARGET)
- $(VQ)echo " MAKERUN: $@"
- $(Q)$(MAKERUN) $(EXETARGET) $< $@
-POSTEXES += !NetSurf/!Run$(RUNEXT)
-
-clean-run:
- $(VQ)echo " CLEAN: !NetSurf/!Run$(RUNEXT)"
- $(Q) $(RM) !NetSurf/!Run$(RUNEXT)
-CLEANS += clean-run
-endif
-
-ifeq ($(TARGET),gtk)
-SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_PDF) $(S_GTK)
-EXETARGET := nsgtk
-endif
-
-ifeq ($(TARGET),beos)
-SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_BEOS)
-EXETARGET := NetSurf
-endif
-
-ifeq ($(TARGET),amiga)
-SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_AMIGA) $(S_PDF)
-EXETARGET := NetSurf$(SUBTARGET)
-endif
-
-ifeq ($(TARGET),framebuffer)
-SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_FRAMEBUFFER) $(S_IMAGES)
-EXETARGET := nsfb$(SUBTARGET)
-endif
-
-ifeq ($(TARGET),windows)
-SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_WINDOWS) $(S_RESOURCES)
-EXETARGET := NetSurf.exe
-endif
-
-ifeq ($(SOURCES),)
-$(error Unable to build NetSurf, could not determine set of sources to build)
-endif
diff --git a/amiga/Makefile.target b/amiga/Makefile.target
index e24722337..270568266 100644
--- a/amiga/Makefile.target
+++ b/amiga/Makefile.target
@@ -3,28 +3,45 @@
# ----------------------------------------------------------------------------
- NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
- NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
- NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
- NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
- NETSURF_FEATURE_WEBP_CFLAGS := -DWITH_WEBP
- NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG
-
- $(eval $(call feature_enabled,ROSPRITE,-DWITH_NSSPRITE,-lrosprite,Sprite (librosprite)))
- $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp)))
- $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif)))
- $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
- $(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny)))
- $(eval $(call feature_enabled,MNG,,-llcms -ljpeg,PNG/JNG/MNG (libmng)))
- $(eval $(call feature_enabled,WEBP,-DWITH_WEBP,-lwebp -lvpx,WebP (libwebp)))
-
- CFLAGS += -D__USE_INLINE__ -std=c99 -I . -I /SDK/local/common/include/libpng12 -Dnsamiga
- LDFLAGS += -lxml2 -lcurl -lpthread -lregex -lauto
- LDFLAGS += -lssl -lcrypto -lhubbub -lcss -lparserutils -lwapcaplet -liconv
-
- ifeq ($(NETSURF_AMIGA_USE_CAIRO),YES)
- CFLAGS += -DNS_AMIGA_CAIRO -I /SDK/local/common/include/cairo
- LDFLAGS += -use-dynld -ldl -lcairo -lpixman-1 -lfreetype -lfontconfig -lpng -lexpat
- SUBTARGET := -cairo
- endif
+NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
+NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
+NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
+NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
+NETSURF_FEATURE_WEBP_CFLAGS := -DWITH_WEBP
+NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG
+$(eval $(call feature_enabled,ROSPRITE,-DWITH_NSSPRITE,-lrosprite,Sprite (librosprite)))
+$(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp)))
+$(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif)))
+$(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
+$(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny)))
+$(eval $(call feature_enabled,MNG,,-llcms -ljpeg,PNG/JNG/MNG (libmng)))
+$(eval $(call feature_enabled,WEBP,-DWITH_WEBP,-lwebp -lvpx,WebP (libwebp)))
+
+CFLAGS += -D__USE_INLINE__ -std=c99 -I . -I /SDK/local/common/include/libpng12 -Dnsamiga
+LDFLAGS += -lxml2 -lcurl -lpthread -lregex -lauto
+LDFLAGS += -lssl -lcrypto -lhubbub -lcss -lparserutils -lwapcaplet -liconv
+
+ifeq ($(NETSURF_AMIGA_USE_CAIRO),YES)
+ CFLAGS += -DNS_AMIGA_CAIRO -I /SDK/local/common/include/cairo
+ LDFLAGS += -use-dynld -ldl -lcairo -lpixman-1 -lfreetype -lfontconfig -lpng -lexpat
+ SUBTARGET := -cairo
+endif
+
+# ----------------------------------------------------------------------------
+# Source file setup
+# ----------------------------------------------------------------------------
+
+# S_AMIGA are sources purely for the Amiga build
+S_AMIGA := compat.c gui.c tree.c history.c hotlist.c schedule.c \
+ thumbnail.c misc.c bitmap.c font.c filetype.c utf8.c login.c \
+ plotters.c object.c menu.c save_pdf.c arexx.c version.c \
+ cookies.c context_menu.c clipboard.c save_complete.c \
+ fetch_mailto.c search.c history_local.c download.c iff_dr2d.c \
+ sslcert.c gui_options.c print.c theme.c \
+ stringview/stringview.c stringview/urlhistory.c
+S_AMIGA := $(addprefix amiga/,$(S_AMIGA))
+
+# complete source file list
+SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_AMIGA) $(S_PDF)
+EXETARGET := NetSurf$(SUBTARGET)
diff --git a/beos/Makefile.target b/beos/Makefile.target
index 09eda57ba..9225a10bc 100644
--- a/beos/Makefile.target
+++ b/beos/Makefile.target
@@ -79,3 +79,26 @@
$(eval $(call pkg_config_find_and_add,PNG,libpng,PNG ))
endif
+# ----------------------------------------------------------------------------
+# Source file setup
+# ----------------------------------------------------------------------------
+
+# S_BEOS are sources purely for the BeOS build
+S_BEOS := beos_about.cpp beos_bitmap.cpp beos_fetch_rsrc.cpp \
+ beos_filetype.cpp beos_font.cpp beos_gui.cpp beos_login.cpp \
+ beos_options.cpp beos_plotters.cpp beos_save_complete.cpp \
+ beos_scaffolding.cpp beos_search.cpp beos_schedule.cpp \
+ beos_thumbnail.cpp beos_treeview.cpp beos_throbber.cpp \
+ beos_window.cpp
+S_BEOS := $(addprefix beos/,$(S_BEOS))
+RDEF_BEOS := beos_res.rdef
+RDEF_BEOS := $(addprefix beos/,$(RDEF_BEOS))
+RDEP_BEOS := adblock.css beosdefault.css default.css ca-bundle.txt \
+ messages
+RDEP_BEOS := $(addprefix beos/res/,$(RDEP_BEOS)) \
+ $(wildcard beos/res/throbber/throbber*.png)
+
+
+# complete source file list
+SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_BEOS)
+EXETARGET := NetSurf
diff --git a/framebuffer/Makefile.target b/framebuffer/Makefile.target
index bd356ef82..a60c22fc6 100644
--- a/framebuffer/Makefile.target
+++ b/framebuffer/Makefile.target
@@ -3,67 +3,151 @@
# ----------------------------------------------------------------------------
+$(eval $(call feature_enabled,MNG,-DWITH_MNG,-lmng,PNG/MNG/JNG (libmng)))
+$(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
- $(eval $(call feature_enabled,MNG,-DWITH_MNG,-lmng,PNG/MNG/JNG (libmng)))
- $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
-
- ifeq ($(NETSURF_FB_FONTLIB),freetype)
- CFLAGS += -DFB_USE_FREETYPE $(shell freetype-config --cflags)
- LDFLAGS += $(shell freetype-config --libs)
- endif
-
- # define additional CFLAGS and LDFLAGS requirements for pkg-configed libs here
- NETSURF_FEATURE_RSVG_CFLAGS := -DWITH_RSVG
- NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
- NETSURF_FEATURE_HUBBUB_CFLAGS := -DWITH_HUBBUB
- NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
- NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
-
- CFLAGS += -Dnsframebuffer
-
- #resource path
- CFLAGS += '-DNETSURF_FB_RESPATH="$(NETSURF_FB_RESPATH_$(NETSURF_FB_FRONTEND))"'
-
- # compile time font locations
- CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF="$(NETSURF_FB_FONT_SANS_SERIF)"'
- CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_BOLD="$(NETSURF_FB_FONT_SANS_SERIF_BOLD)"'
- CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_ITALIC="$(NETSURF_FB_FONT_SANS_SERIF_ITALIC)"'
- CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD="$(NETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD)"'
- CFLAGS += '-DNETSURF_FB_FONT_SERIF="$(NETSURF_FB_FONT_SERIF)"'
- CFLAGS += '-DNETSURF_FB_FONT_SERIF_BOLD="$(NETSURF_FB_FONT_SERIF_BOLD)"'
- CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE="$(NETSURF_FB_FONT_MONOSPACE)"'
- CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE_BOLD="$(NETSURF_FB_FONT_MONOSPACE_BOLD)"'
- CFLAGS += '-DNETSURF_FB_FONT_CURSIVE="$(NETSURF_FB_FONT_CURSIVE)"'
- CFLAGS += '-DNETSURF_FB_FONT_FANTASY="$(NETSURF_FB_FONT_FANTASY)"'
-
- $(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,Sprite))
- $(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
- $(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
-
- CFLAGS += -std=c99 -g -I. -Dsmall $(WARNFLAGS) \
- -D_BSD_SOURCE \
- -D_XOPEN_SOURCE=600 \
- -D_POSIX_C_SOURCE=200112L \
- $(shell $(PKG_CONFIG) --cflags libnsfb libhubbub libcss openssl) \
- $(shell xml2-config --cflags)
-
- ifeq ($(HOST),mint)
+ifeq ($(NETSURF_FB_FONTLIB),freetype)
+ CFLAGS += -DFB_USE_FREETYPE $(shell freetype-config --cflags)
+ LDFLAGS += $(shell freetype-config --libs)
+endif
+
+# define additional CFLAGS and LDFLAGS requirements for pkg-configed libs here
+NETSURF_FEATURE_RSVG_CFLAGS := -DWITH_RSVG
+NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
+NETSURF_FEATURE_HUBBUB_CFLAGS := -DWITH_HUBBUB
+NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
+NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
+
+CFLAGS += -Dnsframebuffer
+
+#resource path
+CFLAGS += '-DNETSURF_FB_RESPATH="$(NETSURF_FB_RESPATH_$(NETSURF_FB_FRONTEND))"'
+
+# compile time font locations
+CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF="$(NETSURF_FB_FONT_SANS_SERIF)"'
+CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_BOLD="$(NETSURF_FB_FONT_SANS_SERIF_BOLD)"'
+CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_ITALIC="$(NETSURF_FB_FONT_SANS_SERIF_ITALIC)"'
+CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD="$(NETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD)"'
+CFLAGS += '-DNETSURF_FB_FONT_SERIF="$(NETSURF_FB_FONT_SERIF)"'
+CFLAGS += '-DNETSURF_FB_FONT_SERIF_BOLD="$(NETSURF_FB_FONT_SERIF_BOLD)"'
+CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE="$(NETSURF_FB_FONT_MONOSPACE)"'
+CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE_BOLD="$(NETSURF_FB_FONT_MONOSPACE_BOLD)"'
+CFLAGS += '-DNETSURF_FB_FONT_CURSIVE="$(NETSURF_FB_FONT_CURSIVE)"'
+CFLAGS += '-DNETSURF_FB_FONT_FANTASY="$(NETSURF_FB_FONT_FANTASY)"'
+
+$(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,Sprite))
+$(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
+$(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
+
+CFLAGS += -std=c99 -g -I. -Dsmall $(WARNFLAGS) \
+ -D_BSD_SOURCE \
+ -D_XOPEN_SOURCE=600 \
+ -D_POSIX_C_SOURCE=200112L \
+ $(shell $(PKG_CONFIG) --cflags libnsfb libhubbub libcss openssl) \
+ $(shell xml2-config --cflags)
+
+LDFLAGS += -Wl,--whole-archive $(shell $(PKG_CONFIG) --libs libnsfb) -Wl,--no-whole-archive
+
+ifeq ($(HOST),mint)
# freemint does not support pkg-config for libcurl
CFLAGS += $(shell curl-config --cflags)
- else
- CFLAGS += $(shell $(PKG_CONFIG) --cflags libcurl)
- endif
-
- LDFLAGS += -Wl,--whole-archive $(shell $(PKG_CONFIG) --libs libnsfb) -Wl,--no-whole-archive
- ifeq ($(HOST),mint)
LDFLAGS += $(shell curl-config --libs)
LDFLAGS += $(shell $(PKG_CONFIG) --libs libhubbub openssl libcss)
- # xml-config returns -lsocket which is not needed and does not exist on all systems.
- # because of that - hardcoded reference to libxml-2.0 here.
+ # xml-config returns -lsocket which is not needed and does not
+ # exist on all systems. because of that - hardcoded reference to
+ # libxml-2.0 here.
LDFLAGS += -L/usr/lib/ -lxml2 -lz -liconv
LDFLAGS += -lm
- else
+else
+ CFLAGS += $(shell $(PKG_CONFIG) --cflags libcurl)
+
LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcurl libhubbub openssl)
LDFLAGS += $(shell $(PKG_CONFIG) --libs libcss)
- endif
+endif
+
+
+# ----------------------------------------------------------------------------
+# built-in resource setup
+# ----------------------------------------------------------------------------
+
+# We make convert_image depend on fb_bitmap.h so that if we change
+# that header, we get new images built just in case.
+$(TOOLROOT)/convert_image: $(TOOLROOT)/created framebuffer/convert_image.c framebuffer/bitmap.h
+ $(VQ)echo " HOST CC: $@"
+ $(Q)$(HOST_CC) -o $@ framebuffer/convert_image.c -lpng
+
+FB_IMAGE_left_arrow := framebuffer/res/icons/back.png
+FB_IMAGE_right_arrow := framebuffer/res/icons/forward.png
+FB_IMAGE_reload := framebuffer/res/icons/reload.png
+FB_IMAGE_stop_image := framebuffer/res/icons/stop.png
+FB_IMAGE_history_image := framebuffer/res/icons/history.png
+
+FB_IMAGE_left_arrow_g := framebuffer/res/icons/back_g.png
+FB_IMAGE_right_arrow_g := framebuffer/res/icons/forward_g.png
+FB_IMAGE_reload_g := framebuffer/res/icons/reload_g.png
+FB_IMAGE_stop_image_g := framebuffer/res/icons/stop_g.png
+FB_IMAGE_history_image_g := framebuffer/res/icons/history_g.png
+
+FB_IMAGE_scrolll := framebuffer/res/icons/scrolll.png
+FB_IMAGE_scrollr := framebuffer/res/icons/scrollr.png
+FB_IMAGE_scrollu := framebuffer/res/icons/scrollu.png
+FB_IMAGE_scrolld := framebuffer/res/icons/scrolld.png
+
+
+FB_IMAGE_pointer_image := framebuffer/res/pointers/default.png
+FB_IMAGE_hand_image := framebuffer/res/pointers/point.png
+FB_IMAGE_caret_image := framebuffer/res/pointers/caret.png
+FB_IMAGE_menu_image := framebuffer/res/pointers/menu.png
+FB_IMAGE_progress_image := framebuffer/res/pointers/progress.png
+
+FB_IMAGE_throbber0 := framebuffer/res/throbber/throbber0.png
+FB_IMAGE_throbber1 := framebuffer/res/throbber/throbber1.png
+FB_IMAGE_throbber2 := framebuffer/res/throbber/throbber2.png
+FB_IMAGE_throbber3 := framebuffer/res/throbber/throbber3.png
+FB_IMAGE_throbber4 := framebuffer/res/throbber/throbber4.png
+FB_IMAGE_throbber5 := framebuffer/res/throbber/throbber5.png
+FB_IMAGE_throbber6 := framebuffer/res/throbber/throbber6.png
+FB_IMAGE_throbber7 := framebuffer/res/throbber/throbber7.png
+FB_IMAGE_throbber8 := framebuffer/res/throbber/throbber8.png
+
+# 1: input file
+# 2: output file
+# 3: bitmap name
+define convert_image
+
+S_IMAGES += $(2)
+
+$(2): $(1) $(TOOLROOT)/convert_image
+ $(Q)$(TOOLROOT)/convert_image $(1) $(2) $(3)
+
+endef
+
+S_IMAGES :=
+
+$(eval $(foreach V,$(filter FB_IMAGE_%,$(.VARIABLES)),$(call convert_image,$($(V)),$(OBJROOT)/$(patsubst FB_IMAGE_%,%,$(V)).c,$(patsubst FB_IMAGE_%,%,$(V)))))
+
+# ----------------------------------------------------------------------------
+# Source file setup
+# ----------------------------------------------------------------------------
+
+# S_FRAMEBUFFER are sources purely for the framebuffer build
+S_FRAMEBUFFER := gui.c framebuffer.c tree.c save.c schedule.c \
+ thumbnail.c misc.c bitmap.c filetype.c login.c findfile.c \
+ localhistory.c
+
+S_FRAMEBUFFER_FBTK := fbtk.c event.c fill.c bitmap.c user.c window.c \
+ text.c scroll.c osk.c
+
+S_FRAMEBUFFER += font_$(NETSURF_FB_FONTLIB).c
+
+ifeq ($(NETSURF_FB_FONTLIB),internal)
+S_FRAMEBUFFER += nsfont_regular.c nsfont_italic.c nsfont_bold.c \
+ nsfont_italic_bold.c
+endif
+
+S_FRAMEBUFFER := $(addprefix framebuffer/,$(S_FRAMEBUFFER)) $(addprefix framebuffer/fbtk/,$(S_FRAMEBUFFER_FBTK))
+
+# complete source file list
+SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_FRAMEBUFFER) $(S_IMAGES)
+EXETARGET := nsfb$(SUBTARGET)
diff --git a/gtk/Makefile.target b/gtk/Makefile.target
index c253386e2..ef9c97978 100644
--- a/gtk/Makefile.target
+++ b/gtk/Makefile.target
@@ -52,3 +52,21 @@
CFLAGS += -U__STRICT_ANSI__
endif
+# ----------------------------------------------------------------------------
+# Source file setup
+# ----------------------------------------------------------------------------
+
+# S_GTK are sources purely for the GTK build
+S_GTK := font_pango.c gtk_bitmap.c gtk_gui.c gtk_schedule.c \
+ gtk_thumbnail.c gtk_plotters.c gtk_treeview.c gtk_scaffolding.c \
+ gtk_completion.c gtk_login.c gtk_throbber.c gtk_selection.c \
+ gtk_history.c gtk_window.c gtk_filetype.c gtk_download.c \
+ gtk_menu.c gtk_print.c gtk_save.c gtk_search.c gtk_tabs.c \
+ gtk_theme.c gtk_toolbar.c sexy_icon_entry.c gtk_compat.c \
+ gtk_cookies.c gtk_hotlist.c \
+ $(addprefix dialogs/,gtk_options.c gtk_about.c gtk_source.c)
+S_GTK := $(addprefix gtk/,$(S_GTK)) $(addprefix utils/,container.c)
+# code in utils/container.ch is non-universal it seems
+
+SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_PDF) $(S_GTK)
+EXETARGET := nsgtk
diff --git a/riscos/Makefile.target b/riscos/Makefile.target
index 6c6cfb83c..6d14698c8 100644
--- a/riscos/Makefile.target
+++ b/riscos/Makefile.target
@@ -59,3 +59,40 @@
EXEEXT := ,ff8
endif
endif
+
+# ----------------------------------------------------------------------------
+# Source file setup
+# ----------------------------------------------------------------------------
+
+# S_RISCOS are sources purely for the RISC OS build
+S_RISCOS := 401login.c artworks.c assert.c awrender.s bitmap.c buffer.c \
+ cookies.c configure.c debugwin.c dialog.c download.c draw.c \
+ filetype.c font.c global_history.c gui.c help.c history.c \
+ hotlist.c image.c menus.c message.c palettes.c plotters.c \
+ plugin.c print.c query.c save.c save_draw.c save_pdf.c \
+ schedule.c search.c searchweb.c sprite.c sslcert.c \
+ textarea.c textselection.c theme.c theme_install.c thumbnail.c \
+ treeview.c ucstables.c uri.c url_complete.c url_protocol.c \
+ url_suggest.c wimp.c wimp_event.c window.c gui/progress_bar.c \
+ gui/status_bar.c \
+ $(addprefix configure/,con_cache.c con_connect.c con_content.c \
+ con_fonts.c con_home.c con_image.c con_inter.c con_language.c \
+ con_memory.c con_secure.c con_theme.c)
+S_RISCOS := $(addprefix riscos/,$(S_RISCOS))
+TPL_RISCOS := de en fr nl # TODO: It'd be nice to auto-detect these
+TPL_RISCOS := $(addprefix riscos/templates/,$(TPL_RISCOS))
+
+
+# complete source file list
+SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_PDF) $(S_RISCOS)
+EXETARGET := !NetSurf/!RunImage$(EXEEXT)
+
+!NetSurf/!Run$(RUNEXT): riscos/scripts/Run $(EXETARGET)
+ $(VQ)echo " MAKERUN: $@"
+ $(Q)$(MAKERUN) $(EXETARGET) $< $@
+POSTEXES += !NetSurf/!Run$(RUNEXT)
+
+clean-run:
+ $(VQ)echo " CLEAN: !NetSurf/!Run$(RUNEXT)"
+ $(Q) $(RM) !NetSurf/!Run$(RUNEXT)
+CLEANS += clean-run
diff --git a/windows/Makefile.target b/windows/Makefile.target
index 31221d32c..7b931eeee 100644
--- a/windows/Makefile.target
+++ b/windows/Makefile.target
@@ -28,3 +28,25 @@
CFLAGS += $(WSCFLAGS)
LDFLAGS += $(WSCFLAGS)
+# ----------------------------------------------------------------------------
+# built-in resource setup
+# ----------------------------------------------------------------------------
+
+$(OBJROOT)/windows_resource.o: windows/res/resource.rc
+ $(VQ)echo " WINDRES: compiling windows resources"
+ ${Q}$(MINGW_PREFIX)windres $< -O coff -o $@
+
+S_RESOURCES := windows_resource.o
+
+# ----------------------------------------------------------------------------
+# Source file setup
+# ----------------------------------------------------------------------------
+
+# S_WINDOWS are sources purely for the windows build
+S_WINDOWS := about.c bitmap.c download.c filetype.c findfile.c font.c \
+ gui.c localhistory.c login.c misc.c plot.c prefs.c schedule.c \
+ thumbnail.c tree.c windbg.c
+S_WINDOWS := $(addprefix windows/,$(S_WINDOWS))
+
+SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_WINDOWS) $(S_RESOURCES)
+EXETARGET := NetSurf.exe