Allow include directories to be added by sub makefiles

This commit is contained in:
Vincent Sanders 2016-06-06 14:47:27 +01:00
parent cba3a1468c
commit 8861923455
38 changed files with 72 additions and 66 deletions

View File

@ -538,9 +538,8 @@ $(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add_enabled,NSSVG,libsvgtiny,SVG))
$(eval $(call pkg_config_find_and_add_enabled,ROSPRITE,librosprite,Sprite))
# add top level and build directory to include search path
CFLAGS += -I. -Iinclude -Ifrontends -I$(OBJROOT)
CXXFLAGS += -I. -Iinclude -Ifrontends -I$(OBJROOT)
# List of directories in which headers are searched for
INCLUDE_DIRS :=. include $(OBJROOT)
# export the user agent format
CFLAGS += -DNETSURF_UA_FORMAT_STRING=\"$(NETSURF_UA_FORMAT_STRING)\"
@ -605,6 +604,9 @@ S_COMMON := $(S_CONTENT) $(S_FETCHERS) $(S_CSS) $(S_RENDER) $(S_UTILS) \
$(S_HTTP) $(S_DESKTOP) $(S_JAVASCRIPT)
# Include directory flags
IFLAGS = $(addprefix -I,$(INCLUDE_DIRS))
# ----------------------------------------------------------------------------
# Message targets
# ----------------------------------------------------------------------------
@ -735,12 +737,12 @@ define compile_target_c
$$(DEPROOT)/$(3) $$(OBJROOT)/$(2): $$(OBJROOT)/created
$$(VQ)echo " DEP: $(1)"
$$(Q)$$(RM) $$(DEPROOT)/$(3)
$$(Q)$$(CC) $$(CFLAGS) -MM \
$$(Q)$$(CC) $$(IFLAGS) $$(CFLAGS) -MM \
$(1) | sed 's,^.*:,$$(DEPROOT)/$(3) $$(OBJROOT)/$(2):,' \
> $$(DEPROOT)/$(3)
$$(VQ)echo " COMPILE: $(1)"
$$(Q)$$(RM) $$(OBJROOT)/$(2)
$$(Q)$$(CC) $$(COMMON_WARNFLAGS) $$(CWARNFLAGS) $$(CFLAGS) $(CFLAGS_ENV) -o $$(OBJROOT)/$(2) -c $(1)
$$(Q)$$(CC) $$(COMMON_WARNFLAGS) $$(CWARNFLAGS) $$(IFLAGS) $$(CFLAGS) $(CFLAGS_ENV) -o $$(OBJROOT)/$(2) -c $(1)
endef
else
@ -749,7 +751,7 @@ $$(DEPROOT)/$(3) $$(OBJROOT)/$(2): $$(OBJROOT)/created
$$(VQ)echo " COMPILE: $(1)"
$$(Q)$$(RM) $$(DEPROOT)/$(3)
$$(Q)$$(RM) $$(OBJROOT)/$(2)
$$(Q)$$(CC) $$(COMMON_WARNFLAGS) $$(CWARNFLAGS) $$(CFLAGS) $(CFLAGS_ENV) \
$$(Q)$$(CC) $$(COMMON_WARNFLAGS) $$(CWARNFLAGS) $$(IFLAGS) $$(CFLAGS) $(CFLAGS_ENV) \
-MMD -MT '$$(DEPROOT)/$(3) $$(OBJROOT)/$(2)' \
-MF $$(DEPROOT)/$(3) -o $$(OBJROOT)/$(2) -c $(1)
@ -760,12 +762,12 @@ define compile_target_cpp
$$(DEPROOT)/$(3) $$(OBJROOT)/$(2): $$(OBJROOT)/created
$$(VQ)echo " DEP: $(1)"
$$(Q)$$(RM) $$(DEPROOT)/$(3)
$$(Q)$$(CC) $$(CFLAGS) $$(COMMON_WARNFLAGS) $$(CXXWARNFLAGS) -MM \
$$(Q)$$(CC) $$(IFLAGS) $$(CXXFLAGS) $$(COMMON_WARNFLAGS) $$(CXXWARNFLAGS) -MM \
$(1) | sed 's,^.*:,$$(DEPROOT)/$(3) $$(OBJROOT)/$(2):,' \
> $$(DEPROOT)/$(3)
$$(VQ)echo " COMPILE: $(1)"
$$(Q)$$(RM) $$(OBJROOT)/$(2)
$$(Q)$$(CXX) $$(COMMON_WARNFLAGS) $$(CXXWARNFLAGS) $$(CXXFLAGS) $(CXXFLAGS_ENV) -o $$(OBJROOT)/$(2) -c $(1)
$$(Q)$$(CXX) $$(COMMON_WARNFLAGS) $$(CXXWARNFLAGS) $$(IFLAGS) $$(CXXFLAGS) $(CXXFLAGS_ENV) -o $$(OBJROOT)/$(2) -c $(1)
endef

