2003-06-30 16:44:03 +04:00
|
|
|
#
|
|
|
|
# This file is part of NetSurf, http://netsurf.sourceforge.net/
|
|
|
|
# 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)
|
2004-07-20 15:29:06 +04:00
|
|
|
# ncos -- NCOS build (variant of RISC OS for Network Computers)
|
2004-06-03 01:40:55 +04:00
|
|
|
# debug -- command line Unix/Linux, for debugging
|
|
|
|
# riscos_debug -- a cross between "riscos" and "debug"
|
|
|
|
# gtk -- experimental gtk version
|
|
|
|
#
|
2004-10-07 13:26:23 +04:00
|
|
|
# "riscos", "riscos_small", "ncos", and "riscos_debug" can be compiled under
|
|
|
|
# RISC OS, or cross-compiled using gccsdk.
|
2004-06-03 01:40:55 +04:00
|
|
|
|
2005-02-03 16:18:22 +03:00
|
|
|
OBJECTS_COMMON = content.o fetch.o fetchcache.o url_store.o # content/
|
2004-06-03 01:40:55 +04:00
|
|
|
OBJECTS_COMMON += css.o css_enum.o parser.o ruleset.o scanner.o # css/
|
2005-08-15 03:56:15 +04:00
|
|
|
OBJECTS_COMMON += box.o box_construct.o box_normalise.o form.o \
|
|
|
|
html.o html_redraw.o imagemap.o layout.o list.o \
|
|
|
|
table.o textplain.o # render/
|
2005-05-12 00:33:25 +04:00
|
|
|
OBJECTS_COMMON += messages.o talloc.o url.o utf8.o \
|
2005-04-16 09:09:33 +04:00
|
|
|
utils.o # utils/
|
2005-08-15 03:56:15 +04:00
|
|
|
OBJECTS_COMMON += loginlist.o options.o tree.o # desktop/
|
2004-06-03 01:40:55 +04:00
|
|
|
|
2005-06-21 18:19:59 +04:00
|
|
|
OBJECTS_IMAGE = gif.o gifread.o jpeg.o mng.o # image/
|
2004-09-04 02:44:48 +04:00
|
|
|
|
|
|
|
OBJECTS_RISCOS = $(OBJECTS_COMMON) $(OBJECTS_IMAGE)
|
2005-08-15 03:56:15 +04:00
|
|
|
OBJECTS_RISCOS += browser.o netsurf.o selection.o textinput.o \
|
|
|
|
version.o # desktop/
|
2005-12-12 00:55:25 +03:00
|
|
|
OBJECTS_RISCOS += 401login.o artworks.o assert.o awrender.o bitmap.o \
|
2005-12-31 07:47:31 +03:00
|
|
|
buffer.o configure.o debugwin.o \
|
2005-06-21 18:19:59 +04:00
|
|
|
dialog.o download.o draw.o filename.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 \
|
2005-04-23 06:58:27 +04:00
|
|
|
menus.o mouseactions.o plotters.o plugin.o print.o query.o \
|
2004-08-15 23:08:47 +04:00
|
|
|
save.o save_complete.o save_draw.o save_text.o \
|
2004-12-09 13:30:44 +03:00
|
|
|
schedule.o search.o sprite.o textselection.o theme.o \
|
2005-04-15 23:06:32 +04:00
|
|
|
theme_install.o thumbnail.o treeview.o ucstables.o uri.o \
|
2005-12-31 07:47:31 +03:00
|
|
|
url_complete.o url_protocol.o wimp.o wimp_event.o window.o # riscos/
|
2006-01-02 08:24:22 +03:00
|
|
|
OBJECTS_RISCOS += con_fonts.o con_image.o con_memory.o # riscos/configure/
|
2004-07-20 15:29:06 +04:00
|
|
|
# OBJECTS_RISCOS += memdebug.o
|
|
|
|
|
|
|
|
OBJECTS_NCOS = $(OBJECTS_RISCOS)
|
2004-06-03 01:40:55 +04:00
|
|
|
|
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/
|
|
|
|
OBJECTS_DEBUGRO += version.o # desktop/
|
2005-12-10 17:31:33 +03:00
|
|
|
OBJECTS_DEBUGRO += artworks.o bitmap.o draw.o filetype.o font.o \
|
2005-01-02 14:46:29 +03:00
|
|
|
gif.o gifread.o image.o jpeg.o plotters.o save_complete.o \
|
2005-04-17 20:42:05 +04:00
|
|
|
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)
|
2004-06-03 01:40:55 +04:00
|
|
|
OBJECTS_GTK += filetyped.o # debug/
|
2005-04-17 20:42:05 +04:00
|
|
|
OBJECTS_GTK += browser.o netsurf.o selection.o textinput.o \
|
|
|
|
version.o # desktop/
|
2004-10-18 01:13:24 +04:00
|
|
|
OBJECTS_GTK += font_pango.o gtk_bitmap.o gtk_gui.o \
|
2004-12-09 13:30:44 +03:00
|
|
|
gtk_plotters.o gtk_treeview.o gtk_window.o # gtk/
|
2004-06-03 01:40:55 +04:00
|
|
|
|
|
|
|
|
2004-10-07 13:26:23 +04:00
|
|
|
OBJDIR_RISCOS = 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
|
|
|
|
2004-10-07 13:26:23 +04:00
|
|
|
OBJDIR_NCOS = arm-ncos-aof
|
2004-07-20 15:29:06 +04:00
|
|
|
SOURCES_NCOS=$(OBJECTS_NCOS:.o=.c)
|
|
|
|
OBJS_NCOS=$(OBJECTS_NCOS:%.o=$(OBJDIR_NCOS)/%.o)
|
|
|
|
|
2004-05-21 00:51:42 +04:00
|
|
|
OBJDIR_DEBUG = $(shell $(CC_DEBUG) -dumpmachine)-debug
|
|
|
|
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)
|
|
|
|
|
|
|
|
OBJDIR_GTK = $(shell gcc -dumpmachine)-gtk
|
|
|
|
SOURCES_GTK=$(OBJECTS_GTK:.o=.c)
|
|
|
|
OBJS_GTK=$(OBJECTS_GTK:%.o=$(OBJDIR_GTK)/%.o)
|
|
|
|
|
|
|
|
# Inclusion of platform specific files has to occur after the OBJDIR stuff as
|
|
|
|
# that is refered to in the files
|
2004-05-21 00:51:42 +04:00
|
|
|
|
2004-06-10 00:20:10 +04:00
|
|
|
OS = $(word 2,$(subst -, ,$(shell gcc -dumpmachine)))
|
2004-05-21 00:51:42 +04:00
|
|
|
ifeq ($(OS),riscos)
|
|
|
|
include riscos.mk
|
|
|
|
else
|
|
|
|
include posix.mk
|
|
|
|
endif
|
|
|
|
|
2005-12-31 07:47:31 +03:00
|
|
|
VPATH = content:css:desktop:image:render:riscos:riscos/configure: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
|
|
|
|
2004-06-03 01:40:55 +04:00
|
|
|
CFLAGS_RISCOS = -std=c9x -D_BSD_SOURCE -Driscos -DBOOL_DEFINED -O \
|
2004-07-20 15:29:06 +04:00
|
|
|
$(WARNFLAGS) -I.. $(PLATFORM_CFLAGS_RISCOS) -mpoke-function-name \
|
|
|
|
# -include netsurf/utils/memdebug.h
|
|
|
|
CFLAGS_NCOS = $(CFLAGS_RISCOS) -Dncos
|
2004-06-03 01:40:55 +04:00
|
|
|
CFLAGS_DEBUG = -std=c9x -D_BSD_SOURCE -Ddebug $(WARNFLAGS) -I.. \
|
|
|
|
$(PLATFORM_CFLAGS_DEBUG) -g
|
|
|
|
CFLAGS_GTK = -std=c9x -D_BSD_SOURCE -D_POSIX_C_SOURCE -Dgtk \
|
|
|
|
$(WARNFLAGS) -I.. -g \
|
|
|
|
`pkg-config --cflags gtk+-2.0` `xml2-config --cflags`
|
2003-05-31 22:40:46 +04:00
|
|
|
|
2005-12-10 17:31:33 +03:00
|
|
|
AFLAGS_RISCOS = -I..,. $(PLATFORM_AFLAGS_RISCOS)
|
2005-12-10 18:31:21 +03:00
|
|
|
AFLAGS_NCOS = $(AFLAGS_RISCOS) -Dncos
|
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
|
|
|
|
u!RunImage,ff8 : $(OBJS_RISCOS)
|
2004-03-19 19:31:03 +03:00
|
|
|
$(CC) -o $@ $(LDFLAGS_SMALL) $^
|
2003-02-09 15:58:15 +03:00
|
|
|
|
2004-07-20 15:29:06 +04:00
|
|
|
ncos: $(NCRUNIMAGE)
|
|
|
|
$(NCRUNIMAGE) : $(OBJS_NCOS)
|
|
|
|
$(CC) -o $@ $(LDFLAGS_RISCOS) $^
|
|
|
|
|
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) $^
|
|
|
|
|
|
|
|
gtk: nsgtk
|
|
|
|
nsgtk: $(OBJS_GTK)
|
|
|
|
gcc -o nsgtk `pkg-config --cflags --libs gtk+-2.0 gthread-2.0` \
|
|
|
|
$(LDFLAGS_DEBUG) $^
|
|
|
|
|
|
|
|
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) $<
|
2004-07-20 15:29:06 +04:00
|
|
|
$(OBJDIR_NCOS)/%.o : %.c
|
|
|
|
@echo "==> $<"
|
|
|
|
@$(CC) -o $@ -c $(CFLAGS_NCOS) $<
|
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 "==> $<"
|
|
|
|
@gcc -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
|
|
|
|
@echo "== $<"
|
2005-12-10 17:31:33 +03:00
|
|
|
$(ASM) -o $@ -c $(AFLAGS_RISCOS) $<
|
2005-12-10 18:31:21 +03:00
|
|
|
$(OBJDIR_NCOS)/%.o : %.s
|
|
|
|
@echo "== $<"
|
|
|
|
$(ASM) -o $@ -c $(AFLAGS_NCOS) $<
|
2005-04-15 09:52:31 +04:00
|
|
|
|
2003-05-31 22:40:46 +04:00
|
|
|
# special cases
|
2003-04-04 19:19:32 +04:00
|
|
|
css/css_enum.c css/css_enum.h: css/css_enums css/makeenum
|
2004-10-07 13:26:23 +04:00
|
|
|
cd ..; perl netsurf/css/makeenum netsurf/css/css_enum < netsurf/css/css_enums
|
|
|
|
css/parser.c css/parser.h: css/parser.y
|
2003-06-05 18:39:54 +04:00
|
|
|
-cd css; lemon parser.y
|
2004-05-01 21:48:38 +04:00
|
|
|
css/scanner.c: css/scanner.l
|
|
|
|
cd css; re2c -s scanner.l > scanner.c
|
2003-12-29 03:38:59 +03:00
|
|
|
utils/translit.c: transtab
|
2004-10-07 13:26:23 +04:00
|
|
|
cd utils; perl tt2code < transtab > translit.c
|
|
|
|
|
|
|
|
# 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.
|
2004-12-09 13:33:09 +03:00
|
|
|
depend: */*.[ch]
|
2004-10-07 13:26:23 +04:00
|
|
|
@echo "--> modified files $?"
|
|
|
|
@echo "--> updating dependencies"
|
|
|
|
@-mkdir -p $(OBJDIR_RISCOS) $(OBJDIR_NCOS) $(OBJDIR_DEBUG) $(OBJDIR_GTK)
|
|
|
|
@perl scandeps netsurf $(OBJDIR_RISCOS) $(OBJDIR_NCOS) $(OBJDIR_DEBUG) $(OBJDIR_GTK) -- $^ > depend
|
2003-04-04 19:19:32 +04:00
|
|
|
|
2004-10-07 13:26:23 +04:00
|
|
|
include depend
|
2003-04-04 19:19:32 +04:00
|
|
|
|
2003-05-31 22:40:46 +04:00
|
|
|
# remove generated files
|
2004-10-07 13:26:23 +04:00
|
|
|
clean:
|
2004-07-20 15:29:06 +04:00
|
|
|
-rm $(OBJDIR_RISCOS)/* $(OBJDIR_NCOS)/* \
|
|
|
|
$(OBJDIR_DEBUG)/* $(OBJDIR_GTK)/* \
|
2004-10-07 13:26:23 +04:00
|
|
|
css/css_enum.c css/css_enum.h \
|
2003-05-31 22:40:46 +04:00
|
|
|
css/parser.c css/parser.h css/scanner.c css/scanner.h
|