Index: doc/Makefile.arch
===================================================================
--- doc/Makefile.arch	(revision 71eba5ee374e1e5fd4970b90887d63455af0fd5f)
+++ doc/Makefile.arch	(revision 1ad8ecafa851b71ae0e4d2c2ddf5b92c73c0c41e)
@@ -39,11 +39,6 @@
 OPT2          = -g
 else
-ifneq ($(findstring debug, $(strip $(shell $(RC) --config))),)
-OPT           = -g
-OPT2          = -g
-else
 OPT           = -O
 OPT2          = -O2
-endif
 endif
 
@@ -52,11 +47,12 @@
 ROOTLIBS     := $(shell $(RC) --libs)
 ROOTGLIBS    := $(shell $(RC) --glibs)
-HASTHREAD    := $(shell $(RC) --has-thread)
-ROOTCINT     := rootcint
+ROOTCLING    := rootcling
 
 ifeq ($(PLATFORM),macosx)
-MACOSX_MINOR := $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2)
+ROOTLIBDIR   := $(shell $(RC) --libdir)
+MACOSX_MAJOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 1))
+MACOSX_MINOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2))
 ifeq ($(MACOSX_DEPLOYMENT_TARGET),)
-MACOSXTARGET := 10.$(MACOSX_MINOR)
+MACOSXTARGET := $(MACOSX_MAJOR).$(MACOSX_MINOR)
 else
 MACOSXTARGET := $(MACOSX_DEPLOYMENT_TARGET)
@@ -118,5 +114,5 @@
 SOFLAGS       = -shared
 DllSuf        = a
-EXPLLINKLIBS  = $(ROOTLIBS) $(ROOTGLIBS)
+EXPLLINKLIBS  = $(ROOTGLIBS)
 endif
 
@@ -146,58 +142,4 @@
 LDFLAGS       = $(OPT)
 SOFLAGS       = -G
-endif
-
-ifeq ($(ARCH),sgicc)
-# SGI
-CXX           = CC -n32  -I/usr/include/CC.sgi
-CXXFLAGS      = $(OPT)
-LD            = CC -n32 -LANG:std  -I/usr/include/CC.sgi
-LDFLAGS       = $(OPT)
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),sgicc64)
-# SGI
-CXX           = CC -64  -I/usr/include/CC.sgi
-CXXFLAGS      = $(OPT)
-LD            = CC -64 -LANG:std -I/usr/include/CC.sgi
-LDFLAGS       = $(OPT)
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),sgigcc)
-# SGI 6.x with gcc
-CXX           = g++
-CXXFLAGS      = $(OPT) -Wall -fPIC
-LD            = g++
-LDFLAGS       = $(OPT) -Wl,-u,__builtin_new -Wl,-u,__builtin_delete -Wl,-u,__nw__FUiPv
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),sgin32gcc)
-# SGI 6.x with gcc for n32 ABI
-CXX           = g++
-CXXFLAGS      = $(OPT) -Wall -fPIC
-LD            = g++
-LDFLAGS       = $(OPT) -L/usr/lib32 -Wl,-woff,134 -lgen
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),alphagcc)
-# Alpha/OSF with gcc
-CXX           = g++
-CXXFLAGS      = $(OPT2) -Wall -fPIC
-LD            = g++
-LDFLAGS       = $(OPT2)
-SOFLAGS       = -Wl,-expect_unresolved,* -shared
-endif
-
-ifeq ($(ARCH),alphacxx6)
-# Alpha/OSF with cxx6
-CXX           = cxx
-CXXFLAGS      = $(OPT)
-LD            = cxx
-LDFLAGS       = $(OPT)
-SOFLAGS       = -shared -nocxxstd -Wl,-expect_unresolved,*,-msym
 endif
 
@@ -282,22 +224,4 @@
 endif
 
-ifeq ($(ARCH),linuxalphagcc)
-# Alpha Linux with gcc
-CXX           = g++
-CXXFLAGS      = $(OPT2) -Wall -fPIC
-LD            = g++
-LDFLAGS       = $(OPT2)
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),linuxmips)
-# GNU/Linux on mips (BE/LE, O32/N32/N64) with gcc
-CXX           = g++
-CXXFLAGS      = $(OPT2) -Wall -fPIC
-LD            = g++
-LDFLAGS       = $(OPT2)
-SOFLAGS       = -shared
-endif
-
 ifeq ($(ARCH),linuxhppa)
 # GNU/Linux on hppa with gcc
