Add TARGET=debug and fix the debug build.

svn path=/trunk/netsurf/; revision=4202
This commit is contained in:
James Bursa 2008-05-25 23:28:06 +00:00
parent 70da04d69e
commit b53f36ebc2
4 changed files with 28 additions and 4 deletions

View File

@ -61,7 +61,9 @@ SUBTARGET =
ifneq ($(TARGET),riscos)
ifneq ($(TARGET),gtk)
$(error Unknown TARGET "$(TARGET)", should either be "riscos" or "gtk")
ifneq ($(TARGET),debug)
$(error Unknown TARGET "$(TARGET)", should either be "riscos", "gtk", or "debug")
endif
endif
endif
@ -95,7 +97,7 @@ endif
PKG_CONFIG := $(GCCSDK_INSTALL_ENV)/ro-pkg-config
endif
else
# Building for GTK
# Building for GTK or debug
PKG_CONFIG := pkg-config
endif
@ -151,7 +153,7 @@ ifeq ($(HOST),riscos)
CFLAGS += -I<OSLib$$Dir> -mthrowback
endif
ASFLAGS += -xassembler-with-cpp -I. -I$(GCCSDK_INSTALL_ENV)/include
LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib -lcares -lrufl -lpencil \
LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib -lrufl -lpencil \
-lsvgtiny
ifeq ($(HOST),riscos)
LDFLAGS += -LOSLib: -lOSLib32
@ -166,6 +168,18 @@ endif
endif
endif
ifeq ($(TARGET),debug)
CFLAGS += -std=c99 \
-D_BSD_SOURCE \
-D_XOPEN_SOURCE=600 \
-D_POSIX_C_SOURCE=200112L \
-D_NETBSD_SOURCE \
$(WARNFLAGS) -I. -I../../libsprite/trunk/ -g -O \
$(shell $(PKG_CONFIG) --cflags librosprite) \
$(shell xml2-config --cflags)
LDFLAGS += $(shell $(PKG_CONFIG) --libs librosprite)
endif
$(OBJROOT)/created:
$(VQ)echo " MKDIR: $(OBJROOT)"
$(Q)$(MKDIR) $(OBJROOT)

View File

@ -57,6 +57,9 @@ S_GTK := font_pango.c gtk_bitmap.c gtk_gui.c gtk_schedule.c \
gtk_history.c gtk_window.c gtk_filetype.c gtk_download.c
S_GTK := $(addprefix gtk/,$(S_GTK))
# S_DEBUG are sources purely for the debug build
S_DEBUG := netsurfd.c debug_bitmap.c filetyped.c fontd.c
S_DEBUG := $(addprefix debug/,$(S_DEBUG))
# Some extra rules for building the scanner etc.
css/css_enum.c css/css_enum.h: css/css_enums css/makeenum
@ -114,6 +117,11 @@ SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_GTK)
EXETARGET := nsgtk
endif
ifeq ($(TARGET),debug)
SOURCES := $(S_COMMON) $(S_IMAGE) $(S_DEBUG)
EXETARGET := nsdebug
endif
ifeq ($(SOURCES),)
$(error Unable to build NetSurf, could not determine set of sources to build)
endif

View File

@ -119,7 +119,7 @@ bool bitmap_redraw(struct content *c, int x, int y,
* \return true on success, false on error and error reported
*/
bool bitmap_save(struct bitmap *bitmap, const char *path)
bool bitmap_save(struct bitmap *bitmap, const char *path, unsigned flags)
{
return true;
}

View File

@ -43,6 +43,8 @@ const char *fetch_filetype(const char *unix_path)
return "image/png";
if (2 < l && strcasecmp(unix_path + l - 3, "jng") == 0)
return "image/jng";
if (2 < l && strcasecmp(unix_path + l - 3, "svg") == 0)
return "image/svg";
return "text/html";
}