summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile54
-rw-r--r--atari/Makefile.target2
-rw-r--r--beos/Makefile.target44
-rw-r--r--cocoa/Makefile.target3
-rw-r--r--framebuffer/Makefile.target2
-rw-r--r--gtk/Makefile.target6
-rw-r--r--monkey/Makefile.target31
-rw-r--r--riscos/Makefile.target2
-rw-r--r--windows/Makefile.target2
9 files changed, 82 insertions, 64 deletions
diff --git a/Makefile b/Makefile
index 974691a90..81deb1b1e 100644
--- a/Makefile
+++ b/Makefile
@@ -70,6 +70,9 @@ else
ifeq ($(TARGET),)
TARGET := beos
endif
+ ifeq ($(TARGET),haiku)
+ TARGET := beos
+ endif
else
ifeq ($(HOST),AmigaOS)
HOST := amiga
@@ -131,14 +134,20 @@ ifneq ($(TARGET),riscos)
endif
endif
-Q=@
-VQ=@
PERL=perl
MKDIR=mkdir
TOUCH=touch
STRIP=strip
SPLIT_MESSAGES=$(PERL) utils/split-messages.pl
+# build verbosity
+ifeq ($(V),1)
+ Q:=
+else
+ Q=@
+endif
+VQ=@
+
# Override this only if the host compiler is called something different
HOST_CC := gcc
@@ -323,6 +332,7 @@ TOOLROOT := $(OBJROOT)/tools
define feature_enabled
ifeq ($$(NETSURF_USE_$(1)),YES)
CFLAGS += $(2)
+ CXXFLAGS += $(2)
LDFLAGS += $(3)
ifneq ($(MAKECMDGOALS),clean)
$$(info M.CONFIG: $(4) enabled (NETSURF_USE_$(1) := YES))
@@ -348,12 +358,14 @@ endef
define feature_switch
ifeq ($$(NETSURF_USE_$(1)),YES)
CFLAGS += $(3)
+ CXXFLAGS += $(3)
LDFLAGS += $(4)
ifneq ($(MAKECMDGOALS),clean)
$$(info M.CONFIG: $(2) enabled (NETSURF_USE_$(1) := YES))
endif
else ifeq ($$(NETSURF_USE_$(1)),NO)
CFLAGS += $(5)
+ CXXFLAGS += $(5)
LDFLAGS += $(6)
ifneq ($(MAKECMDGOALS),clean)
$$(info M.CONFIG: $(2) disabled (NETSURF_USE_$(1) := NO))
@@ -377,6 +389,7 @@ define pkg_config_find_and_add
ifeq ($$(PKG_CONFIG_$(1)_EXISTS),yes)
CFLAGS += $$(shell $$(PKG_CONFIG) --cflags $(1))
+ CXXFLAGS += $$(shell $$(PKG_CONFIG) --cflags $(1))
LDFLAGS += $$(shell $$(PKG_CONFIG) --libs $(1))
ifneq ($(MAKECMDGOALS),clean)
$$(info PKG.CNFG: $(2) ($(1)) enabled)
@@ -404,6 +417,7 @@ define pkg_config_find_and_add_enabled
ifeq ($$(NETSURF_USE_$(1)),YES)
ifeq ($$(NETSURF_FEATURE_$(1)_AVAILABLE),yes)
CFLAGS += $$(shell $$(PKG_CONFIG) --cflags $(2)) $$(NETSURF_FEATURE_$(1)_CFLAGS)
+ CXXFLAGS += $$(shell $$(PKG_CONFIG) --cflags $(2)) $$(NETSURF_FEATURE_$(1)_CFLAGS)
LDFLAGS += $$(shell $$(PKG_CONFIG) --libs $(2)) $$(NETSURF_FEATURE_$(1)_LDFLAGS)
ifneq ($(MAKECMDGOALS),clean)
$$(info M.CONFIG: $(3) ($(2)) enabled (NETSURF_USE_$(1) := YES))
@@ -417,6 +431,7 @@ define pkg_config_find_and_add_enabled
else ifeq ($$(NETSURF_USE_$(1)),AUTO)
ifeq ($$(NETSURF_FEATURE_$(1)_AVAILABLE),yes)
CFLAGS += $$(shell $$(PKG_CONFIG) --cflags $(2)) $$(NETSURF_FEATURE_$(1)_CFLAGS)
+ CXXFLAGS += $$(shell $$(PKG_CONFIG) --cflags $(2)) $$(NETSURF_FEATURE_$(1)_CFLAGS)
LDFLAGS += $$(shell $$(PKG_CONFIG) --libs $(2)) $$(NETSURF_FEATURE_$(1)_LDFLAGS)
ifneq ($(MAKECMDGOALS),clean)
$$(info M.CONFIG: $(3) ($(2)) auto-enabled (NETSURF_USE_$(1) := AUTO))
@@ -444,26 +459,31 @@ endef
# 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 \
- -Wnested-externs -Wuninitialized
+# Set up the warning flags here so that they can be overridden in the
+# Makefile.config
+COMMON_WARNFLAGS = -W -Wall -Wundef -Wpointer-arith -Wcast-align \
+ -Wwrite-strings -Wmissing-declarations -Wuninitialized
ifneq ($(CC_MAJOR),2)
- WARNFLAGS += -Wno-unused-parameter
+ COMMON_WARNFLAGS += -Wno-unused-parameter
endif
# deal with lots of unwanted warnings from javascript
ifeq ($(call cc_ver_ge,4,6),1)
- WARNFLAGS += -Wno-unused-but-set-variable
+ COMMON_WARNFLAGS += -Wno-unused-but-set-variable
endif
# deal with chaging warning flags on differing HOST systems
ifeq ($(HOST),OpenBSD)
# OpenBSD headers are not compatible with redundant declaration warning
- WARNFLAGS += -Wno-redundant-decls
+ COMMON_WARNFLAGS += -Wno-redundant-decls
else
- WARNFLAGS += -Wredundant-decls
+ COMMON_WARNFLAGS += -Wredundant-decls
endif
+# c++ default warning flags
+CXXWARNFLAGS :=
+
+# C default warning flags
+CWARNFLAGS := -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
+
# Pull in the configuration
include Makefile.defaults
@@ -481,12 +501,15 @@ LDFLAGS += -lz
# add top level and build directory to include search path
CFLAGS += -I. -I$(OBJROOT)
+CXXFLAGS += -I. -I$(OBJROOT)
# export the user agent format
CFLAGS += -DNETSURF_UA_FORMAT_STRING=\"$(NETSURF_UA_FORMAT_STRING)\"
+CXXFLAGS += -DNETSURF_UA_FORMAT_STRING=\"$(NETSURF_UA_FORMAT_STRING)\"
# set the default homepage to use
CFLAGS += -DNETSURF_HOMEPAGE=\"$(NETSURF_HOMEPAGE)\"
+CXXFLAGS += -DNETSURF_HOMEPAGE=\"$(NETSURF_HOMEPAGE)\"
# ----------------------------------------------------------------------------
# General make rules
@@ -703,7 +726,7 @@ $$(DEPROOT)/$(3) $$(OBJROOT)/$(2): $$(OBJROOT)/created
> $$(DEPROOT)/$(3)
$$(VQ)echo " COMPILE: $(1)"
$$(Q)$$(RM) $$(OBJROOT)/$(2)
- $$(Q)$$(CC) $$(CFLAGS) -o $$(OBJROOT)/$(2) -c $(1)
+ $$(Q)$$(CC) $$(CFLAGS) $$(COMMON_WARNFLAGS) $$(CWARNFLAGS) -o $$(OBJROOT)/$(2) -c $(1)
endef
else
@@ -712,7 +735,8 @@ $$(DEPROOT)/$(3) $$(OBJROOT)/$(2): $$(OBJROOT)/created
$$(VQ)echo " COMPILE: $(1)"
$$(Q)$$(RM) $$(DEPROOT)/$(3)
$$(Q)$$(RM) $$(OBJROOT)/$(2)
- $$(Q)$$(CC) $$(CFLAGS) -MMD -MT '$$(DEPROOT)/$(3) $$(OBJROOT)/$(2)' \
+ $$(Q)$$(CC) $$(CFLAGS) $$(COMMON_WARNFLAGS) $$(CWARNFLAGS) \
+ -MMD -MT '$$(DEPROOT)/$(3) $$(OBJROOT)/$(2)' \
-MF $$(DEPROOT)/$(3) -o $$(OBJROOT)/$(2) -c $(1)
endef
@@ -722,12 +746,12 @@ define compile_target_cpp
$$(DEPROOT)/$(3) $$(OBJROOT)/$(2): $$(OBJROOT)/created
$$(VQ)echo " DEP: $(1)"
$$(Q)$$(RM) $$(DEPROOT)/$(3)
- $$(Q)$$(CC) $$(CFLAGS) -MM \
+ $$(Q)$$(CC) $$(CFLAGS) $$(COMMON_WARNFLAGS) $$(CXXWARNFLAGS) -MM \
$(1) | sed 's,^.*:,$$(DEPROOT)/$(3) $$(OBJROOT)/$(2):,' \
> $$(DEPROOT)/$(3)
$$(VQ)echo " COMPILE: $(1)"
$$(Q)$$(RM) $$(OBJROOT)/$(2)
- $$(Q)$$(CXX) $$(CFLAGS) -o $$(OBJROOT)/$(2) -c $(1)
+ $$(Q)$$(CXX) $$(CXXFLAGS) $$(COMMON_WARNFLAGS) $$(CXXWARNFLAGS) -o $$(OBJROOT)/$(2) -c $(1)
endef
diff --git a/atari/Makefile.target b/atari/Makefile.target
index 685140099..c9b2046f2 100644
--- a/atari/Makefile.target
+++ b/atari/Makefile.target
@@ -59,7 +59,7 @@ endif
$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
-CFLAGS += -U__STRICT_ANSI__ -std=c99 -Dsmall $(WARNFLAGS) -Dnsatari \
+CFLAGS += -U__STRICT_ANSI__ -std=c99 -Dsmall -Dnsatari \
-D_BSD_SOURCE \
-D_XOPEN_SOURCE=600 \
-D_POSIX_C_SOURCE=200112L \
diff --git a/beos/Makefile.target b/beos/Makefile.target
index bbeb0be22..f8f329266 100644
--- a/beos/Makefile.target
+++ b/beos/Makefile.target
@@ -4,21 +4,21 @@
$(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
+$(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny)))
+# Linker flags
LDFLAGS += -L/boot/home/config/lib
# for Haiku
LDFLAGS += -L/boot/common/lib
-# some people do *not* have libm...
LDFLAGS += -lssl -lcrypto -lcss
-$(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny)))
LDFLAGS += -ldom -lparserutils -lhubbub -lwapcaplet
LDFLAGS += -lexpat -lcurl
-CFLAGS += -O $(WARNFLAGS) -Dnsbeos -D_BSD_SOURCE -D_POSIX_C_SOURCE \
- -Drestrict="" -Wno-multichar
-# DEBUG
-CFLAGS += -g -O0
-# -DDEBUG=1
+COMMON_WARNFLAGS += -Wno-multichar
+
+# compiler flags
+CFLAGS += -Dnsbeos -D_BSD_SOURCE -D_POSIX_C_SOURCE -Drestrict="" -g -O0
+CXXFLAGS += -Dnsbeos -D_BSD_SOURCE -D_POSIX_C_SOURCE -Drestrict="" -g -O0
BEOS_BERES := beres
BEOS_RC := rc
@@ -30,38 +30,40 @@ VERSION_MAJ := $(shell sed -n '/_major/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/ver
VERSION_MIN := $(shell sed -n '/_minor/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
RSRC_BEOS = $(addprefix $(OBJROOT)/,$(subst /,_,$(patsubst %.rdef,%.rsrc,$(RDEF_BEOS))))
RESOURCES = $(RSRC_BEOS)
+
ifeq ($(HOST),beos)
- CFLAGS += -I/boot/home/config/include \
+ CFLAGS += -I/boot/home/config/include \
-I/boot/home/config/include/hubbub \
-I/boot/home/config/include/libcss \
-I/boot/home/config/include/parserutils
- ifneq ($(wildcard /boot/develop/lib/*/libzeta.so),)
- LDFLAGS += -lzeta
- endif
- ifneq ($(wildcard /boot/system/develop/lib/*/libnetwork.so),)
+ ifneq ($(wildcard /boot/develop/lib/*/libzeta.so),)
+ LDFLAGS += -lzeta
+ endif
+ ifneq ($(wildcard /boot/system/develop/lib/*/libnetwork.so),)
# Haiku
CFLAGS += -I/boot/common/include \
-I/boot/common/include/hubbub \
-I/boot/common/include/libcss \
-I/boot/common/include/parserutils
NETLDFLAGS := -lnetwork
- else
- ifneq ($(wildcard /boot/develop/lib/*/libbind.so),)
+ else
+ ifneq ($(wildcard /boot/develop/lib/*/libbind.so),)
# BONE
NETLDFLAGS := -lsocket -lbind
- else
+ else
# net_server, will probably never work
NETLDFLAGS := -lnet
- endif
endif
- else
+ endif
+else
# cross: Haiku ?
NETLDFLAGS := -lnetwork
- endif
- LDFLAGS += -lbe -ltranslation -ltracker $(NETLDFLAGS)
- ifeq ($(CC_MAJOR),2)
+endif
+
+LDFLAGS += -lbe -ltranslation -ltracker $(NETLDFLAGS)
+ifeq ($(CC_MAJOR),2)
LDFLAGS += -lstdc++.r4
- else
+else
LDFLAGS += -lstdc++ -lsupc++
endif
diff --git a/cocoa/Makefile.target b/cocoa/Makefile.target
index 6e65b1333..d5b983a98 100644
--- a/cocoa/Makefile.target
+++ b/cocoa/Makefile.target
@@ -10,8 +10,7 @@ LDFLAGS += -L/usr/X11/lib
LDFLAGS += -lm -lcurl
LDFLAGS += -lssl -lcrypto
-CFLAGS += -O $(WARNFLAGS) -Dnscocoa -D_BSD_SOURCE -D_POSIX_C_SOURCE \
- -std=c99 -g -Os
+CFLAGS += -Dnscocoa -D_BSD_SOURCE -D_POSIX_C_SOURCE -std=c99 -g -Os
CFLAGS += $(shell $(PKG_CONFIG) --cflags libhubbub libcss libdom)
diff --git a/framebuffer/Makefile.target b/framebuffer/Makefile.target
index 87156e86f..44b9626ed 100644
--- a/framebuffer/Makefile.target
+++ b/framebuffer/Makefile.target
@@ -42,7 +42,7 @@ $(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
$(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript))
$(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
-CFLAGS += -std=c99 -g -Dsmall $(WARNFLAGS) \
+CFLAGS += -std=c99 -g -Dsmall \
-D_BSD_SOURCE \
-D_XOPEN_SOURCE=600 \
-D_POSIX_C_SOURCE=200112L \
diff --git a/gtk/Makefile.target b/gtk/Makefile.target
index 513cb22de..05865ff74 100644
--- a/gtk/Makefile.target
+++ b/gtk/Makefile.target
@@ -44,14 +44,13 @@ GTKDEPFLAGS := -DG_DISABLE_SINGLE_INCLUDES \
# libsexy currently means we cannot enable this
# -DGDK_DISABLE_DEPRECATED
-GTKCFLAGS := -std=c99 -Dgtk -Dnsgtk \
+GTKCFLAGS := -std=c99 -Dgtk -Dnsgtk -g \
$(GTKDEPFLAGS) \
-D_BSD_SOURCE \
-D_XOPEN_SOURCE=600 \
-D_POSIX_C_SOURCE=200809L \
-D_NETBSD_SOURCE \
- -DGTK_RESPATH=\"$(NETSURF_GTK_RESOURCES)\" \
- $(WARNFLAGS) -g
+ -DGTK_RESPATH=\"$(NETSURF_GTK_RESOURCES)\"
# non optional pkg-configed libs
$(eval $(call pkg_config_find_and_add,libcss,CSS))
@@ -63,7 +62,6 @@ $(eval $(call pkg_config_find_and_add,gtk+-$(NETSURF_GTK_MAJOR).0,GTK-$(NETSURF_
$(eval $(call pkg_config_find_and_add,gthread-2.0,GThread2))
$(eval $(call pkg_config_find_and_add,gmodule-2.0,GModule2))
-
CFLAGS += $(GTKCFLAGS)
LDFLAGS += -lm
diff --git a/monkey/Makefile.target b/monkey/Makefile.target
index 1b0ec163d..d3c974782 100644
--- a/monkey/Makefile.target
+++ b/monkey/Makefile.target
@@ -33,24 +33,19 @@ $(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
# no pkg-config for this library
$(eval $(call feature_enabled,WEBP,-DWITH_WEBP,-lwebp -lvpx,WebP (libwebp)))
-WARNFLAGS += -Werror
-
-MONKEYCFLAGS := -std=c99 -Dmonkey -Dnsmonkey \
- -D_BSD_SOURCE \
- -D_XOPEN_SOURCE=600 \
- -D_POSIX_C_SOURCE=200112L \
- -D_NETBSD_SOURCE \
- -DMONKEY_RESPATH=\"$(NETSURF_MONKEY_RESOURCES)\" \
- $(WARNFLAGS) -g \
- $(shell $(PKG_CONFIG) --cflags glib-2.0) \
- $(shell $(PKG_CONFIG) --cflags libdom libcurl) \
- $(shell $(PKG_CONFIG) --cflags openssl)
-
-MONKEYLDFLAGS := -lm $(shell $(PKG_CONFIG) --cflags --libs glib-2.0)
-
-
-CFLAGS += $(MONKEYCFLAGS)
-LDFLAGS += $(MONKEYLDFLAGS)
+CWARNFLAGS += -Werror
+
+CFLAGS += -std=c99 -Dmonkey -Dnsmonkey -g \
+ -D_BSD_SOURCE \
+ -D_XOPEN_SOURCE=600 \
+ -D_POSIX_C_SOURCE=200112L \
+ -D_NETBSD_SOURCE \
+ -DMONKEY_RESPATH=\"$(NETSURF_MONKEY_RESOURCES)\" \
+ $(shell $(PKG_CONFIG) --cflags glib-2.0) \
+ $(shell $(PKG_CONFIG) --cflags libdom libcurl) \
+ $(shell $(PKG_CONFIG) --cflags openssl)
+
+LDFLAGS += -lm $(shell $(PKG_CONFIG) --cflags --libs glib-2.0)
# ---------------------------------------------------------------------------
# Windows flag setup
diff --git a/riscos/Makefile.target b/riscos/Makefile.target
index 2f5bbb150..46ca34116 100644
--- a/riscos/Makefile.target
+++ b/riscos/Makefile.target
@@ -42,7 +42,7 @@ TPD_RISCOS = $(foreach TPL,$(notdir $(TPL_RISCOS)), \
RESOURCES = $(TPD_RISCOS) split-messages
-CFLAGS += $(WARNFLAGS) -Driscos -std=c99 -D_BSD_SOURCE -D_POSIX_C_SOURCE \
+CFLAGS += -Driscos -std=c99 -D_BSD_SOURCE -D_POSIX_C_SOURCE \
-mpoke-function-name -fno-strict-aliasing
CFLAGS += -I$(GCCSDK_INSTALL_ENV)/include
diff --git a/windows/Makefile.target b/windows/Makefile.target
index 93ee50a46..a4aaba1e4 100644
--- a/windows/Makefile.target
+++ b/windows/Makefile.target
@@ -42,7 +42,7 @@ CFLAGS += '-D_WIN32_IE=0x0501'
#installed resource path
CFLAGS += '-DNETSURF_WINDOWS_RESPATH="$(NETSURF_WINDOWS_RESPATH)"'
-WSCFLAGS := -std=c99 $(WARNFLAGS) -DCURL_STATICLIB -DCARES_STATICLIB -g
+WSCFLAGS := -std=c99 -DCURL_STATICLIB -DCARES_STATICLIB -g
CFLAGS += $(WSCFLAGS)
LDFLAGS += $(WSCFLAGS)