@@ -318,4 +242,13 @@
 endif
 
+ifeq ($(ARCH),linuxarm64)
+# ARMv8-A (AArch64) Linux with gcc and glibc
+CXX           = g++
+CXXFLAGS      = $(OPT) -Wall -fPIC
+LD            = g++
+LDFLAGS       = $(OPT)
+SOFLAGS       = -shared
+endif
+
 ifeq ($(ARCH),freebsd4)
 # FreeBSD with glibc
@@ -360,15 +293,6 @@
 LD            = g++
 LDFLAGS       = $(OPT2) -mmacosx-version-min=$(MACOSXTARGET)
-EXPLLINKLIBS  = $(ROOTLIBS) $(ROOTGLIBS)
-# The SOFLAGS will be used to create the .dylib,
-# the .so will be created separately
-ifeq ($(subst $(MACOSX_MINOR),,1234),1234)
+EXPLLINKLIBS  = $(ROOTGLIBS)
 DllSuf        = so
-else
-DllSuf        = dylib
-endif
-ifneq ($(subst $(MACOSX_MINOR),,12),12)
-LD            = g++
-endif
 SOFLAGS       = -dynamiclib -single_module -install_name $(CURDIR)/
 endif
@@ -376,19 +300,10 @@
 ifeq ($(ARCH),macosxicc)
 # MacOS X with Intel icc compiler
-ifeq ($(MACOSX_MINOR),5)
-MACOSX_MINOR := 4
-endif
 CXX           = icc
 CXXFLAGS      = $(OPT) -fPIC -wd1476
 LD            = icpc
 LDFLAGS       = $(OPT2) -mmacosx-version-min=$(MACOSXTARGET)
-EXPLLINKLIBS  = $(ROOTLIBS) $(ROOTGLIBS)
-# The SOFLAGS will be used to create the .dylib,
-# the .so will be created separately
-ifeq ($(subst $(MACOSX_MINOR),,1234),1234)
+EXPLLINKLIBS  = $(ROOTGLIBS)
 DllSuf        = so
-else
-DllSuf        = dylib
-endif
 SOFLAGS       = -dynamiclib -single_module -install_name $(CURDIR)/
 endif
@@ -400,13 +315,18 @@
 CXXFLAGS      = $(OPT2) -pipe -Wall -W -Woverloaded-virtual
 LD            = g++
-LDFLAGS       = $(OPT2) -mmacosx-version-min=$(MACOSXTARGET)
-EXPLLINKLIBS  = $(ROOTLIBS) $(ROOTGLIBS)
-# The SOFLAGS will be used to create the .dylib,
-# the .so will be created separately
-ifeq ($(subst $(MACOSX_MINOR),,1234),1234)
+LDFLAGS       = $(OPT2) -mmacosx-version-min=$(MACOSXTARGET) -Wl,-rpath,$(ROOTLIBDIR)
+EXPLLINKLIBS  = $(ROOTGLIBS)
 DllSuf        = so
-else
-DllSuf        = dylib
-endif
+SOFLAGS       = -dynamiclib -single_module -install_name $(CURDIR)/
+endif
+
+ifeq ($(ARCH),macosxarm64)
+# Apple Silicon running macOS 11.x.
+CXX           = g++
+CXXFLAGS      = $(OPT2) -pipe -Wall -W -Woverloaded-virtual
+LD            = g++
+LDFLAGS       = $(OPT2) -mmacosx-version-min=$(MACOSXTARGET)  -Wl,-rpath,$(ROOTLIBDIR)
+EXPLLINKLIBS  = $(ROOTGLIBS)
+DllSuf        = so
 SOFLAGS       = -dynamiclib -single_module -install_name $(CURDIR)/
 endif
@@ -426,11 +346,6 @@
 LDOPT         = -debug
 else
-ifneq ($(findstring debug, $(strip $(shell $(RC) --config))),)
-CXXOPT        = -Z7
-LDOPT         = -debug
-else
 CXXOPT        = -O2
 LDOPT         = -opt:ref
