2007-12-23 00:15:58 +03:00
#
# Makefile for NetSurf
#
# Copyright 2007 Daniel Silverstone <dsilvers@netsurf-browser.org>
2008-07-29 01:21:40 +04:00
# Copyright 2008 Rob Kendrick <rjek@netsurf-browser.org>
2007-12-23 00:15:58 +03:00
#
# Trivially, invoke as:
2008-03-19 07:03:40 +03:00
# make
2007-12-23 00:15:58 +03:00
# to build native, or:
2008-03-19 07:03:40 +03:00
# make TARGET=riscos
2007-12-23 00:15:58 +03:00
# to cross-build for RO.
#
2008-07-29 01:21:40 +04:00
# Look at Makefile.config for configuration options.
#
2008-03-19 06:25:05 +03:00
# Tested on unix platforms (building for GTK and cross-compiling for RO) and
# on RO (building for RO).
2007-12-23 00:15:58 +03:00
#
# To clean, invoke as above, with the 'clean' target
#
2008-03-09 20:06:45 +03:00
# To build developer Doxygen generated documentation, invoke as above,
# with the 'docs' target:
2008-03-19 07:03:40 +03:00
# make docs
2008-03-09 20:06:45 +03:00
#
2007-12-23 00:15:58 +03:00
all : all -program
# Determine host type
2008-04-08 03:13:06 +04:00
# NOTE: HOST determination on RISC OS could fail because of missing bug fixes
# in UnixLib which only got addressed in UnixLib 5 / GCCSDK 4.
2008-03-20 18:13:52 +03:00
# When you don't have 'uname' available, you will see:
# File 'uname' not found
2008-04-08 03:13:06 +04:00
# When you do and using a 'uname' compiled with a buggy UnixLib, you
# will see the following printed on screen:
2008-03-20 18:13:52 +03:00
# RISC OS
# In both cases HOST make variable is empty and we recover from that by
# assuming we're building on RISC OS.
2008-04-08 03:13:06 +04:00
# In case you don't see anything printed (including the warning), you
2008-07-29 03:16:59 +04:00
# have an up-to-date RISC OS build system. ;-)
2008-03-19 03:48:08 +03:00
HOST := $( shell uname -s)
2011-04-22 13:00:24 +04:00
# Sanitise host
# TODO: Ideally, we want the equivalent of s/[^A-Za-z0-9]/_/g here
HOST := $( subst .,_,$( subst -,_,$( subst /,_,$( HOST) ) ) )
2008-03-20 18:13:52 +03:00
i f e q ( $( HOST ) , )
2008-07-29 03:16:59 +04:00
HOST := riscos
$( warning Build platform determination failed but that's a known problem for RISC OS so we' re assuming a native RISC OS build.)
2008-03-23 03:59:09 +03:00
e l s e
2008-07-29 03:16:59 +04:00
ifeq ( $( HOST) ,RISC OS)
# Fixup uname -s returning "RISC OS"
HOST := riscos
endif
2008-03-20 18:13:52 +03:00
e n d i f
2007-12-23 00:15:58 +03:00
2008-03-19 03:48:08 +03:00
i f e q ( $( HOST ) , r i s c o s )
2008-07-29 03:16:59 +04:00
# Build happening on RO platform, default target is RO backend
ifeq ( $( TARGET) ,)
TARGET := riscos
endif
2008-06-04 00:13:34 +04:00
e l s e
2008-07-29 03:16:59 +04:00
ifeq ( $( HOST) ,BeOS)
HOST := beos
endif
ifeq ( $( HOST) ,Haiku)
# Haiku implements the BeOS API
HOST := beos
endif
ifeq ( $( HOST) ,beos)
# Build happening on BeOS platform, default target is BeOS backend
ifeq ( $( TARGET) ,)
TARGET := beos
endif
else
2008-08-11 20:44:12 +04:00
ifeq ( $( HOST) ,AmigaOS)
HOST := amiga
ifeq ( $( TARGET) ,)
TARGET := amiga
endif
else
ifeq ( $( HOST) ,Darwin)
HOST := macosx
2011-01-19 04:36:21 +03:00
ifeq ( $( TARGET) ,)
TARGET := cocoa
endif
2010-06-21 11:26:06 +04:00
endif
ifeq ( $( HOST) ,FreeMiNT)
HOST := mint
2008-08-11 20:44:12 +04:00
endif
2010-06-21 11:26:06 +04:00
ifeq ( $( HOST) ,mint)
ifeq ( $( TARGET) ,)
2011-01-06 00:02:22 +03:00
TARGET := atari
2010-06-21 11:26:06 +04:00
endif
endif
2011-01-23 03:20:20 +03:00
ifeq ( $( findstring MINGW,$( HOST) ) ,MINGW)
# MSYS' uname reports the likes of "MINGW32_NT-6.0"
HOST := windows
endif
ifeq ( $( HOST) ,windows)
ifeq ( $( TARGET) ,)
TARGET := windows
endif
endif
2008-08-11 20:44:12 +04:00
# Default target is GTK backend
ifeq ( $( TARGET) ,)
TARGET := gtk
endif
2008-07-29 03:16:59 +04:00
endif
endif
2008-06-04 00:13:34 +04:00
e n d i f
2008-03-22 03:49:56 +03:00
SUBTARGET =
2008-06-04 00:13:34 +04:00
RESOURCES =
2007-12-23 00:15:58 +03:00
2008-03-22 01:40:11 +03:00
i f n e q ( $( TARGET ) , r i s c o s )
2008-07-29 03:16:59 +04:00
ifneq ( $( TARGET) ,gtk)
ifneq ( $( TARGET) ,beos)
2011-03-10 00:32:54 +03:00
ifneq ( $( findstring amiga,$( TARGET) ) ,amiga)
2009-04-17 03:10:37 +04:00
ifneq ( $( TARGET) ,framebuffer)
2010-01-31 03:36:02 +03:00
ifneq ( $( TARGET) ,windows)
2011-01-06 00:02:22 +03:00
ifneq ( $( TARGET) ,atari)
2011-01-19 04:36:21 +03:00
ifneq ( $( TARGET) ,cocoa)
2011-03-12 18:08:07 +03:00
ifneq ( $( TARGET) ,monkey)
$( error Unknown TARGET " $( TARGET) " , should either be "riscos" , "gtk" , "beos" , "amiga" , "framebuffer" , "windows" , "atari" or "cocoa" or "monkey" )
endif
2011-01-19 04:36:21 +03:00
endif
2011-01-06 00:02:22 +03:00
endif
2010-01-31 03:36:02 +03:00
endif
2008-08-02 18:35:40 +04:00
endif
2008-07-29 03:16:59 +04:00
endif
endif
endif
2008-03-22 01:40:11 +03:00
e n d i f
2007-12-23 00:15:58 +03:00
Q = @
VQ = @
PERL = perl
MKDIR = mkdir
TOUCH = touch
2008-07-29 13:10:43 +04:00
STRIP = strip
2013-05-02 12:24:18 +04:00
SPLIT_MESSAGES = $( PERL) utils/split-messages.pl
2007-12-23 00:15:58 +03:00
2009-02-26 17:14:29 +03:00
# Override this only if the host compiler is called something different
HOST_CC := gcc
2007-12-23 00:15:58 +03:00
i f e q ( $( TARGET ) , r i s c o s )
2008-07-29 03:16:59 +04:00
ifeq ( $( HOST) ,riscos)
# Build for RO on RO
GCCSDK_INSTALL_ENV := <NSLibs$$ Dir>
2008-08-07 01:46:53 +04:00
CCRES := ccres
TPLEXT :=
2008-12-09 14:12:58 +03:00
MAKERUN := makerun
2012-10-07 23:40:01 +04:00
SQUEEZE := squeeze
2008-12-09 14:12:58 +03:00
RUNEXT :=
2008-07-29 03:16:59 +04:00
CC := gcc
2012-12-10 15:38:52 +04:00
CXX := g++
2008-07-29 03:16:59 +04:00
EXEEXT :=
PKG_CONFIG :=
else
# Cross-build for RO (either using GCCSDK 3.4.6 - AOF,
# either using GCCSDK 4 - ELF)
2011-01-04 00:10:15 +03:00
ifeq ( $( origin GCCSDK_INSTALL_ENV) ,undefined)
ifneq ( $( realpath /opt/netsurf/arm-unknown-riscos/env) ,)
GCCSDK_INSTALL_ENV := /opt/netsurf/arm-unknown-riscos/env
else
GCCSDK_INSTALL_ENV := /home/riscos/env
endif
endif
ifeq ( $( origin GCCSDK_INSTALL_CROSSBIN) ,undefined)
ifneq ( $( realpath /opt/netsurf/arm-unknown-riscos/cross/bin) ,)
GCCSDK_INSTALL_CROSSBIN := /opt/netsurf/arm-unknown-riscos/cross/bin
else
GCCSDK_INSTALL_CROSSBIN := /home/riscos/cross/bin
endif
endif
2008-08-07 01:46:53 +04:00
CCRES := $( GCCSDK_INSTALL_CROSSBIN) /ccres
TPLEXT := ,fec
2008-12-09 14:12:58 +03:00
MAKERUN := $( GCCSDK_INSTALL_CROSSBIN) /makerun
2012-10-07 23:40:01 +04:00
SQUEEZE := $( GCCSDK_INSTALL_CROSSBIN) /squeeze
2008-12-09 14:12:58 +03:00
RUNEXT := ,feb
2008-07-29 03:16:59 +04:00
CC := $( wildcard $( GCCSDK_INSTALL_CROSSBIN) /*gcc)
ifneq ( ,$( findstring arm-unknown-riscos-gcc,$( CC) ) )
SUBTARGET := -elf
EXEEXT := ,e1f
ELF2AIF := $( GCCSDK_INSTALL_CROSSBIN) /elf2aif
else
SUBTARGET := -aof
EXEEXT := ,ff8
endif
2012-12-10 15:38:52 +04:00
CXX := $( wildcard $( GCCSDK_INSTALL_CROSSBIN) /*g++)
2008-07-29 03:16:59 +04:00
PKG_CONFIG := $( GCCSDK_INSTALL_ENV) /ro-pkg-config
endif
2008-06-04 00:13:34 +04:00
e l s e
2008-07-29 03:16:59 +04:00
ifeq ( $( TARGET) ,beos)
# Building for BeOS/Haiku
#ifeq ($(HOST),beos)
# Build for BeOS on BeOS
GCCSDK_INSTALL_ENV := /boot/develop
CC := gcc
CXX := g++
EXEEXT :=
PKG_CONFIG :=
#endif
else
2010-01-31 03:36:02 +03:00
ifeq ( $( TARGET) ,windows)
ifneq ( $( HOST) ,windows)
# Set Mingw defaults
2012-07-24 00:12:19 +04:00
GCCSDK_INSTALL_ENV ?= /opt/netsurf/i686-w64-mingw32/env
GCCSDK_INSTALL_CROSSBIN ?= /opt/netsurf/i686-w64-mingw32/cross/bin
2010-01-31 03:36:02 +03:00
2012-07-24 00:12:19 +04:00
CC := $( wildcard $( GCCSDK_INSTALL_CROSSBIN) /*gcc)
WINDRES := $( wildcard $( GCCSDK_INSTALL_CROSSBIN) /*windres)
PKG_CONFIG := PKG_CONFIG_LIBDIR = " $( GCCSDK_INSTALL_ENV) /lib/pkgconfig " pkg-config
2011-01-23 03:20:20 +03:00
else
# Building on Windows
2011-01-23 03:32:57 +03:00
CC := gcc
PKG_CONFIG :=
2010-01-31 03:36:02 +03:00
endif
else
2011-03-10 00:32:54 +03:00
ifeq ( $( findstring amiga,$( TARGET) ) ,amiga)
2012-10-13 23:45:51 +04:00
ifeq ( $( findstring amiga,$( HOST) ) ,amiga)
PKG_CONFIG := pkg-config
else
2011-03-10 00:32:54 +03:00
ifeq ( $( TARGET) ,amigaos3)
GCCSDK_INSTALL_ENV ?= /opt/netsurf/m68k-unknown-amigaos/env
GCCSDK_INSTALL_CROSSBIN ?= /opt/netsurf/m68k-unknown-amigaos/cross/bin
SUBTARGET = os3
else
GCCSDK_INSTALL_ENV ?= /opt/netsurf/ppc-amigaos/env
GCCSDK_INSTALL_CROSSBIN ?= /opt/netsurf/ppc-amigaos/cross/bin
endif
override TARGET := amiga
2010-12-30 00:26:45 +03:00
CC := $( wildcard $( GCCSDK_INSTALL_CROSSBIN) /*gcc)
PKG_CONFIG := PKG_CONFIG_LIBDIR = " $( GCCSDK_INSTALL_ENV) /lib/pkgconfig " pkg-config
endif
else
2011-09-28 20:01:06 +04:00
ifeq ( $( TARGET) ,cocoa)
PKG_CONFIG := PKG_CONFIG_PATH = " $( PKG_CONFIG_PATH) :/usr/local/lib/pkgconfig " pkg-config
else
2012-07-20 19:30:12 +04:00
ifeq ( $( TARGET) ,atari)
ifeq ( $( HOST) ,atari)
PKG_CONFIG := pkg-config
else
ifeq ( $( HOST) ,mint)
PKG_CONFIG := pkg-config
else
GCCSDK_INSTALL_ENV ?= /opt/netsurf/m68k-atari-mint/env
GCCSDK_INSTALL_CROSSBIN ?= /opt/netsurf/m68k-atari-mint/cross/bin
CC := $( wildcard $( GCCSDK_INSTALL_CROSSBIN) /*gcc)
PKG_CONFIG := PKG_CONFIG_LIBDIR = " $( GCCSDK_INSTALL_ENV) /lib/pkgconfig " pkg-config
endif
endif
else
2012-12-13 19:33:54 +04:00
ifeq ( $( TARGET) ,monkey)
ifeq ( $( origin GCCSDK_INSTALL_ENV) ,undefined)
PKG_CONFIG := pkg-config
else
PKG_CONFIG := PKG_CONFIG_LIBDIR = " $( GCCSDK_INSTALL_ENV) /lib/pkgconfig " pkg-config
endif
ifneq ( $( origin GCCSDK_INSTALL_CROSSBIN) ,undefined)
CC := $( wildcard $( GCCSDK_INSTALL_CROSSBIN) /*gcc)
CXX := $( wildcard $( GCCSDK_INSTALL_CROSSBIN) /*g++)
endif
else
2013-05-12 23:41:28 +04:00
ifeq ( $( findstring framebuffer,$( TARGET) ) ,framebuffer)
ifeq ( $( origin GCCSDK_INSTALL_ENV) ,undefined)
PKG_CONFIG := pkg-config
else
PKG_CONFIG := PKG_CONFIG_LIBDIR = " $( GCCSDK_INSTALL_ENV) /lib/pkgconfig " pkg-config
endif
ifneq ( $( origin GCCSDK_INSTALL_CROSSBIN) ,undefined)
CC := $( wildcard $( GCCSDK_INSTALL_CROSSBIN) /*gcc)
CXX := $( wildcard $( GCCSDK_INSTALL_CROSSBIN) /*g++)
endif
else
# All native targets (GTK)
PKG_CONFIG := pkg-config
endif
2012-12-13 19:33:54 +04:00
endif
2012-07-20 19:30:12 +04:00
endif
2011-09-28 20:01:06 +04:00
endif
2010-12-30 00:26:45 +03:00
endif
2010-01-31 03:36:02 +03:00
endif
2008-07-29 03:16:59 +04:00
endif
2008-06-04 00:13:34 +04:00
e n d i f
2007-12-23 00:15:58 +03:00
2012-12-13 23:27:16 +04:00
# compiler versioning to adjust warning flags
2012-12-14 14:53:43 +04:00
CC_VERSION := $( shell $( CC) -dumpversion)
CC_MAJOR := $( word 1,$( subst ., ,$( CC_VERSION) ) )
CC_MINOR := $( word 2,$( subst ., ,$( CC_VERSION) ) )
2012-12-13 23:27:16 +04:00
d e f i n e c c _ v e r _ g e
$( shell expr $ ( CC_MAJOR ) \>= $ ( 1) \& $ ( CC_MINOR ) \>= $ ( 2) )
e n d e f
2010-10-29 04:54:27 +04:00
2012-08-20 21:08:47 +04:00
# CCACHE
i f e q ( $( origin CCACHE ) , u n d e f i n e d )
2012-08-20 21:46:28 +04:00
CCACHE = $( word 1,$( shell ccache -V 2>/dev/null) )
2012-08-20 21:08:47 +04:00
e n d i f
CC := $( CCACHE) $( CC)
# Target paths
Merged revisions 5309-5406,5409-5422 via svnmerge from
svn://svn.netsurf-browser.org/branches/vince/netsurf-fb
........
r5309 | vince | 2008-09-13 10:59:10 +0100 (Sat, 13 Sep 2008) | 2 lines
first stab at framebuffer frontend
........
r5313 | vince | 2008-09-14 15:08:52 +0100 (Sun, 14 Sep 2008) | 2 lines
add line plotters
........
r5314 | vince | 2008-09-14 15:28:12 +0100 (Sun, 14 Sep 2008) | 2 lines
add rectangle plot to 16bpp plotters
........
r5315 | vince | 2008-09-14 19:58:57 +0100 (Sun, 14 Sep 2008) | 2 lines
improve 16bpp image plot
........
r5316 | vince | 2008-09-15 00:35:32 +0100 (Mon, 15 Sep 2008) | 2 lines
abstract the os specific framebuffer init
........
r5317 | vince | 2008-09-15 11:18:51 +0100 (Mon, 15 Sep 2008) | 2 lines
first cut of linux frontend
........
r5318 | vince | 2008-09-15 12:01:00 +0100 (Mon, 15 Sep 2008) | 2 lines
remove junk includes
........
r5319 | vince | 2008-09-15 12:09:02 +0100 (Mon, 15 Sep 2008) | 2 lines
make plotters OS agnostic again
........
r5322 | vince | 2008-09-15 15:55:01 +0100 (Mon, 15 Sep 2008) | 2 lines
Linux frontend operates
........
r5323 | vince | 2008-09-15 16:32:47 +0100 (Mon, 15 Sep 2008) | 2 lines
abstract out OS specific input
........
r5326 | vince | 2008-09-15 19:21:01 +0100 (Mon, 15 Sep 2008) | 2 lines
Improve linux mode setting
........
r5329 | vince | 2008-09-15 21:13:33 +0100 (Mon, 15 Sep 2008) | 2 lines
improve text clipping
........
r5339 | vince | 2008-09-16 00:07:57 +0100 (Tue, 16 Sep 2008) | 2 lines
possibly fix text clipping issue
........
r5342 | vince | 2008-09-16 00:39:36 +0100 (Tue, 16 Sep 2008) | 2 lines
consolidate polygon plotters
........
r5344 | dsilvers | 2008-09-16 10:21:06 +0100 (Tue, 16 Sep 2008) | 1 line
Fix up the framebuffer target makefile a bit more, add some config options for it
........
r5345 | dsilvers | 2008-09-16 10:22:19 +0100 (Tue, 16 Sep 2008) | 1 line
Ensure the appropriate frontend is selected when building framebuffer
........
r5346 | dsilvers | 2008-09-16 10:27:16 +0100 (Tue, 16 Sep 2008) | 1 line
Update build system to support targetting separate framebuffer frontends in different build trees, update executable to be nsfb-blah
........
r5350 | vince | 2008-09-16 17:15:04 +0100 (Tue, 16 Sep 2008) | 1 line
Add -g to provide symbols for framebuffer link
........
r5351 | vince | 2008-09-16 17:17:09 +0100 (Tue, 16 Sep 2008) | 1 line
framebuffer scheduler now works, plotters tweaked, gui tracks window redraw requirements better, keypresses not duplicated under linux fb
........
r5352 | dsilvers | 2008-09-16 17:38:53 +0100 (Tue, 16 Sep 2008) | 1 line
Ensure we only allow one fetcher at a time
........
r5361 | vince | 2008-09-17 11:48:44 +0100 (Wed, 17 Sep 2008) | 2 lines
initial cursor support
........
r5362 | vince | 2008-09-17 13:56:47 +0100 (Wed, 17 Sep 2008) | 2 lines
add mouse handling
........
r5363 | vince | 2008-09-17 14:14:44 +0100 (Wed, 17 Sep 2008) | 2 lines
add framebuffer resources
........
r5364 | vince | 2008-09-17 17:12:21 +0100 (Wed, 17 Sep 2008) | 2 lines
add reasonable pointer
........
r5366 | vince | 2008-09-17 17:17:25 +0100 (Wed, 17 Sep 2008) | 2 lines
fix pointer alpha
........
r5370 | vince | 2008-09-18 13:43:53 +0100 (Thu, 18 Sep 2008) | 2 lines
warning squash and cleanup ready for trunk merge
........
r5375 | vince | 2008-09-19 14:58:43 +0100 (Fri, 19 Sep 2008) | 2 lines
Working mouse navigation
........
r5377 | vince | 2008-09-20 14:06:22 +0100 (Sat, 20 Sep 2008) | 2 lines
Improve scrolling
........
r5378 | vince | 2008-09-20 14:46:46 +0100 (Sat, 20 Sep 2008) | 2 lines
fix redraw issues with scrolling
........
r5380 | vince | 2008-09-20 17:08:43 +0100 (Sat, 20 Sep 2008) | 3 lines
Alter panning to use its own flag so it doesnt cause invalid redraw
operations
........
r5381 | vince | 2008-09-20 21:52:45 +0100 (Sat, 20 Sep 2008) | 2 lines
add dummy framebuffer
........
r5383 | vince | 2008-09-21 00:00:15 +0100 (Sun, 21 Sep 2008) | 2 lines
fix segfault when cursor is off teh bottom of teh screen
........
r5384 | vince | 2008-09-21 00:06:08 +0100 (Sun, 21 Sep 2008) | 2 lines
fix off by one in pointer fix
........
r5385 | vince | 2008-09-21 00:25:09 +0100 (Sun, 21 Sep 2008) | 2 lines
when fixing bloody silly off by one errors remember to fix *both* references
........
r5387 | vince | 2008-09-21 00:38:13 +0100 (Sun, 21 Sep 2008) | 2 lines
last try at stopping the pointer segfault
........
r5388 | vince | 2008-09-21 16:24:18 +0100 (Sun, 21 Sep 2008) | 2 lines
improve vertical text clipping
........
r5392 | vince | 2008-09-21 23:11:51 +0100 (Sun, 21 Sep 2008) | 2 lines
Improve text plotters
........
r5393 | vince | 2008-09-21 23:34:38 +0100 (Sun, 21 Sep 2008) | 2 lines
fix 32bpp line plotting
........
r5394 | vince | 2008-09-22 00:00:03 +0100 (Mon, 22 Sep 2008) | 2 lines
Fix off by one error in line plotting clipping
........
r5397 | vince | 2008-09-22 13:46:22 +0100 (Mon, 22 Sep 2008) | 2 lines
Fix bitmap tileing
........
r5398 | vince | 2008-09-22 17:46:02 +0100 (Mon, 22 Sep 2008) | 2 lines
enable knockout renderer
........
r5399 | vince | 2008-09-22 18:43:48 +0100 (Mon, 22 Sep 2008) | 2 lines
ensure clipping region lies within window, caused by knockout renderer
........
r5400 | vince | 2008-09-22 19:20:25 +0100 (Mon, 22 Sep 2008) | 2 lines
update cursor to one swiped from X windows
........
r5405 | vince | 2008-09-23 09:09:05 +0100 (Tue, 23 Sep 2008) | 2 lines
fix vertical scroll limit
........
r5412 | dsilvers | 2008-09-23 10:53:14 +0100 (Tue, 23 Sep 2008) | 1 line
Revert noisy fetcher patch
........
r5413 | dsilvers | 2008-09-23 10:58:00 +0100 (Tue, 23 Sep 2008) | 1 line
Add header guards
........
r5414 | dsilvers | 2008-09-23 11:31:31 +0100 (Tue, 23 Sep 2008) | 1 line
Tidy the region clipping slightly
........
r5416 | dsilvers | 2008-09-23 12:05:00 +0100 (Tue, 23 Sep 2008) | 1 line
Rationalise how the framebuffer frontend finds resources and options
........
r5418 | dsilvers | 2008-09-23 13:59:00 +0100 (Tue, 23 Sep 2008) | 1 line
Ensure options are overridden after load, and squash an fb_gui.c warning
........
r5419 | dsilvers | 2008-09-23 14:20:07 +0100 (Tue, 23 Sep 2008) | 1 line
Support fb_mode and fb_device options
........
r5420 | dsilvers | 2008-09-23 14:21:48 +0100 (Tue, 23 Sep 2008) | 1 line
Support option_fb_device in the able frontend
........
r5421 | dsilvers | 2008-09-23 14:25:17 +0100 (Tue, 23 Sep 2008) | 1 line
Ensure target_blank is disabled
........
r5422 | dsilvers | 2008-09-23 14:39:00 +0100 (Tue, 23 Sep 2008) | 1 line
Rework linux fb frontend to support scanning and opening all event devices for input
........
svn path=/trunk/netsurf/; revision=5423
2008-09-23 18:00:40 +04:00
OBJROOT = build-$( HOST) -$( TARGET) $( SUBTARGET)
2010-10-29 04:54:27 +04:00
DEPROOT := $( OBJROOT) /deps
TOOLROOT := $( OBJROOT) /tools
2008-04-07 23:13:11 +04:00
2008-07-26 21:08:23 +04:00
2014-04-30 14:56:05 +04:00
# A macro that conditionaly adds flags to the build when a feature is enabled.
#
2008-07-29 00:56:24 +04:00
# 1: Feature name (ie, NETSURF_USE_BMP -> BMP)
# 2: Parameters to add to CFLAGS
# 3: Parameters to add to LDFLAGS
2008-07-29 03:16:59 +04:00
# 4: Human-readable name for the feature
2008-07-29 00:56:24 +04:00
d e f i n e f e a t u r e _ e n a b l e d
2008-07-29 03:16:59 +04:00
ifeq ( $$ ( NETSURF_USE_$( 1) ) ,YES)
CFLAGS += $( 2)
LDFLAGS += $( 3)
2008-07-29 13:44:13 +04:00
ifneq ( $( MAKECMDGOALS) ,clean)
2010-04-06 22:53:13 +04:00
$$ ( info M.CONFIG: $( 4) enabled ( NETSURF_USE_$( 1) := YES) )
2008-07-29 13:44:13 +04:00
endif
2010-04-06 20:25:51 +04:00
else ifeq ( $$ ( NETSURF_USE_$( 1) ) ,NO)
2008-07-29 13:44:13 +04:00
ifneq ( $( MAKECMDGOALS) ,clean)
2010-04-06 22:53:13 +04:00
$$ ( info M.CONFIG: $( 4) disabled ( NETSURF_USE_$( 1) := NO) )
2008-07-29 13:44:13 +04:00
endif
2010-04-06 20:25:51 +04:00
else
2010-04-06 22:53:13 +04:00
$$ ( info M.CONFIG: $( 4) error ( NETSURF_USE_$( 1) := $$ ( NETSURF_USE_$( 1) ) ) )
2010-04-06 20:25:51 +04:00
$$ ( error NETSURF_USE_$( 1) must be YES or NO)
2008-07-29 03:16:59 +04:00
endif
2008-07-29 00:56:24 +04:00
e n d e f
2014-04-30 14:56:05 +04:00
# A macro that conditionaly adds flags to the build with a uniform display.
#
# 1: Feature name (ie, NETSURF_USE_BMP -> BMP)
# 2: Human-readable name for the feature
# 3: Parameters to add to CFLAGS when enabled
# 4: Parameters to add to LDFLAGS when enabled
# 5: Parameters to add to CFLAGS when disabled
# 6: Parameters to add to LDFLAGS when disabled
d e f i n e f e a t u r e _ s w i t c h
ifeq ( $$ ( NETSURF_USE_$( 1) ) ,YES)
CFLAGS += $( 3)
LDFLAGS += $( 4)
ifneq ( $( MAKECMDGOALS) ,clean)
$$ ( info M.CONFIG: $( 2) enabled ( NETSURF_USE_$( 1) := YES) )
endif
else ifeq ( $$ ( NETSURF_USE_$( 1) ) ,NO)
CFLAGS += $( 5)
LDFLAGS += $( 6)
ifneq ( $( MAKECMDGOALS) ,clean)
$$ ( info M.CONFIG: $( 2) disabled ( NETSURF_USE_$( 1) := NO) )
endif
else
$$ ( info M.CONFIG: $( 4) error ( NETSURF_USE_$( 1) := $$ ( NETSURF_USE_$( 1) ) ) )
$$ ( error NETSURF_USE_$( 1) must be YES or NO)
endif
e n d e f
2012-12-13 21:23:47 +04:00
# Extend flags with appropriate values from pkg-config for enabled features
#
# 1: pkg-config required modules for feature
# 2: Human-readable name for the feature
d e f i n e p k g _ c o n f i g _ f i n d _ a n d _ a d d
ifeq ( $$ ( PKG_CONFIG) ,)
$$ ( error pkg-config is required to auto-detect feature availability)
endif
PKG_CONFIG_$( 1) _EXISTS := $$ ( shell $$ ( PKG_CONFIG) --exists $( 1) && echo yes)
ifeq ( $$ ( PKG_CONFIG_$( 1) _EXISTS) ,yes)
CFLAGS += $$ ( shell $$ ( PKG_CONFIG) --cflags $( 1) )
LDFLAGS += $$ ( shell $$ ( PKG_CONFIG) --libs $( 1) )
ifneq ( $( MAKECMDGOALS) ,clean)
$$ ( info PKG.CNFG: $( 2) ( $( 1) ) enabled)
endif
else
ifneq ( $( MAKECMDGOALS) ,clean)
$$ ( info PKG.CNFG: $( 2) ( $( 1) ) failed)
$$ ( error Unable to find library for : $( 2) ( $( 1) ) )
endif
endif
e n d e f
2012-12-13 20:31:05 +04:00
# Extend flags with appropriate values from pkg-config for enabled features
#
2008-07-29 03:16:59 +04:00
# 1: Feature name (ie, NETSURF_USE_RSVG -> RSVG)
# 2: pkg-config required modules for feature
# 3: Human-readable name for the feature
2012-12-13 20:31:05 +04:00
d e f i n e p k g _ c o n f i g _ f i n d _ a n d _ a d d _ e n a b l e d
2008-07-29 03:16:59 +04:00
ifeq ( $$ ( PKG_CONFIG) ,)
$$ ( error pkg-config is required to auto-detect feature availability)
endif
2010-04-06 20:25:51 +04:00
NETSURF_FEATURE_$( 1) _AVAILABLE := $$ ( shell $$ ( PKG_CONFIG) --exists $( 2) && echo yes)
ifeq ( $$ ( NETSURF_USE_$( 1) ) ,YES)
ifeq ( $$ ( NETSURF_FEATURE_$( 1) _AVAILABLE) ,yes)
CFLAGS += $$ ( shell $$ ( PKG_CONFIG) --cflags $( 2) ) $$ ( NETSURF_FEATURE_$( 1) _CFLAGS)
LDFLAGS += $$ ( shell $$ ( PKG_CONFIG) --libs $( 2) ) $$ ( NETSURF_FEATURE_$( 1) _LDFLAGS)
ifneq ( $( MAKECMDGOALS) ,clean)
2010-04-06 22:53:13 +04:00
$$ ( info M.CONFIG: $( 3) ( $( 2) ) enabled ( NETSURF_USE_$( 1) := YES) )
2008-07-29 03:16:59 +04:00
endif
else
2011-04-22 14:17:00 +04:00
ifneq ( $( MAKECMDGOALS) ,clean)
$$ ( info M.CONFIG: $( 3) ( $( 2) ) failed ( NETSURF_USE_$( 1) := YES) )
$$ ( error Unable to find library for : $( 3) ( $( 2) ) )
endif
2010-04-06 20:25:51 +04:00
endif
else ifeq ( $$ ( NETSURF_USE_$( 1) ) ,AUTO)
ifeq ( $$ ( NETSURF_FEATURE_$( 1) _AVAILABLE) ,yes)
CFLAGS += $$ ( shell $$ ( PKG_CONFIG) --cflags $( 2) ) $$ ( NETSURF_FEATURE_$( 1) _CFLAGS)
LDFLAGS += $$ ( shell $$ ( PKG_CONFIG) --libs $( 2) ) $$ ( NETSURF_FEATURE_$( 1) _LDFLAGS)
2008-07-29 13:44:13 +04:00
ifneq ( $( MAKECMDGOALS) ,clean)
2010-04-06 22:53:13 +04:00
$$ ( info M.CONFIG: $( 3) ( $( 2) ) auto-enabled ( NETSURF_USE_$( 1) := AUTO) )
2011-08-28 18:29:15 +04:00
NETSURF_USE_$( 1) := YES
2008-07-29 13:44:13 +04:00
endif
2010-04-06 20:25:51 +04:00
else
ifneq ( $( MAKECMDGOALS) ,clean)
$$ ( info M.CONFIG: $( 3) ( $( 2) ) auto-disabled ( NETSURF_USE_$( 1) := AUTO) )
2011-08-28 18:29:15 +04:00
NETSURF_USE_$( 1) := NO
2008-07-29 03:16:59 +04:00
endif
endif
2010-04-06 20:25:51 +04:00
else ifeq ( $$ ( NETSURF_USE_$( 1) ) ,NO)
2008-07-29 13:44:13 +04:00
ifneq ( $( MAKECMDGOALS) ,clean)
2010-04-06 22:53:13 +04:00
$$ ( info M.CONFIG: $( 3) ( $( 2) ) disabled ( NETSURF_USE_$( 1) := NO) )
2008-07-29 13:44:13 +04:00
endif
2010-04-06 20:25:51 +04:00
else
2011-04-22 14:17:00 +04:00
ifneq ( $( MAKECMDGOALS) ,clean)
$$ ( info M.CONFIG: $( 3) ( $( 2) ) error ( NETSURF_USE_$( 1) := $$ ( NETSURF_USE_$( 1) ) ) )
$$ ( error NETSURF_USE_$( 1) must be YES, NO, or AUTO)
endif
2008-07-29 03:16:59 +04:00
endif
e n d e f
2010-10-27 22:39:24 +04:00
# ----------------------------------------------------------------------------
# General flag setup
# ----------------------------------------------------------------------------
# Set up the WARNFLAGS here so that they can be overridden in the Makefile.config
WARNFLAGS = -W -Wall -Wundef -Wpointer-arith \
-Wcast-align -Wwrite-strings -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \
2012-12-13 21:36:38 +04:00
-Wnested-externs -Wuninitialized
2012-12-13 23:27:16 +04:00
i f n e q ( $( CC_MAJOR ) , 2 )
2010-10-27 22:39:24 +04:00
WARNFLAGS += -Wno-unused-parameter
e n d i f
2012-12-13 23:27:16 +04:00
# deal with lots of unwanted warnings from javascript
i f e q ( $( call cc_ver_ge ,4,6) , 1 )
WARNFLAGS += -Wno-unused-but-set-variable
e n d i f
2010-10-27 22:39:24 +04:00
# Pull in the configuration
i n c l u d e M a k e f i l e . d e f a u l t s
2014-04-30 14:56:05 +04:00
# Build flags for libjpeg as it has no pkgconfig file
$( eval $ ( call feature_switch ,JPEG ,JPEG ( libjpeg ) ,-DWITH_JPEG ,-ljpeg ,-UWITH_JPEG ,) )
# Build flags for haru
$( eval $ ( call feature_switch ,HARU_PDF ,PDF export ( haru ) ,-DWITH_PDF_EXPORT ,-lhpdf -lpng ,-UWITH_PDF_EXPORT ,) )
2008-07-29 00:56:24 +04:00
2014-04-30 14:56:05 +04:00
# Build flags for iconv
$( eval $ ( call feature_switch ,LIBICONV_PLUG ,glibc internal iconv ,-DLIBICONV_PLUG ,,-ULIBICONV_PLUG ,-liconv ) )
2008-07-29 00:56:24 +04:00
# common libraries without pkg-config support
LDFLAGS += -lz
2012-12-20 19:27:07 +04:00
# add top level and build directory to include search path
CFLAGS += -I. -I$( OBJROOT)
# export the user agent format
2008-07-29 19:10:31 +04:00
CFLAGS += -DNETSURF_UA_FORMAT_STRING= \" $( NETSURF_UA_FORMAT_STRING) \"
2012-12-20 19:27:07 +04:00
# set the default homepage to use
CFLAGS += -DNETSURF_HOMEPAGE= \" $( NETSURF_HOMEPAGE) \"
Merged revisions 5309-5406,5409-5422 via svnmerge from
svn://svn.netsurf-browser.org/branches/vince/netsurf-fb
........
r5309 | vince | 2008-09-13 10:59:10 +0100 (Sat, 13 Sep 2008) | 2 lines
first stab at framebuffer frontend
........
r5313 | vince | 2008-09-14 15:08:52 +0100 (Sun, 14 Sep 2008) | 2 lines
add line plotters
........
r5314 | vince | 2008-09-14 15:28:12 +0100 (Sun, 14 Sep 2008) | 2 lines
add rectangle plot to 16bpp plotters
........
r5315 | vince | 2008-09-14 19:58:57 +0100 (Sun, 14 Sep 2008) | 2 lines
improve 16bpp image plot
........
r5316 | vince | 2008-09-15 00:35:32 +0100 (Mon, 15 Sep 2008) | 2 lines
abstract the os specific framebuffer init
........
r5317 | vince | 2008-09-15 11:18:51 +0100 (Mon, 15 Sep 2008) | 2 lines
first cut of linux frontend
........
r5318 | vince | 2008-09-15 12:01:00 +0100 (Mon, 15 Sep 2008) | 2 lines
remove junk includes
........
r5319 | vince | 2008-09-15 12:09:02 +0100 (Mon, 15 Sep 2008) | 2 lines
make plotters OS agnostic again
........
r5322 | vince | 2008-09-15 15:55:01 +0100 (Mon, 15 Sep 2008) | 2 lines
Linux frontend operates
........
r5323 | vince | 2008-09-15 16:32:47 +0100 (Mon, 15 Sep 2008) | 2 lines
abstract out OS specific input
........
r5326 | vince | 2008-09-15 19:21:01 +0100 (Mon, 15 Sep 2008) | 2 lines
Improve linux mode setting
........
r5329 | vince | 2008-09-15 21:13:33 +0100 (Mon, 15 Sep 2008) | 2 lines
improve text clipping
........
r5339 | vince | 2008-09-16 00:07:57 +0100 (Tue, 16 Sep 2008) | 2 lines
possibly fix text clipping issue
........
r5342 | vince | 2008-09-16 00:39:36 +0100 (Tue, 16 Sep 2008) | 2 lines
consolidate polygon plotters
........
r5344 | dsilvers | 2008-09-16 10:21:06 +0100 (Tue, 16 Sep 2008) | 1 line
Fix up the framebuffer target makefile a bit more, add some config options for it
........
r5345 | dsilvers | 2008-09-16 10:22:19 +0100 (Tue, 16 Sep 2008) | 1 line
Ensure the appropriate frontend is selected when building framebuffer
........
r5346 | dsilvers | 2008-09-16 10:27:16 +0100 (Tue, 16 Sep 2008) | 1 line
Update build system to support targetting separate framebuffer frontends in different build trees, update executable to be nsfb-blah
........
r5350 | vince | 2008-09-16 17:15:04 +0100 (Tue, 16 Sep 2008) | 1 line
Add -g to provide symbols for framebuffer link
........
r5351 | vince | 2008-09-16 17:17:09 +0100 (Tue, 16 Sep 2008) | 1 line
framebuffer scheduler now works, plotters tweaked, gui tracks window redraw requirements better, keypresses not duplicated under linux fb
........
r5352 | dsilvers | 2008-09-16 17:38:53 +0100 (Tue, 16 Sep 2008) | 1 line
Ensure we only allow one fetcher at a time
........
r5361 | vince | 2008-09-17 11:48:44 +0100 (Wed, 17 Sep 2008) | 2 lines
initial cursor support
........
r5362 | vince | 2008-09-17 13:56:47 +0100 (Wed, 17 Sep 2008) | 2 lines
add mouse handling
........
r5363 | vince | 2008-09-17 14:14:44 +0100 (Wed, 17 Sep 2008) | 2 lines
add framebuffer resources
........
r5364 | vince | 2008-09-17 17:12:21 +0100 (Wed, 17 Sep 2008) | 2 lines
add reasonable pointer
........
r5366 | vince | 2008-09-17 17:17:25 +0100 (Wed, 17 Sep 2008) | 2 lines
fix pointer alpha
........
r5370 | vince | 2008-09-18 13:43:53 +0100 (Thu, 18 Sep 2008) | 2 lines
warning squash and cleanup ready for trunk merge
........
r5375 | vince | 2008-09-19 14:58:43 +0100 (Fri, 19 Sep 2008) | 2 lines
Working mouse navigation
........
r5377 | vince | 2008-09-20 14:06:22 +0100 (Sat, 20 Sep 2008) | 2 lines
Improve scrolling
........
r5378 | vince | 2008-09-20 14:46:46 +0100 (Sat, 20 Sep 2008) | 2 lines
fix redraw issues with scrolling
........
r5380 | vince | 2008-09-20 17:08:43 +0100 (Sat, 20 Sep 2008) | 3 lines
Alter panning to use its own flag so it doesnt cause invalid redraw
operations
........
r5381 | vince | 2008-09-20 21:52:45 +0100 (Sat, 20 Sep 2008) | 2 lines
add dummy framebuffer
........
r5383 | vince | 2008-09-21 00:00:15 +0100 (Sun, 21 Sep 2008) | 2 lines
fix segfault when cursor is off teh bottom of teh screen
........
r5384 | vince | 2008-09-21 00:06:08 +0100 (Sun, 21 Sep 2008) | 2 lines
fix off by one in pointer fix
........
r5385 | vince | 2008-09-21 00:25:09 +0100 (Sun, 21 Sep 2008) | 2 lines
when fixing bloody silly off by one errors remember to fix *both* references
........
r5387 | vince | 2008-09-21 00:38:13 +0100 (Sun, 21 Sep 2008) | 2 lines
last try at stopping the pointer segfault
........
r5388 | vince | 2008-09-21 16:24:18 +0100 (Sun, 21 Sep 2008) | 2 lines
improve vertical text clipping
........
r5392 | vince | 2008-09-21 23:11:51 +0100 (Sun, 21 Sep 2008) | 2 lines
Improve text plotters
........
r5393 | vince | 2008-09-21 23:34:38 +0100 (Sun, 21 Sep 2008) | 2 lines
fix 32bpp line plotting
........
r5394 | vince | 2008-09-22 00:00:03 +0100 (Mon, 22 Sep 2008) | 2 lines
Fix off by one error in line plotting clipping
........
r5397 | vince | 2008-09-22 13:46:22 +0100 (Mon, 22 Sep 2008) | 2 lines
Fix bitmap tileing
........
r5398 | vince | 2008-09-22 17:46:02 +0100 (Mon, 22 Sep 2008) | 2 lines
enable knockout renderer
........
r5399 | vince | 2008-09-22 18:43:48 +0100 (Mon, 22 Sep 2008) | 2 lines
ensure clipping region lies within window, caused by knockout renderer
........
r5400 | vince | 2008-09-22 19:20:25 +0100 (Mon, 22 Sep 2008) | 2 lines
update cursor to one swiped from X windows
........
r5405 | vince | 2008-09-23 09:09:05 +0100 (Tue, 23 Sep 2008) | 2 lines
fix vertical scroll limit
........
r5412 | dsilvers | 2008-09-23 10:53:14 +0100 (Tue, 23 Sep 2008) | 1 line
Revert noisy fetcher patch
........
r5413 | dsilvers | 2008-09-23 10:58:00 +0100 (Tue, 23 Sep 2008) | 1 line
Add header guards
........
r5414 | dsilvers | 2008-09-23 11:31:31 +0100 (Tue, 23 Sep 2008) | 1 line
Tidy the region clipping slightly
........
r5416 | dsilvers | 2008-09-23 12:05:00 +0100 (Tue, 23 Sep 2008) | 1 line
Rationalise how the framebuffer frontend finds resources and options
........
r5418 | dsilvers | 2008-09-23 13:59:00 +0100 (Tue, 23 Sep 2008) | 1 line
Ensure options are overridden after load, and squash an fb_gui.c warning
........
r5419 | dsilvers | 2008-09-23 14:20:07 +0100 (Tue, 23 Sep 2008) | 1 line
Support fb_mode and fb_device options
........
r5420 | dsilvers | 2008-09-23 14:21:48 +0100 (Tue, 23 Sep 2008) | 1 line
Support option_fb_device in the able frontend
........
r5421 | dsilvers | 2008-09-23 14:25:17 +0100 (Tue, 23 Sep 2008) | 1 line
Ensure target_blank is disabled
........
r5422 | dsilvers | 2008-09-23 14:39:00 +0100 (Tue, 23 Sep 2008) | 1 line
Rework linux fb frontend to support scanning and opening all event devices for input
........
svn path=/trunk/netsurf/; revision=5423
2008-09-23 18:00:40 +04:00
2008-07-29 00:56:24 +04:00
# ----------------------------------------------------------------------------
# General make rules
# ----------------------------------------------------------------------------
2008-03-22 03:49:56 +03:00
$(OBJROOT)/created :
$( VQ) echo " MKDIR: $( OBJROOT) "
$( Q) $( MKDIR) $( OBJROOT)
$( Q) $( TOUCH) $( OBJROOT) /created
$(DEPROOT)/created : $( OBJROOT ) /created
$( VQ) echo " MKDIR: $( DEPROOT) "
$( Q) $( MKDIR) $( DEPROOT)
$( Q) $( TOUCH) $( DEPROOT) /created
2009-02-26 17:14:29 +03:00
$(TOOLROOT)/created : $( OBJROOT ) /created
$( VQ) echo " MKDIR: $( TOOLROOT) "
$( Q) $( MKDIR) $( TOOLROOT)
$( Q) $( TOUCH) $( TOOLROOT) /created
2011-03-13 14:59:20 +03:00
CLEANS := clean-target clean-testament
2007-12-23 00:15:58 +03:00
2008-12-09 14:12:58 +03:00
POSTEXES :=
2010-10-29 04:54:27 +04:00
# ----------------------------------------------------------------------------
2011-08-28 18:29:15 +04:00
# Target specific setup
2010-10-29 04:54:27 +04:00
# ----------------------------------------------------------------------------
2011-08-28 18:29:15 +04:00
i n c l u d e $( TARGET ) / M a k e f i l e . t a r g e t
2007-12-23 00:15:58 +03:00
2010-10-29 04:54:27 +04:00
# ----------------------------------------------------------------------------
2011-08-28 18:29:15 +04:00
# General source file setup
2010-10-29 04:54:27 +04:00
# ----------------------------------------------------------------------------
2013-03-11 21:50:12 +04:00
# Content sources
i n c l u d e c o n t e n t / M a k e f i l e
# Content fetchers sources
i n c l u d e c o n t e n t / f e t c h e r s / M a k e f i l e
# CSS sources
i n c l u d e c s s / M a k e f i l e
# render sources
i n c l u d e r e n d e r / M a k e f i l e
# utility sources
i n c l u d e u t i l s / M a k e f i l e
# http utility sources
i n c l u d e u t i l s / h t t p / M a k e f i l e
# Desktop sources
i n c l u d e d e s k t o p / M a k e f i l e
# Javascript source
i n c l u d e j a v a s c r i p t / M a k e f i l e
# Image content handler sources
i n c l u d e i m a g e / M a k e f i l e
# PDF saving sources
i n c l u d e d e s k t o p / s a v e _ p d f / M a k e f i l e
# S_COMMON are sources common to all builds
S_COMMON := $( S_CONTENT) $( S_FETCHERS) $( S_CSS) $( S_RENDER) $( S_UTILS) \
$( S_HTTP) $( S_DESKTOP) $( S_JAVASCRIPT)
2010-10-29 04:54:27 +04:00
# ----------------------------------------------------------------------------
# Source file setup
# ----------------------------------------------------------------------------
2011-08-28 18:29:15 +04:00
# Force exapnsion of source file list
SOURCES := $( SOURCES)
2010-10-29 04:54:27 +04:00
i f e q ( $( SOURCES ) , )
$( error Unable to build NetSurf , could not determine set of sources to build )
e n d i f
2011-01-19 04:36:21 +03:00
OBJECTS := $( sort $( addprefix $( OBJROOT) /,$( subst /,_,$( patsubst %.c,%.o,$( patsubst %.cpp,%.o,$( patsubst %.m,%.o,$( patsubst %.s,%.o,$( SOURCES) ) ) ) ) ) ) )
2007-12-23 00:15:58 +03:00
2008-06-04 00:13:34 +04:00
$(EXETARGET) : $( OBJECTS ) $( RESOURCES )
2007-12-23 00:15:58 +03:00
$( VQ) echo " LINK: $( EXETARGET) "
2009-03-28 03:59:11 +03:00
i f n e q ( $( TARGET ) $( SUBTARGET ) , r i s c o s - e l f )
2008-03-20 16:21:53 +03:00
$( Q) $( CC) -o $( EXETARGET) $( OBJECTS) $( LDFLAGS)
2009-03-28 03:59:11 +03:00
e l s e
2012-12-10 15:38:52 +04:00
$( Q) $( CXX) -o $( EXETARGET:,ff8= ,e1f) $( OBJECTS) $( LDFLAGS)
2009-03-28 03:59:11 +03:00
$( Q) $( ELF2AIF) $( EXETARGET:,ff8= ,e1f) $( EXETARGET)
$( Q) $( RM) $( EXETARGET:,ff8= ,e1f)
e n d i f
2010-01-31 03:36:02 +03:00
i f e q ( $( TARGET ) , w i n d o w s )
$( Q) $( TOUCH) windows/res/preferences
e n d i f
2009-12-18 02:55:02 +03:00
i f e q ( $( TARGET ) , g t k )
$( Q) $( TOUCH) gtk/res/toolbarIndices
e n d i f
2008-07-29 12:57:51 +04:00
i f e q ( $( NETSURF_STRIP_BINARY ) , Y E S )
$( VQ) echo " STRIP: $( EXETARGET) "
$( Q) $( STRIP) $( EXETARGET)
e n d i f
2008-06-04 00:13:34 +04:00
i f e q ( $( TARGET ) , b e o s )
$( VQ) echo " XRES: $( EXETARGET) "
$( Q) $( BEOS_XRES) -o $( EXETARGET) $( RSRC_BEOS)
$( VQ) echo " SETVER: $( EXETARGET) "
$( Q) $( BEOS_SETVER) $( EXETARGET) \
-app $( VERSION_MAJ) $( VERSION_MIN) 0 d 0 \
-short " NetSurf $( VERSION_FULL) " \
2013-03-22 01:55:08 +04:00
-long " NetSurf $( VERSION_FULL) © 2003 - 2013 The NetSurf Developers "
2008-06-04 00:13:34 +04:00
$( VQ) echo " MIMESET: $( EXETARGET) "
$( Q) $( BEOS_MIMESET) $( EXETARGET)
e n d i f
i f e q ( $( TARGET ) , b e o s )
2011-05-08 05:03:44 +04:00
$(RDEF_IMP_BEOS) : $( RDEP_BEOS )
$( VQ) echo " GEN: $@ "
$( Q) n = 5000; for f in $^; do echo " resource( $$ n,\" $$ {f#beos/res/}\") #'data' import \" $$ {f#beos/}\"; " ; n = $$ ( ( $$ n+1) ) ; done > $@
$(RSRC_BEOS) : $( RDEF_BEOS ) $( RDEF_IMP_BEOS )
2008-06-06 02:54:49 +04:00
$( VQ) echo " RC: $< "
2011-05-08 05:03:44 +04:00
$( Q) $( BEOS_RC) -I beos -o $@ $^
2008-06-04 00:13:34 +04:00
e n d i f
2007-12-23 00:15:58 +03:00
2008-08-07 01:46:53 +04:00
i f e q ( $( TARGET ) , r i s c o s )
# Native RO build is different as 1) it can't do piping and 2) ccres on
# RO does not understand Unix filespec
ifeq ( $( HOST) ,riscos)
define compile_template
!NetSurf/Resources/$(1)/Templates$$(TPLEXT) : $( 2)
$$ ( VQ) echo " TEMPLATE: $( 2) "
2008-12-09 14:12:58 +03:00
$$ ( Q) $$ ( CC) -x c -E -P $$ ( CFLAGS) -o processed_template $( 2)
2008-08-07 01:46:53 +04:00
$$ ( Q) $$ ( CCRES) processed_template $$ ( subst /,.,$$ @)
$$ ( Q) $( RM) processed_template
CLEAN_TEMPLATES += !NetSurf/Resources/$( 1) /Templates$$ ( TPLEXT)
endef
else
define compile_template
!NetSurf/Resources/$(1)/Templates$$(TPLEXT) : $( 2)
$$ ( VQ) echo " TEMPLATE: $( 2) "
2012-11-06 18:56:30 +04:00
$$ ( Q) mkdir -p !NetSurf/Resources/$( 1)
2008-08-07 01:46:53 +04:00
$$ ( Q) $$ ( CC) -x c -E -P $$ ( CFLAGS) $( 2) | $$ ( CCRES) - $$ @
CLEAN_TEMPLATES += !NetSurf/Resources/$( 1) /Templates$$ ( TPLEXT)
endef
endif
clean-templates :
$( VQ) echo " CLEAN: $( CLEAN_TEMPLATES) "
$( Q) $( RM) $( CLEAN_TEMPLATES)
CLEANS += clean-templates
$( eval $ ( foreach TPL ,$ ( TPL_RISCOS ) , \
$( call compile_template,$( notdir $( TPL) ) ,$( TPL) ) ) )
e n d i f
2007-12-23 00:15:58 +03:00
clean-target :
$( VQ) echo " CLEAN: $( EXETARGET) "
$( Q) $( RM) $( EXETARGET)
2013-04-29 01:09:03 +04:00
$( call clean_install_messages, !NetSurf/Resources)
2007-12-23 00:15:58 +03:00
2011-03-13 14:59:20 +03:00
clean-testament :
2014-04-08 14:40:16 +04:00
$( VQ) echo " CLEAN: testament.h"
$( Q) $( RM) $( OBJROOT) /testament.h
2011-03-13 14:59:20 +03:00
2007-12-23 00:15:58 +03:00
clean-builddir :
$( VQ) echo " CLEAN: $( OBJROOT) "
$( Q) $( RM) -r $( OBJROOT)
CLEANS += clean-builddir
2008-12-09 14:12:58 +03:00
all-program : $( EXETARGET ) post -exe
2013-05-01 14:41:25 +04:00
$( call split_install_messages, any, !NetSurf/Resources)
2008-12-09 14:12:58 +03:00
2011-03-13 14:59:20 +03:00
.PHONY : testament
2014-04-08 14:40:16 +04:00
testament $(OBJROOT)/testament.h :
$( Q) $( PERL) utils/git-testament.pl $( CURDIR) $( OBJROOT) /testament.h
2011-03-13 14:59:20 +03:00
2008-12-09 14:12:58 +03:00
post-exe : $( POSTEXES )
2007-12-23 00:15:58 +03:00
.SUFFIXES :
DEPFILES :=
# Now some macros which build the make system
# 1 = Source file
# 2 = dep filename, no prefix
# 3 = obj filename, no prefix
2008-06-04 00:13:34 +04:00
d e f i n e d e p e n d e n c y _ g e n e r a t e _ c
DEPFILES += $( 2)
2009-07-24 03:05:34 +04:00
$$ (DEPROOT)/$(2) : $$( DEPROOT ) /created $( 1) Makefile .config
2008-06-04 00:13:34 +04:00
e n d e f
2007-12-23 00:15:58 +03:00
# 1 = Source file
# 2 = dep filename, no prefix
# 3 = obj filename, no prefix
d e f i n e d e p e n d e n c y _ g e n e r a t e _ s
DEPFILES += $( 2)
$$ (DEPROOT)/$(2) : $$( DEPROOT ) /created $( 1)
e n d e f
# 1 = Source file
# 2 = obj filename, no prefix
# 3 = dep filename, no prefix
2012-12-14 15:30:14 +04:00
i f e q ( $( CC_MAJOR ) , 2 )
2009-03-30 03:32:02 +04:00
# simpler deps tracking for gcc2...
2009-03-22 02:20:15 +03:00
d e f i n e c o m p i l e _ t a r g e t _ c
2009-03-30 03:32:02 +04:00
$$ (DEPROOT)/$(3) $$(OBJROOT)/$(2) : $$( OBJROOT ) /created
$$ ( VQ) echo " DEP: $( 1) "
$$ ( Q) $$ ( RM) $$ ( DEPROOT) /$( 3)
$$ ( Q) $$ ( CC) $$ ( CFLAGS) -MM \
$( 1) | sed 's,^.*:,$$(DEPROOT)/$(3) $$(OBJROOT)/$(2):,' \
> $$ ( DEPROOT) /$( 3)
2009-03-22 02:20:15 +03:00
$$ ( VQ) echo " COMPILE: $( 1) "
2011-03-12 20:13:42 +03:00
$$ ( Q) $$ ( RM) $$ ( OBJROOT) /$( 2)
2009-03-30 03:32:02 +04:00
$$ ( Q) $$ ( CC) $$ ( CFLAGS) -o $$ ( OBJROOT) /$( 2) -c $( 1)
2009-03-22 02:20:15 +03:00
e n d e f
e l s e
2007-12-23 00:15:58 +03:00
d e f i n e c o m p i l e _ t a r g e t _ c
2009-02-26 14:08:07 +03:00
$$ (DEPROOT)/$(3) $$(OBJROOT)/$(2) : $$( OBJROOT ) /created
2007-12-23 00:15:58 +03:00
$$ ( VQ) echo " COMPILE: $( 1) "
2009-02-26 14:08:07 +03:00
$$ ( Q) $$ ( RM) $$ ( DEPROOT) /$( 3)
2011-03-12 20:13:42 +03:00
$$ ( Q) $$ ( RM) $$ ( OBJROOT) /$( 2)
2009-02-26 14:08:07 +03:00
$$ ( Q) $$ ( CC) $$ ( CFLAGS) -MMD -MT '$$(DEPROOT)/$(3) $$(OBJROOT)/$(2)' \
-MF $$ ( DEPROOT) /$( 3) -o $$ ( OBJROOT) /$( 2) -c $( 1)
2007-12-23 00:15:58 +03:00
e n d e f
2009-03-22 02:20:15 +03:00
e n d i f
2007-12-23 00:15:58 +03:00
2008-06-04 00:13:34 +04:00
d e f i n e c o m p i l e _ t a r g e t _ c p p
2009-03-30 03:32:02 +04:00
$$ (DEPROOT)/$(3) $$(OBJROOT)/$(2) : $$( OBJROOT ) /created
$$ ( VQ) echo " DEP: $( 1) "
$$ ( Q) $$ ( RM) $$ ( DEPROOT) /$( 3)
$$ ( Q) $$ ( CC) $$ ( CFLAGS) -MM \
$( 1) | sed 's,^.*:,$$(DEPROOT)/$(3) $$(OBJROOT)/$(2):,' \
> $$ ( DEPROOT) /$( 3)
2008-06-04 00:13:34 +04:00
$$ ( VQ) echo " COMPILE: $( 1) "
2011-03-12 20:13:42 +03:00
$$ ( Q) $$ ( RM) $$ ( OBJROOT) /$( 2)
2009-03-30 20:28:07 +04:00
$$ ( Q) $$ ( CXX) $$ ( CFLAGS) -o $$ ( OBJROOT) /$( 2) -c $( 1)
2008-06-04 00:13:34 +04:00
e n d e f
2007-12-23 00:15:58 +03:00
# 1 = Source file
# 2 = obj filename, no prefix
# 3 = dep filename, no prefix
d e f i n e c o m p i l e _ t a r g e t _ s
2009-03-30 03:32:02 +04:00
$$ (DEPROOT)/$(3) $$(OBJROOT)/$(2) : $$( OBJROOT ) /created
2008-07-30 00:55:26 +04:00
$$ ( VQ) echo " ASSEMBLE: $( 1) "
2009-02-26 14:08:07 +03:00
$$ ( Q) $$ ( RM) $$ ( DEPROOT) /$( 3)
2011-03-12 20:13:42 +03:00
$$ ( Q) $$ ( RM) $$ ( OBJROOT) /$( 2)
2009-02-26 14:08:07 +03:00
$$ ( Q) $$ ( CC) $$ ( ASFLAGS) -MMD -MT '$$(DEPROOT)/$(3) $$(OBJROOT)/$(2)' \
-MF $$ ( DEPROOT) /$( 3) -o $$ ( OBJROOT) /$( 2) -c $( 1)
2007-12-23 00:15:58 +03:00
e n d e f
# Rules to construct dep lines for each object...
$( eval $ ( foreach SOURCE ,$ ( filter %.c ,$ ( SOURCES ) ) , \
$( call dependency_generate_c,$( SOURCE) ,$( subst /,_,$( SOURCE:.c= .d) ) ,$( subst /,_,$( SOURCE:.c= .o) ) ) ) )
2008-06-04 00:13:34 +04:00
$( eval $ ( foreach SOURCE ,$ ( filter %.cpp ,$ ( SOURCES ) ) , \
$( call dependency_generate_c,$( SOURCE) ,$( subst /,_,$( SOURCE:.cpp= .d) ) ,$( subst /,_,$( SOURCE:.cpp= .o) ) ) ) )
2011-01-19 04:36:21 +03:00
$( eval $ ( foreach SOURCE ,$ ( filter %.m ,$ ( SOURCES ) ) , \
$( call dependency_generate_c,$( SOURCE) ,$( subst /,_,$( SOURCE:.m= .d) ) ,$( subst /,_,$( SOURCE:.m= .o) ) ) ) )
2007-12-23 00:15:58 +03:00
# Cannot currently generate dep files for S files because they're objasm
# when we move to gas format, we will be able to.
#$(eval $(foreach SOURCE,$(filter %.s,$(SOURCES)), \
# $(call dependency_generate_s,$(SOURCE),$(subst /,_,$(SOURCE:.s=.d)),$(subst /,_,$(SOURCE:.s=.o)))))
i f n e q ( $( MAKECMDGOALS ) , c l e a n )
2008-03-05 15:30:29 +03:00
- i n c l u d e $( sort $ ( addprefix $ ( DEPROOT ) /,$ ( DEPFILES ) ) )
2012-11-04 20:57:41 +04:00
- i n c l u d e $( D_JSAPI_BINDING )
2007-12-23 00:15:58 +03:00
e n d i f
# And rules to build the objects themselves...
$( eval $ ( foreach SOURCE ,$ ( filter %.c ,$ ( SOURCES ) ) , \
$( call compile_target_c,$( SOURCE) ,$( subst /,_,$( SOURCE:.c= .o) ) ,$( subst /,_,$( SOURCE:.c= .d) ) ) ) )
2008-06-04 00:13:34 +04:00
$( eval $ ( foreach SOURCE ,$ ( filter %.cpp ,$ ( SOURCES ) ) , \
$( call compile_target_cpp,$( SOURCE) ,$( subst /,_,$( SOURCE:.cpp= .o) ) ,$( subst /,_,$( SOURCE:.cpp= .d) ) ) ) )
2011-01-19 04:36:21 +03:00
$( eval $ ( foreach SOURCE ,$ ( filter %.m ,$ ( SOURCES ) ) , \
$( call compile_target_c,$( SOURCE) ,$( subst /,_,$( SOURCE:.m= .o) ) ,$( subst /,_,$( SOURCE:.m= .d) ) ) ) )
2007-12-23 00:15:58 +03:00
$( eval $ ( foreach SOURCE ,$ ( filter %.s ,$ ( SOURCES ) ) , \
$( call compile_target_s,$( SOURCE) ,$( subst /,_,$( SOURCE:.s= .o) ) ,$( subst /,_,$( SOURCE:.s= .d) ) ) ) )
2012-08-23 14:46:31 +04:00
.PHONY : all clean docs install package -$( TARGET ) package install -$( TARGET )
2007-12-23 00:15:58 +03:00
clean : $( CLEANS )
2008-03-09 20:06:45 +03:00
2012-08-23 14:46:31 +04:00
# Target builds a distribution package
package : all -program package -$( TARGET )
2009-04-17 19:25:02 +04:00
2012-11-03 15:16:33 +04:00
FAT_LANGUAGES = de en fr it nl
# 1 = front end name (gtk, ro, ami, etc)
# 2 = Destination directory (where resources being installed, creates en/Messages etc)
2012-11-03 18:31:54 +04:00
# 3 = suffix after language name
2012-11-03 15:16:33 +04:00
d e f i n e s p l i t _ i n s t a l l _ m e s s a g e s
$( foreach LANG, $( FAT_LANGUAGES) , @echo MSGSPLIT: $( 1) /$( LANG) to $( 2)
2012-11-03 18:31:54 +04:00
$( Q) mkdir -p $( 2) /$( LANG) $( 3)
2013-05-02 12:24:18 +04:00
$( Q) $( SPLIT_MESSAGES) -l $( LANG) -p $( 1) -f messages resources/FatMessages | gzip -9n > $( 2) $( 3) /$( LANG) /Messages
2012-11-03 15:16:33 +04:00
)
e n d e f
2013-04-29 01:09:03 +04:00
# Clean Message target
# 1 = Destination directory (where resources being installed, creates en/Messages etc)
# 2 = suffix after language name
d e f i n e c l e a n _ i n s t a l l _ m e s s a g e s
$( foreach LANG, $( FAT_LANGUAGES) , @echo MSGCLEAN: $( LANG) in $( 1)
$( Q) $( RM) -f $( 1) $( 2) /$( LANG) /Messages
)
e n d e f
2013-05-08 01:52:30 +04:00
.PHONY : messages -split -tfx messages -fetch -tfx messages -import -tfx
# split fat messages into properties files suitable for uploading to transifex
messages-split-tfx :
for splitlang in $( FAT_LANGUAGES) ; do perl ./utils/split-messages.pl -l $$ { splitlang} -f transifex -p any -o Messages.any.$$ { splitlang} .tfx resources/FatMessages; done
# download property files from transifex
messages-fetch-tfx :
for splitlang in $( FAT_LANGUAGES) ; do $( RM) Messages.any.$$ { splitlang} .tfx ; perl ./utils/fetch-transifex.pl -w insecure -l $$ { splitlang} -o Messages.any.$$ { splitlang} .tfx ; done
# merge property files into fat messages
messages-import-tfx : messages -fetch -tfx
for tfxlang in $( FAT_LANGUAGES) ; do perl ./utils/import-messages.pl -l $$ { tfxlang} -p any -f transifex -o resources/FatMessages -i resources/FatMessages -I Messages.any.$$ { tfxlang} .tfx ; $( RM) Messages.any.$$ { tfxlang} .tfx; done
2013-04-29 01:09:03 +04:00
2012-08-23 14:46:31 +04:00
# Target installs executable on the host system
2008-07-27 02:53:13 +04:00
install : all -program install -$( TARGET )
2008-03-09 20:06:45 +03:00
docs :
doxygen Docs/Doxyfile