Angus Leeming wrote:
> However, I find that explicitly passing "-o ./pch.h.gch" to the compiler
> does work:

Hmmm. Modifying config/common.am, so:

 pch-file:
-       $(CXXCOMPILE) -x c++-header $(PCH_SOURCE) -MT $(PCH_FILE)  -MD -MP
\
-        -MF "./$(PCH_FILE).Tdep" \
-       && mv "./$(PCH_FILE).Tdep" "./$(PCH_FILE).dep" || rm
"./$(PCH_FILE).Tdep"
-
+       $(CXXCOMPILE) -x c++-header $(PCH_SOURCE) -o $(PCH_FILE) \
+       -MT $(PCH_FILE)  -MD -MP -MF "./$(PCH_FILE).Tdep" \
+       && mv "./$(PCH_FILE).Tdep" "./$(PCH_FILE).dep" \
+       || rm "./$(PCH_FILE).Tdep"
 endif

and then doing a "make maintainer-clean" followed by autogen, configure,
make works, but I find that only *some* of the pch.h.gch files are
regenerated.

$ find . -name 'pch*'
./build/src/tex2lyx/pch.h.gch
./build/src/tex2lyx/pch.h.gch.dep
./build/src/support/pch.h.gch
./build/src/support/pch.h.gch.dep
./build/src/frontends/qt2/ui/pch.h.gch
./build/src/frontends/qt2/ui/pch.h.gch.dep
./build/src/pch.h.gch
./build/src/pch.h.gch.dep
./boost/libs/regex/src/pch.h
./boost/libs/signals/src/pch.h
./boost/libs/filesystem/src/pch.h
./src/client/pch.h
./src/pch.h
./src/frontends/controllers/pch.h
./src/frontends/gtk/pch.h
./src/frontends/qt2/moc/pch.h
./src/frontends/qt2/ui/moc/pch.h
./src/frontends/qt2/ui/pch.h
./src/frontends/qt2/pch.h
./src/frontends/xforms/forms/pch.h
./src/frontends/xforms/pch.h
./src/frontends/pch.h
./src/graphics/pch.h
./src/insets/pch.h
./src/mathed/pch.h
./src/support/tests/pch.h
./src/support/pch.h
./src/tex2lyx/pch.h

I guess that the built .o files should be made to depend on the generated
pch.h.gch files, no?

I find dependencies like this:
build/src/insets/.deps/inseturl.Plo:./../../../src/insets/pch.h:

But shouldn't build/src/insets/.deps/inseturl.Plo depend on pch.h.gch?

I find that in src/frontends/qt2/ui (one of the directories where
regeneration of the .gch file occurs) there is this code in Makefile.am:

%.C: %.h %.ui $(PCH_FILE)
        $(UIC) $(UICFLAGS) -impl `echo $^ | sed 's/[^ ]*pch.h.gch//'` -o $@

where PCH_FILE=./pch.h.gch

But it would appear that this rule in config/common.am isn't doing what
it's meant to be doing.

PCH_FILE = ./pch.h.gch
*.C *.cpp: $(PCH_FILE)

-- 
Angus

Reply via email to