-endif
 endif
 ROOTINCDIR   := -I$(shell cygpath -m `$(RC) --incdir`)
@@ -440,5 +355,5 @@
 SOFLAGS       = -DLL
 
-EXPLLINKLIBS  = $(ROOTLIBS) $(ROOTGLIBS)
+EXPLLINKLIBS  = $(ROOTGLIBS)
 ifneq (,$(findstring $(VC_MAJOR),14 15))
 MT_EXE        = mt -nologo -manifest $@.manifest -outputresource:$@\;1; rm -f $@.manifest
@@ -462,5 +377,5 @@
 SOFLAGS       = -shared -Wl,--enable-auto-image-base \
                 -Wl,--export-all-symbols
-EXPLLINKLIBS  = $(ROOTLIBS) $(ROOTGLIBS)
+EXPLLINKLIBS  = $(ROOTGLIBS)
 endif
 
@@ -471,6 +386,6 @@
 CXXFLAGS     += $(ROOTCFLAGS)
 LDFLAGS      += $(ROOTLDFLAGS)
-LIBS          = $(ROOTLIBS) $(SYSLIBS)
-GLIBS         = $(ROOTGLIBS) $(SYSLIBS)
+LIBS          = $(ROOTLIBS)
+GLIBS         = $(ROOTGLIBS)
 
 ifneq ($(ALTCC),)
Index: doc/genMakefile.tcl
===================================================================
--- doc/genMakefile.tcl	(revision 71eba5ee374e1e5fd4970b90887d63455af0fd5f)
+++ doc/genMakefile.tcl	(revision 1ad8ecafa851b71ae0e4d2c2ddf5b92c73c0c41e)
@@ -346,15 +346,6 @@
 	@mkdir -p $(@D)
 	@echo ">> Building $@"
-ifeq ($(ARCH),aix5)
-	@$(MAKESHARED) $(OutPutOpt) $@ $(DELPHES_LIBS) -p 0 $^
-else
 ifeq ($(PLATFORM),macosx)
-# We need to make both the .dylib and the .so
 	@$(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@ $(DELPHES_LIBS)
-ifneq ($(subst $(MACOSX_MINOR),,1234),1234)
-ifeq ($(MACOSX_MINOR),4)
-	@ln -sf $@ $(subst .$(DllSuf),.so,$@)
-endif
-endif
 else
 ifeq ($(PLATFORM),win32)
@@ -365,6 +356,4 @@
 else
 	@$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(DELPHES_LIBS)
-	@$(MT_DLL)
-endif
 endif
 endif
@@ -373,15 +362,6 @@
 	@mkdir -p $(@D)
 	@echo ">> Building $@"
-ifeq ($(ARCH),aix5)
-	@$(MAKESHARED) $(OutPutOpt) $@ $(DELPHES_LIBS) -p 0 $^
-else
 ifeq ($(PLATFORM),macosx)
-# We need to make both the .dylib and the .so
 	@$(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@ $(DELPHES_LIBS)
-ifneq ($(subst $(MACOSX_MINOR),,1234),1234)
-ifeq ($(MACOSX_MINOR),4)
-	@ln -sf $@ $(subst .$(DllSuf),.so,$@)
-endif
-endif
 else
 ifeq ($(PLATFORM),win32)
@@ -392,6 +372,4 @@
 else
 	@$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(DELPHES_LIBS)
-	@$(MT_DLL)
-endif
 endif
 endif
@@ -400,15 +378,6 @@
 	@mkdir -p $(@D)
 	@echo ">> Building $@"
-ifeq ($(ARCH),aix5)
-	@$(MAKESHARED) $(OutPutOpt) $@ $(DISPLAY_LIBS) -p 0 $^
-else
 ifeq ($(PLATFORM),macosx)
-# We need to make both the .dylib and the .so
 	@$(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@ $(DISPLAY_LIBS)
-ifneq ($(subst $(MACOSX_MINOR),,1234),1234)
-ifeq ($(MACOSX_MINOR),4)
-	@ln -sf $@ $(subst .$(DllSuf),.so,$@)
-endif
-endif
 else
 ifeq ($(PLATFORM),win32)
@@ -419,6 +388,4 @@
 else
 	@$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(DISPLAY_LIBS)
-	@$(MT_DLL)
-endif
 endif
 endif
