diff --git a/Makefile b/Makefile
index f41aa8a66a4b7c43e448c45cb7e3cd19f22b75e6..e0f47c690b42db4621e267d35c19cb70451ed15a 100644
--- a/Makefile
+++ b/Makefile
@@ -498,7 +498,7 @@ STATICOBJLIST := $(ROOT_SRCDIR)/build/unix/staticobjectlist.sh
 MAKESTATICLIB := $(ROOT_SRCDIR)/build/unix/makestaticlib.sh
 MAKESTATIC    := $(ROOT_SRCDIR)/build/unix/makestatic.sh
 RECONFIGURE   := $(ROOT_SRCDIR)/build/unix/reconfigure.sh
-MAKEONEPCM    := $(ROOT_SRCDIR)/build/unix/makeonepcm.sh $(ROOT_SRCDIR) "$(MODULES)"
+MAKEONEPCM    := $(ROOT_SRCDIR)/build/unix/makeonepcm.sh
 ifeq ($(PLATFORM),win32)
 MAKELIB       := $(ROOT_SRCDIR)/build/win/makelib.sh
 MAKECOMPDATA  := $(ROOT_SRCDIR)/build/win/compiledata.sh
@@ -1058,8 +1058,8 @@ changelog:
 releasenotes:
 	@$(MAKERELNOTES)
 
-etc/allDict.cxx.pch: $(ROOTCINTTMPDEP) $(ALLHDRS) $(ORDER_) $(ALLLIBS)
-	@$(MAKEONEPCM)
+etc/allDict.cxx.pch: $(MAKEONEPCM) $(ROOTCINTTMPDEP) $(ALLHDRS) $(CLINGETCPCH) $(ORDER_) $(ALLLIBS)
+	$(MAKEONEPCM) $(ROOT_SRCDIR) "$(MODULES)" $(CLINGETCPCH)
 
 ifeq ($(BUILDX11),yes)
 ifeq ($(BUILDASIMAGE),yes)
diff --git a/build/unix/makeonepcm.sh b/build/unix/makeonepcm.sh
index 8fe2d4f03c39004ed41dac8388f016be12975a91..1b57ac21da3b4cc6226899665e368ea938499b62 100755
--- a/build/unix/makeonepcm.sh
+++ b/build/unix/makeonepcm.sh
@@ -10,18 +10,18 @@ echo
 echo Generating the one large pcm, patience...
 echo
 
-srcdir=.
-if [ $# -eq 1 ]; then
-   srcdir=$1
-   modules=./*/
-fi
-if [ $# -eq 2 ]; then
-   srcdir=$1
-   modules=$2
-fi
+srcdir=$1
+shift
+modules=$1
+shift
 
 rm -f include/allHeaders.h include/allHeaders.h.pch include/allLinkDef.h all.h cppflags.txt include/allLinkDef.h
 
+while ! [ "x$1" = "x" ]; do
+    echo '#include "'$1'"' >> all.h
+    shift
+done
+
 for dict in `find $modules -name 'G__*.cxx' 2> /dev/null | grep -v /G__Cling.cxx | grep -v core/metautils/src/G__std_`; do
     dirname=`dirname $dict`                   # to get foo/src
     dirname=`echo $dirname | sed 's,/src$,,'` # to get foo
diff --git a/interpreter/cling/Module.mk b/interpreter/cling/Module.mk
index a04c9ffaf220b13e6c5766b64f34343e9c929f33..25667185081b3f2b4a1f1426aaa3b3b220130bf1 100644
--- a/interpreter/cling/Module.mk
+++ b/interpreter/cling/Module.mk
@@ -36,9 +36,9 @@ CLINGETC_LLVM := llvm/ADT/IntrusiveRefCntPtr.h \
         llvm/Support/SwapByteOrder.h \
         llvm/Support/type_traits.h
 
-CLINGETC     := $(addprefix etc/cling/Interpreter/,$(CLINGETC_CLING)) \
-        $(addprefix etc/cling/cint/,multimap multiset) \
+CLINGETCPCH  := $(addprefix etc/cling/Interpreter/,$(CLINGETC_CLING)) \
 	$(addprefix etc/cling/,$(CLINGETC_LLVM))
+CLINGETC     := $(CLINGETCPCH) $(addprefix etc/cling/cint/,multimap multiset)
 
 CLINGETC_ORIGINALS := $(addprefix $(call stripsrc,$(LLVMDIRI))/include/,$(CLINGETC_LLVM)) \
 	$(addprefix $(CLINGDIR)/include/cling/,$(CLINGETC_CLING))