2003-06-30 16:44:03 +04:00
|
|
|
#
|
2006-11-27 18:35:18 +03:00
|
|
|
# This file is part of NetSurf, http://netsurf-browser.org/
|
2003-06-30 16:44:03 +04:00
|
|
|
# Licensed under the GNU General Public License,
|
|
|
|
# http://www.opensource.org/licenses/gpl-license
|
|
|
|
#
|
2002-07-28 01:10:45 +04:00
|
|
|
|
2004-07-20 15:29:06 +04:00
|
|
|
# There are 6 possible builds of NetSurf:
|
2004-06-03 01:40:55 +04:00
|
|
|
#
|
|
|
|
# riscos -- standard RISC OS build
|
|
|
|
# riscos_small -- identical to "riscos", but linked with smaller libraries
|
|
|
|
# (no openssl, and libcurl without ssl support)
|
|
|
|
# debug -- command line Unix/Linux, for debugging
|
|
|
|
# riscos_debug -- a cross between "riscos" and "debug"
|
|
|
|
# gtk -- experimental gtk version
|
|
|
|
#
|
2007-07-22 02:17:07 +04:00
|
|
|
# "riscos", "riscos_small", and "riscos_debug" can be compiled under
|
2006-01-06 01:01:38 +03:00
|
|
|
# RISC OS, or cross-compiled using GCCSDK.
|
2004-06-03 01:40:55 +04:00
|
|
|
|
2006-09-10 17:25:19 +04:00
|
|
|
SYSTEM_CC ?= gcc
|
|
|
|
|
2006-04-10 03:21:13 +04:00
|
|
|
OBJECTS_COMMON = content.o fetch.o fetchcache.o urldb.o # content/
|
2007-06-10 21:46:44 +04:00
|
|
|
OBJECTS_COMMON += fetch_curl.o # content/fetchers/
|
2004-06-03 01:40:55 +04:00
|
|
|
OBJECTS_COMMON += css.o css_enum.o parser.o ruleset.o scanner.o # css/
|
2006-07-06 04:07:11 +04:00
|
|
|
OBJECTS_COMMON += box.o box_construct.o box_normalise.o directory.o \
|
|
|
|
form.o html.o html_redraw.o imagemap.o layout.o list.o \
|
2005-08-15 03:56:15 +04:00
|
|
|
table.o textplain.o # render/
|
2006-08-22 02:16:45 +04:00
|
|
|
OBJECTS_COMMON += filename.o hashtable.o messages.o talloc.o \
|
2007-06-10 21:46:44 +04:00
|
|
|
url.o utf8.o utils.o useragent.o # utils/
|
2007-02-22 00:23:01 +03:00
|
|
|
OBJECTS_COMMON += knockout.o options.o tree.o version.o # desktop/
|
2004-06-03 01:40:55 +04:00
|
|
|
|
2006-02-26 10:27:43 +03:00
|
|
|
OBJECTS_IMAGE = bmp.o bmpread.o gif.o gifread.o ico.o jpeg.o \
|
2007-07-19 00:15:08 +04:00
|
|
|
mng.o svg.o rsvg.o # image/
|
2004-09-04 02:44:48 +04:00
|
|
|
|
|
|
|
OBJECTS_RISCOS = $(OBJECTS_COMMON) $(OBJECTS_IMAGE)
|
2006-11-27 19:05:55 +03:00
|
|
|
OBJECTS_RISCOS += browser.o frames.o history_core.o netsurf.o \
|
2007-09-14 22:33:32 +04:00
|
|
|
selection.o textinput.o # desktop/
|
2005-12-12 00:55:25 +03:00
|
|
|
OBJECTS_RISCOS += 401login.o artworks.o assert.o awrender.o bitmap.o \
|
2006-07-13 16:46:02 +04:00
|
|
|
buffer.o cookies.o configure.o debugwin.o \
|
2006-04-22 03:49:52 +04:00
|
|
|
dialog.o download.o draw.o filetype.o font.o \
|
2005-02-07 17:29:56 +03:00
|
|
|
global_history.o gui.o help.o history.o hotlist.o image.o \
|
2006-04-23 02:42:44 +04:00
|
|
|
menus.o message.o palettes.o plotters.o plugin.o print.o \
|
2006-01-08 23:06:34 +03:00
|
|
|
query.o save.o save_complete.o save_draw.o save_text.o \
|
2006-06-26 05:14:33 +04:00
|
|
|
schedule.o search.o sprite.o sslcert.o textarea.o \
|
|
|
|
textselection.o theme.o theme_install.o thumbnail.o \
|
|
|
|
treeview.o ucstables.o uri.o url_complete.o url_protocol.o \
|
|
|
|
wimp.o wimp_event.o window.o # riscos/
|
2006-04-07 02:42:22 +04:00
|
|
|
OBJECTS_RISCOS += con_cache.o con_connect.o con_content.o con_fonts.o \
|
|
|
|
con_home.o con_image.o con_inter.o con_language.o con_memory.o \
|
2006-04-06 21:51:25 +04:00
|
|
|
con_secure.o con_theme.o # riscos/configure/
|
2006-11-30 18:30:54 +03:00
|
|
|
OBJECTS_RISCOS += progress_bar.o status_bar.o # riscos/gui/
|
2004-07-20 15:29:06 +04:00
|
|
|
# OBJECTS_RISCOS += memdebug.o
|
|
|
|
|
2006-02-23 18:06:54 +03:00
|
|
|
OBJECTS_RISCOS_SMALL = $(OBJECTS_RISCOS)
|
|
|
|
|
2004-09-04 02:44:48 +04:00
|
|
|
OBJECTS_DEBUG = $(OBJECTS_COMMON) $(OBJECTS_IMAGE)
|
|
|
|
OBJECTS_DEBUG += debug_bitmap.o filetyped.o fontd.o netsurfd.o # debug/
|
2004-06-03 01:40:55 +04:00
|
|
|
|
2004-09-04 02:44:48 +04:00
|
|
|
OBJECTS_DEBUGRO = $(OBJECTS_COMMON) $(OBJECTS_IMAGE)
|
2004-06-03 01:40:55 +04:00
|
|
|
OBJECTS_DEBUGRO += netsurfd.o # debug/
|
2006-04-10 03:21:13 +04:00
|
|
|
OBJECTS_DEBUGRO += artworks.o awrender.o bitmap.o draw.o \
|
|
|
|
filename.o filetype.o font.o gif.o gifread.o image.o \
|
|
|
|
jpeg.o palettes.o plotters.o save_complete.o schedule.o \
|
|
|
|
sprite.o # riscos/
|
2004-06-03 01:40:55 +04:00
|
|
|
|
2004-09-04 02:44:48 +04:00
|
|
|
OBJECTS_GTK = $(OBJECTS_COMMON) $(OBJECTS_IMAGE)
|
2006-11-27 19:05:55 +03:00
|
|
|
OBJECTS_GTK += browser.o frames.o history_core.o netsurf.o \
|
2007-09-14 22:33:32 +04:00
|
|
|
selection.o textinput.o # desktop/
|
2004-10-18 01:13:24 +04:00
|
|
|
OBJECTS_GTK += font_pango.o gtk_bitmap.o gtk_gui.o \
|
2006-07-23 22:26:11 +04:00
|
|
|
gtk_schedule.o gtk_thumbnail.o gtk_options.o \
|
2006-11-27 20:13:24 +03:00
|
|
|
gtk_plotters.o gtk_treeview.o gtk_scaffolding.o \
|
2006-08-18 15:44:24 +04:00
|
|
|
gtk_completion.o gtk_login.o gtk_throbber.o \
|
2007-10-03 02:22:17 +04:00
|
|
|
gtk_history.o gtk_window.o gtk_filetype.o \
|
|
|
|
gtk_download.o # gtk/
|
2004-06-03 01:40:55 +04:00
|
|
|
|
2008-01-28 04:46:29 +03:00
|
|
|
# This makes me want to vomit, but is necessary to avoid a load of
|
|
|
|
# "make: /home/riscos/cross/bin/gcc: Command not found." if there's no GCCSDK
|
|
|
|
# installed on the build machine. The new build system can't happen soon enough
|
|
|
|
OBJDIR_RISCOS = $(shell $(CC) -dumpmachine 2>/dev/null || echo arm-riscos-aof)
|
2004-06-03 01:40:55 +04:00
|
|
|
SOURCES_RISCOS=$(OBJECTS_RISCOS:.o=.c)
|
|
|
|
OBJS_RISCOS=$(OBJECTS_RISCOS:%.o=$(OBJDIR_RISCOS)/%.o)
|
2004-05-21 00:51:42 +04:00
|
|
|
|
2008-01-28 04:46:29 +03:00
|
|
|
OBJDIR_RISCOS_SMALL = $(OBJDIR_RISCOS)-small
|
2006-02-23 18:06:54 +03:00
|
|
|
SOURCES_RISCOS_SMALL=$(OBJECTS_RISCOS_SMALL:.o=.c)
|
|
|
|
OBJS_RISCOS_SMALL=$(OBJECTS_RISCOS_SMALL:%.o=$(OBJDIR_RISCOS_SMALL)/%.o)
|
|
|
|
|
2006-09-10 17:25:19 +04:00
|
|
|
OBJDIR_DEBUG = $(shell $(SYSTEM_CC) -dumpmachine)-debug
|
2004-05-21 00:51:42 +04:00
|
|
|
SOURCES_DEBUG=$(OBJECTS_DEBUG:.o=.c)
|
|
|
|
OBJS_DEBUG=$(OBJECTS_DEBUG:%.o=$(OBJDIR_DEBUG)/%.o)
|
|
|
|
|
2004-06-03 01:40:55 +04:00
|
|
|
OBJS_DEBUGRO=$(OBJECTS_DEBUGRO:%.o=$(OBJDIR_RISCOS)/%.o)
|
|
|
|
|
2007-01-30 01:27:15 +03:00
|
|
|
OBJDIR_GTK = objects-gtk
|
2004-06-03 01:40:55 +04:00
|
|
|
SOURCES_GTK=$(OBJECTS_GTK:.o=.c)
|
|
|
|
OBJS_GTK=$(OBJECTS_GTK:%.o=$(OBJDIR_GTK)/%.o)
|
|
|
|
|
2008-01-28 04:11:37 +03:00
|
|
|
# Default target - platform specific files may specify special-case rules for
|
|
|
|
# various files.
|
|
|
|
default: riscos
|
|
|
|
|
|
|
|
# Inclusion of platform specific files has to occur after the OBJDIR stuff as
|
|
|
|
# that is referred to in the files
|
|
|
|
|
|
|
|
OS = $(word 2,$(subst -, ,$(shell $(SYSTEM_CC) -dumpmachine)))
|
|
|
|
ifeq ($(OS),riscos)
|
|
|
|
include riscos.mk
|
|
|
|
else
|
|
|
|
include posix.mk
|
|
|
|
endif
|
2004-05-21 00:51:42 +04:00
|
|
|
|
2007-06-10 21:46:44 +04:00
|
|
|
VPATH = content:content/fetchers:css:desktop:image:render:riscos:riscos/configure:riscos/gui:utils:debug:gtk
|
2004-05-21 00:06:31 +04:00
|
|
|
|
2004-08-23 20:02:19 +04:00
|
|
|
WARNFLAGS = -W -Wall -Wundef -Wpointer-arith -Wcast-qual \
|
2004-02-26 20:22:41 +03:00
|
|
|
-Wcast-align -Wwrite-strings -Wstrict-prototypes \
|
2003-05-31 22:40:46 +04:00
|
|
|
-Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \
|
2003-07-10 01:33:01 +04:00
|
|
|
-Wnested-externs -Winline -Wno-unused-parameter -Wuninitialized
|
2004-05-21 00:06:31 +04:00
|
|
|
|
2004-05-21 00:51:42 +04:00
|
|
|
# CFLAGS have to appear after the inclusion of platform specific files as the
|
2004-06-03 01:40:55 +04:00
|
|
|
# PLATFORM_CFLAGS variables are defined in them
|
2004-05-21 00:51:42 +04:00
|
|
|
|
2007-01-30 02:09:40 +03:00
|
|
|
CFLAGS_RISCOS = -std=c99 -D_BSD_SOURCE -D_POSIX_C_SOURCE -Driscos -DBOOL_DEFINED -O \
|
2007-05-31 02:39:54 +04:00
|
|
|
$(WARNFLAGS) -I. $(PLATFORM_CFLAGS_RISCOS) -mpoke-function-name \
|
|
|
|
# -include utils/memdebug.h
|
2006-02-23 18:06:54 +03:00
|
|
|
CFLAGS_RISCOS_SMALL = $(CFLAGS_RISCOS) -Dsmall
|
2007-05-31 02:39:54 +04:00
|
|
|
CFLAGS_DEBUG = -std=c99 -D_BSD_SOURCE -DDEBUG_BUILD $(WARNFLAGS) -I. \
|
2004-06-03 01:40:55 +04:00
|
|
|
$(PLATFORM_CFLAGS_DEBUG) -g
|
2007-02-07 00:48:22 +03:00
|
|
|
CFLAGS_GTK = -std=c99 -Dgtk -Dnsgtk \
|
|
|
|
-DGTK_DISABLE_DEPRECATED \
|
2007-06-15 23:53:19 +04:00
|
|
|
-D_BSD_SOURCE \
|
2007-06-15 22:43:07 +04:00
|
|
|
-D_XOPEN_SOURCE=600 \
|
|
|
|
-D_POSIX_C_SOURCE=200112L \
|
2007-06-27 21:18:46 +04:00
|
|
|
$(WARNFLAGS) -I. -g -O \
|
2007-07-19 00:15:08 +04:00
|
|
|
`pkg-config --cflags libglade-2.0 gtk+-2.0 librsvg-2.0` \
|
|
|
|
`xml2-config --cflags`
|
2003-05-31 22:40:46 +04:00
|
|
|
|
2006-03-23 23:19:03 +03:00
|
|
|
# Stop GCC under Cygwin throwing a fit
|
|
|
|
# If you pass -std=<whatever> it appears to define __STRICT_ANSI__
|
2006-04-06 21:51:25 +04:00
|
|
|
# This causes use of functions such as vsnprintf to fail (as Cygwin's header
|
2006-03-23 23:19:03 +03:00
|
|
|
# files surround declarations of such things with #ifndef __STRICT_ANSI__)
|
2006-09-11 03:43:06 +04:00
|
|
|
ifneq ($(OS),riscos)
|
2006-03-23 23:19:03 +03:00
|
|
|
ifeq ($(shell echo $$OS),Windows_NT)
|
|
|
|
CFLAGS_GTK += -U__STRICT_ANSI__
|
|
|
|
endif
|
2006-09-11 03:43:06 +04:00
|
|
|
endif
|
2006-03-23 23:19:03 +03:00
|
|
|
|
2007-12-28 18:43:57 +03:00
|
|
|
AFLAGS_RISCOS = -xassembler-with-cpp $(PLATFORM_AFLAGS_RISCOS)
|
2006-02-23 18:06:54 +03:00
|
|
|
AFLAGS_RISCOS_SMALL = $(AFLAGS_RISCOS) -Dsmall
|
2005-04-15 09:52:31 +04:00
|
|
|
|
2003-05-31 22:40:46 +04:00
|
|
|
# targets
|
2004-08-13 19:47:44 +04:00
|
|
|
riscos: $(RUNIMAGE)
|
2004-06-03 01:40:55 +04:00
|
|
|
$(RUNIMAGE) : $(OBJS_RISCOS)
|
|
|
|
$(CC) -o $@ $(LDFLAGS_RISCOS) $^
|
|
|
|
riscos_small: u!RunImage,ff8
|
2006-02-23 18:06:54 +03:00
|
|
|
u!RunImage,ff8 : $(OBJS_RISCOS_SMALL)
|
2004-03-19 19:31:03 +03:00
|
|
|
$(CC) -o $@ $(LDFLAGS_SMALL) $^
|
2003-02-09 15:58:15 +03:00
|
|
|
|
2004-06-03 01:40:55 +04:00
|
|
|
debug: nsdebug
|
|
|
|
nsdebug: $(OBJS_DEBUG)
|
2004-05-21 00:06:31 +04:00
|
|
|
$(CC_DEBUG) -o $@ $(LDFLAGS_DEBUG) $^
|
2003-06-21 17:18:00 +04:00
|
|
|
|
2004-06-03 01:40:55 +04:00
|
|
|
riscos_debug: nsrodebug,ff8
|
|
|
|
nsrodebug,ff8: $(OBJS_DEBUGRO)
|
|
|
|
$(CC) -o $@ $(LDFLAGS_RISCOS) $^
|
|
|
|
|
2006-07-19 18:55:12 +04:00
|
|
|
gtk: nsgtk
|
2004-06-03 01:40:55 +04:00
|
|
|
nsgtk: $(OBJS_GTK)
|
2007-07-19 00:15:08 +04:00
|
|
|
$(SYSTEM_CC) -o nsgtk $^ `pkg-config --cflags --libs libglade-2.0 gtk+-2.0 gthread-2.0 gmodule-2.0 librsvg-2.0` \
|
2006-03-23 23:19:03 +03:00
|
|
|
$(LDFLAGS_DEBUG)
|
2004-06-03 01:40:55 +04:00
|
|
|
|
|
|
|
netsurf.zip: $(RUNIMAGE)
|
|
|
|
rm netsurf.zip; riscos-zip -9vr, netsurf.zip !NetSurf
|
|
|
|
|
2004-10-07 13:26:23 +04:00
|
|
|
# pattern rules for c source
|
2004-06-03 01:40:55 +04:00
|
|
|
$(OBJDIR_RISCOS)/%.o : %.c
|
|
|
|
@echo "==> $<"
|
|
|
|
@$(CC) -o $@ -c $(CFLAGS_RISCOS) $<
|
2006-02-23 18:06:54 +03:00
|
|
|
$(OBJDIR_RISCOS_SMALL)/%.o : %.c
|
|
|
|
@echo "==> $<"
|
|
|
|
@$(CC) -o $@ -c $(CFLAGS_RISCOS_SMALL) $<
|
2003-06-21 17:18:00 +04:00
|
|
|
$(OBJDIR_DEBUG)/%.o : %.c
|
2004-06-03 01:40:55 +04:00
|
|
|
@echo "==> $<"
|
|
|
|
@$(CC_DEBUG) -o $@ -c $(CFLAGS_DEBUG) $<
|
|
|
|
$(OBJDIR_GTK)/%.o : %.c
|
|
|
|
@echo "==> $<"
|
2006-09-10 17:25:19 +04:00
|
|
|
@$(SYSTEM_CC) -o $@ -c $(CFLAGS_GTK) $<
|
2003-02-09 15:58:15 +03:00
|
|
|
|
2005-04-15 09:52:31 +04:00
|
|
|
# pattern rules for asm source
|
|
|
|
$(OBJDIR_RISCOS)/%.o : %.s
|
2006-02-23 18:06:54 +03:00
|
|
|
@echo "==> $<"
|
2005-12-10 17:31:33 +03:00
|
|
|
$(ASM) -o $@ -c $(AFLAGS_RISCOS) $<
|
2006-02-23 18:06:54 +03:00
|
|
|
$(OBJDIR_RISCOS_SMALL)/%.o : %.s
|
|
|
|
@echo "==> $<"
|
|
|
|
$(ASM) -o $@ -c $(AFLAGS_RISCOS_SMALL) $<
|
2005-04-15 09:52:31 +04:00
|
|
|
|
2004-10-07 13:26:23 +04:00
|
|
|
# Generate dependencies.
|
|
|
|
# To disable automatic regeneration of dependencies (eg. if perl is not
|
|
|
|
# available), remove */*.[ch] from the line below.
|
|
|
|
# Under RISC OS, you may require *Set UnixFS$sfix "", if perl gives
|
|
|
|
# "No such file or directory" errors.
|
2007-06-10 21:46:44 +04:00
|
|
|
depend: css/css_enum.c css/parser.c css/scanner.c utils/translit.c */*.[ch] */*/*.[ch]
|
2004-10-07 13:26:23 +04:00
|
|
|
@echo "--> modified files $?"
|
|
|
|
@echo "--> updating dependencies"
|
2007-07-22 02:17:07 +04:00
|
|
|
@-mkdir -p $(OBJDIR_RISCOS) $(OBJDIR_RISCOS_SMALL) $(OBJDIR_DEBUG) $(OBJDIR_GTK)
|
|
|
|
@perl scandeps $(OBJDIR_RISCOS) $(OBJDIR_RISCOS_SMALL) $(OBJDIR_DEBUG) $(OBJDIR_GTK) -- $^ > depend
|
2003-04-04 19:19:32 +04:00
|
|
|
|
2004-10-07 13:26:23 +04:00
|
|
|
include depend
|