Revision dc2d2f297d38600d48b4f9dc41facfd7f4f7d5e1 authored by Fons Rademakers on 13 October 2010, 10:39:18 UTC, committed by Fons Rademakers on 13 October 2010, 10:39:18 UTC

git-svn-id: http://root.cern.ch/svn/root/tags/v5-26-00e@36332 27541ba8-7e3a-0410-8455-c3a389f83636
1 parent cdc6862
Raw File
Makefile.precomp
# -*- mode: makefile -*-
#
# Makefile containing precompiled header rules
# Get the list of all included ROOT headers and how often they are
# included by running : 
#   cat */src/*.d|egrep '.o: '|sed 's,^[^:]*: ,,'|tr ' ' '\n'|sort \
#     |awk '{if(o!=$1){if(n)printf "%8d %s\n",n,o;o=$1;n=0;};n++}' \
#     |sort -n -r | head

ifeq ($(INCLUDEPCHRULES),)

PCHHEADERS    = TObject.h

PCHEXTRASRC   = core/base/src/precompile.cxx
PCHEXTRAOBJ   = $(PCHEXTRASRC:.cxx=.o)
PCHEXTRADEP   = $(PCHEXTRASRC:.cxx=.d)
PCHEXTRAHDRI  = config/precompile.h.in
PCHEXTRAHDR   = include/precompile.h
PCHDEP        = $(PCHFILE)
ALLHDRS      += $(PCHEXTRAHDR)
INCLUDEFILES += $(PCHEXTRADEP)

else

$(PCHEXTRAHDR): PCHINCSTATEM = // see config/Makefile.precomp$(addprefix @\1",$(addsuffix "\2,$(PCHHEADERS)))

$(PCHEXTRAHDR): $(PCHEXTRAHDRI)
	cat $< | \
        sed 's,\(#[ ]*include \)@PRECOMPILE@\(.*\)$$,$(PCHINCSTATEM),' | \
        tr '@' '\n' > $@

$(PCHEXTRAOBJ) $(PCHFILE): $(PCHEXTRAHDR) $(W32PRAGMA) $(RMKDEP)
	@echo Building precompiled header...
	$(MAKEDEP) -R -f$(PCHEXTRADEP).tmp -Y -w 1000 -- $(CXXFLAGS) -DUSEPCH -D__cplusplus -- $<
	sed -e 's,include/precompile.o,$(PCHFILE),' \
	    -e 's,include/precompile.d,$(PCHEXTRADEP),' $(PCHEXTRADEP).tmp > $(PCHEXTRADEP)
	rm -f $(PCHEXTRADEP).tmp
	rm -f $(PCHFILE)
	$(PCHEXTRAOBJBUILD)

endif
back to top