summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile51
1 files changed, 18 insertions, 33 deletions
diff --git a/Makefile b/Makefile
index f66f79649..18665ed3d 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@
#
# Copyright 2007 Daniel Silverstone <dsilvers@netsurf-browser.org>
# Copyright 2008 Rob Kendrick <rjek@netsurf-browser.org>
+# Copyright 2024 Vincent Sanders <vince@netsurf-browser.org>
#
# Trivially, invoke as:
# make
@@ -39,13 +40,6 @@ MESSAGES_LANGUAGES=de en fr it nl zh_CN
# The target directory for the split messages
MESSAGES_TARGET=resources
-# Defaults for tools
-PERL=perl
-MKDIR=mkdir
-TOUCH=touch
-STRIP?=strip
-INSTALL?=install
-
# build verbosity
ifeq ($(V),1)
Q:=
@@ -54,31 +48,11 @@ else
endif
VQ=@
-# Override this only if the host compiler is called something different
-BUILD_CC := cc
-BUILD_CFLAGS = -g -W -Wall -Wundef -Wpointer-arith -Wcast-align \
- -Wwrite-strings -Wmissing-declarations -Wuninitialized \
- -Wno-unused-parameter
-
# compute HOST, TARGET and SUBTARGET
include frontends/Makefile.hts
-# target specific tool overrides
-include frontends/$(TARGET)/Makefile.tools
-
-# compiler versioning to adjust warning flags
-CC_VERSION := $(shell $(CC) -dumpfullversion -dumpversion)
-CC_MAJOR := $(word 1,$(subst ., ,$(CC_VERSION)))
-CC_MINOR := $(word 2,$(subst ., ,$(CC_VERSION)))
-define cc_ver_ge
-$(shell expr $(CC_MAJOR) \> $(1) \| \( $(CC_MAJOR) = $(1) \& $(CC_MINOR) \>= $(2) \) )
-endef
-
-# CCACHE
-ifeq ($(origin CCACHE),undefined)
- CCACHE=$(word 1,$(shell ccache -V 2>/dev/null))
-endif
-CC := $(CCACHE) $(CC)
+# tools used in builds
+include Makefile.tools
# Target paths
OBJROOT = build/$(HOST)-$(TARGET)$(SUBTARGET)
@@ -96,6 +70,11 @@ include Makefile.macros
# General flag setup
# ----------------------------------------------------------------------------
+# host compiler flags
+BUILD_CFLAGS = -g -W -Wall -Wundef -Wpointer-arith -Wcast-align \
+ -Wwrite-strings -Wmissing-declarations -Wuninitialized \
+ -Wno-unused-parameter
+
# 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 \
@@ -110,9 +89,14 @@ ifeq ($(call cc_ver_ge,4,6),1)
COMMON_WARNFLAGS += -Wno-unused-but-set-variable
endif
-# Implicit fallthrough warnings suppressed by comment
-ifeq ($(call cc_ver_ge,7,1),1)
- COMMON_WARNFLAGS += -Wimplicit-fallthrough=3
+ifeq ($(TOOLCHAIN),gcc)
+ # Implicit fallthrough warnings
+ ifeq ($(call cc_ver_ge,7,1),1)
+ COMMON_WARNFLAGS += -Wimplicit-fallthrough=5
+ endif
+else
+ # non gcc has different warning syntax
+ COMMON_WARNFLAGS += -Wimplicit-fallthrough
endif
# deal with chaging warning flags for different platforms
@@ -171,6 +155,7 @@ endif
$(eval $(call pkg_config_find_and_add_enabled,OPENSSL,openssl,OpenSSL))
$(eval $(call pkg_config_find_and_add_enabled,UTF8PROC,libutf8proc,utf8))
+$(eval $(call pkg_config_find_and_add_enabled,JPEGXL,libjxl,JPEGXL))
$(eval $(call pkg_config_find_and_add_enabled,WEBP,libwebp,WEBP))
$(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG))
$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
@@ -333,7 +318,7 @@ ifneq ($(TARGET),riscos)
$(Q)$(CC) -o $(EXETARGET) $(OBJECTS) $(LDFLAGS) > $(DEPROOT)/link-raw.d
else
@# RISC OS targets are a bit special: we need to convert ELF -> AIF
- ifeq ($(SUBTARGET),riscos-aof)
+ ifeq ($(SUBTARGET),-aof)
$(Q)$(CC) -o $(EXETARGET) $(OBJECTS) $(LDFLAGS) > $(DEPROOT)/link-raw.d
else
$(Q)$(CXX) -o $(EXETARGET:,ff8=,e1f) $(OBJECTS) $(LDFLAGS) > $(DEPROOT)/link-raw.d