View File

@ -40,7 +40,7 @@
#include "content/fetch.h"
#include "content/fetchers.h"
#include "content/fetchers/about.h"
#include "content/handlers/image/image_cache.h"
#include "image/image_cache.h"
struct fetch_about_context;

View File

@ -7,3 +7,5 @@ S_IMAGE := $(addprefix content/handlers/image/,$(S_IMAGE))
include content/handlers/css/Makefile
S_CSS := $(addprefix content/handlers/css/,$(S_CSS))
INCLUDE_DIRS += content/handlers

View File

@ -30,9 +30,9 @@
#include "utils/log.h"
#include "utils/messages.h"
#include "css.h"
#include "hints.h"
#include "internal.h"
#include "css/css.h"
#include "css/hints.h"
#include "css/internal.h"
/* Define to trace import fetches */
#undef NSCSS_IMPORT_TRACE

View File

@ -19,7 +19,7 @@
#include <stdio.h>
#include <libcss/libcss.h>
#include "dump.h"
#include "css/dump.h"
/**
* Dump a fixed point value to the stream in a textual form.

View File

@ -25,8 +25,8 @@
#include "utils/nsurl.h"
#include "utils/utils.h"
#include "hints.h"
#include "select.h"
#include "css/hints.h"
#include "css/select.h"
#define LOG_STATS
#undef LOG_STATS

View File

@ -21,7 +21,7 @@
#include "utils/nsurl.h"
#include "internal.h"
#include "css/internal.h"
/* exported interface documented in content/handlers/css/internal.h */
css_error nscss_resolve_url(void *pw, const char *base,

View File

@ -20,15 +20,15 @@
#include <string.h>
#include <strings.h>
#include "content/urldb.h"
#include "desktop/system_colour.h"
#include "utils/nsoption.h"
#include "utils/corestrings.h"
#include "utils/log.h"
#include "content/urldb.h"
#include "desktop/system_colour.h"
#include "internal.h"
#include "hints.h"
#include "select.h"
#include "css/internal.h"
#include "css/hints.h"
#include "css/select.h"
static css_error node_name(void *pw, void *node, css_qname *qname);
static css_error node_classes(void *pw, void *node,

View File

@ -22,7 +22,7 @@
#include "utils/nsoption.h"
#include "utils/log.h"
#include "utils.h"
#include "css/utils.h"
/** Screen DPI in fixed point units: defaults to 90, which RISC OS uses */
css_fixed nscss_screen_dpi = F_90;

View File

@ -35,7 +35,7 @@
#include "content/content_protected.h"
#include "desktop/gui_internal.h"
#include "bmp.h"
#include "image/bmp.h"
/** bmp context. */
typedef struct nsbmp_content {

View File

@ -46,8 +46,8 @@
#include "content/content_protected.h"
#include "desktop/gui_internal.h"
#include "image.h"
#include "gif.h"
#include "image/image.h"
#include "image/gif.h"
typedef struct nsgif_content {
struct content base;

View File

@ -33,8 +33,8 @@
#include "content/content_protected.h"
#include "desktop/gui_internal.h"
#include "image.h"
#include "ico.h"
#include "image/image.h"
#include "image/ico.h"
typedef struct nsico_content {
struct content base;

View File

@ -27,15 +27,15 @@
#include "netsurf/content.h"
#include "desktop/gui_internal.h"
#include "bmp.h"
#include "gif.h"
#include "ico.h"
#include "jpeg.h"
#include "nssprite.h"
#include "png.h"
#include "rsvg.h"
#include "svg.h"
#include "image.h"
#include "image/bmp.h"
#include "image/gif.h"
#include "image/ico.h"
#include "image/jpeg.h"
#include "image/nssprite.h"
#include "image/png.h"
#include "image/rsvg.h"
#include "image/svg.h"
#include "image/image.h"
/**
* Initialise image content handlers

View File

@ -31,8 +31,8 @@
#include "content/content_protected.h"
#include "desktop/gui_internal.h"
#include "image_cache.h"
#include "image.h"
#include "image/image_cache.h"
#include "image/image.h"
/** Age of an entry within the cache
*

View File

@ -35,7 +35,7 @@
#include "content/content_protected.h"
#include "desktop/gui_internal.h"
#include "image_cache.h"
#include "image/image_cache.h"
#define JPEG_INTERNAL_OPTIONS
#include "jpeglib.h"

View File

@ -35,7 +35,7 @@
#include "content/content_protected.h"
#include "desktop/gui_internal.h"
#include "nssprite.h"
#include "image/nssprite.h"
typedef struct nssprite_content {
struct content base;

View File

@ -30,8 +30,8 @@
#include "content/content_protected.h"
#include "desktop/gui_internal.h"
#include "image_cache.h"
#include "png.h"
#include "image/image_cache.h"
#include "image/png.h"
/* accommodate for old versions of libpng (beware security holes!) */

View File

@ -48,7 +48,7 @@
#include "content/content_protected.h"
#include "desktop/gui_internal.h"
#include "rsvg.h"
#include "image/rsvg.h"
typedef struct rsvg_content {
struct content base;

View File

@ -33,7 +33,7 @@
#include "netsurf/content.h"
#include "content/content_protected.h"
#include "svg.h"
#include "image/svg.h"
typedef struct svg_content {
struct content base;

View File

@ -21,7 +21,7 @@
#include "content/content_factory.h"
#include "content/content_protected.h"
#include "video.h"
#include "image/video.h"
typedef struct nsvideo_content {
struct content base;

View File

@ -55,7 +55,7 @@
#include "content/fetch.h"
#include "content/hlcache.h"
#include "content/urldb.h"
#include "content/handlers/css/utils.h"
#include "css/utils.h"
#include "render/form_internal.h"
#include "render/html.h"
#include "render/box.h"

View File

@ -37,9 +37,9 @@
#include "content/hlcache.h"
#include "content/mimesniff.h"
#include "content/urldb.h"
#include "content/handlers/css/css.h"
#include "content/handlers/image/image.h"
#include "content/handlers/image/image_cache.h"
#include "css/css.h"
#include "image/image.h"
#include "image/image_cache.h"
#include "javascript/js.h"
#include "render/html.h"
#include "render/textplain.h"

View File

@ -33,7 +33,7 @@
#include "netsurf/content.h"
#include "netsurf/plotters.h"
#include "content/hlcache.h"
#include "content/handlers/css/utils.h"
#include "css/utils.h"
#include "render/box.h"
#include "desktop/print.h"

View File

@ -42,7 +42,7 @@
#include "utils/messages.h"
#include "netsurf/content.h"
#include "content/hlcache.h"
#include "content/handlers/css/css.h"
#include "css/css.h"
#include "render/box.h"
#include "render/html.h"

View File

@ -29,7 +29,7 @@
#include "utils/log.h"
#include "utils/utf8.h"
#include "utils/utils.h"
#include "content/handlers/css/utils.h"
#include "css/utils.h"
#include "netsurf/browser_window.h"
#include "netsurf/mouse.h"

View File

@ -27,7 +27,7 @@
#include "netsurf/bitmap.h"
#include "netsurf/content.h"
#include "content/hlcache.h"
#include "content/handlers/css/utils.h"
#include "css/utils.h"
#include "desktop/system_colour.h"
#include "desktop/knockout.h"

View File

@ -7,3 +7,5 @@ FRONTEND_RESOURCES_DIR := frontends/$(TARGET)/res
include frontends/$(TARGET)/Makefile
S_FRONTEND := $(addprefix frontends/$(TARGET)/,$(S_FRONTEND))
INCLUDE_DIRS += frontends

View File

@ -36,8 +36,8 @@
#include "netsurf/misc.h"
#include "netsurf/content.h"
#include "netsurf/mouse.h"
#include "content/handlers/css/utils.h"
#include "content/handlers/css/dump.h"
#include "css/utils.h"
#include "css/dump.h"
#include "desktop/scrollbar.h"
#include "desktop/gui_internal.h"

View File

@ -43,8 +43,8 @@
#include "utils/utils.h"
#include "utils/string.h"
#include "content/content_protected.h"
#include "content/handlers/css/hints.h"
#include "content/handlers/css/select.h"
#include "css/hints.h"
#include "css/select.h"
#include "netsurf/css.h"
#include "netsurf/misc.h"
#include "desktop/gui_internal.h"

View File

@ -29,7 +29,7 @@
#include "utils/log.h"
#include "utils/errors.h"
#include "content/handlers/css/select.h"
#include "css/select.h"
#include "render/box.h"
#include "render/html_internal.h"

View File

@ -23,7 +23,7 @@
*/
#include "utils/nsoption.h"
#include "content/handlers/css/utils.h"
#include "css/utils.h"
#include "render/font.h"

View File

@ -42,7 +42,7 @@
#include "utils/utils.h"
#include "content/fetch.h"
#include "content/hlcache.h"
#include "content/handlers/css/utils.h"
#include "css/utils.h"
#include "netsurf/browser_window.h"
#include "netsurf/mouse.h"
#include "desktop/knockout.h"

View File

@ -34,7 +34,7 @@
#include "netsurf/misc.h"
#include "netsurf/content.h"
#include "content/hlcache.h"
#include "content/handlers/css/css.h"
#include "css/css.h"
#include "desktop/gui_internal.h"
#include "render/html_internal.h"

View File

@ -35,7 +35,7 @@
#include "netsurf/content.h"
#include "netsurf/misc.h"
#include "content/hlcache.h"
#include "content/handlers/css/utils.h"
#include "css/utils.h"
#include "desktop/scrollbar.h"
#include "desktop/gui_internal.h"

View File

@ -46,7 +46,7 @@
#include "netsurf/bitmap.h"
#include "netsurf/layout.h"
#include "content/content_protected.h"
#include "content/handlers/css/utils.h"
#include "css/utils.h"
#include "desktop/selection.h"
#include "desktop/print.h"
#include "desktop/scrollbar.h"

View File

@ -51,7 +51,7 @@
#include "netsurf/browser_window.h"
#include "netsurf/layout.h"
#include "content/content_protected.h"
#include "content/handlers/css/utils.h"
#include "css/utils.h"
#include "desktop/scrollbar.h"
#include "desktop/textarea.h"

View File

@ -26,7 +26,7 @@
#include "utils/log.h"
#include "utils/talloc.h"
#include "content/handlers/css/utils.h"
#include "css/utils.h"
#include "render/box.h"
#include "render/table.h"

View File

@ -40,7 +40,7 @@
#include "netsurf/content.h"
#include "content/content_protected.h"
#include "content/hlcache.h"
#include "content/handlers/css/utils.h"
#include "css/utils.h"
#include "netsurf/browser_window.h"
#include "utils/nsoption.h"
#include "netsurf/plotters.h"