In an ideal world we don't want them, right?

I've just been building the 13x tree using Dec's make and find that 
the src tree is almost Ok. The changes I have to make are to the 
build rules for our 'unusual' sources.

Eg, this in src/frontends/xforms/forms/Makefile.am:
%.C: %.fd
        $(SHELL) $(SCRIPT) $<

The '%.C: %.fd' thing, meaning the .C file depends on the .fd file, 
whilst intuitive, is a gnu make-ism. The standard make way is:

.SUFFIXES: .fd .C

.fd.C:
        $(SHELL) $(SCRIPT) $<

Which is written in Makefile.am as:

SUFFIX = .C .fd

.fd.C:
        $(SHELL) $(SCRIPT) $<

Patch attached. Ok to apply to 13x, Jean-Marc?

The same sort of thing is present in the qt frontend, although the 
problem is more complex:

src/frontends/qt2/ui/Makefile.am contains:
%.h: %.ui
        $(UIC) $(UICFLAGS) $< -o $@
%.C: %.h %.ui
        $(UIC) $(UICFLAGS) -impl $^ -o $@

Fixing the first of these is trivial '%.h: %.ui' -> '.ui.h:'.

However, the second is more complex.
1. The .C file depends on the .ui file '%.C: %.ui' -> '.ui.C:'
2. The .C file also depends on the .h file -> '.ui.C: $*.h' ???
3. '$^' in the build rule. The line above expands to:
/usr/local/kde/qt/bin/uic -tr qt_ -impl QMathDialogBase.h 
../../../../../src/frontends/qt2/ui/QMathDialogBase.ui -o 
QMathDialogBase.C
so, somehow '$^' is expanded to 'QMathDialogBase.h 
../../../../../src/frontends/qt2/ui/QMathDialogBase.ui'
Ie, it is probably equivalent to '$*.h $<' but I haven't got this to 
work yet.

Any input from the gurus?

-- 
Angus
Index: src/frontends/xforms/forms/Makefile.am
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/forms/Makefile.am,v
retrieving revision 1.14.2.1
diff -u -p -r1.14.2.1 Makefile.am
--- src/frontends/xforms/forms/Makefile.am	27 May 2003 12:45:52 -0000	1.14.2.1
+++ src/frontends/xforms/forms/Makefile.am	3 Dec 2003 11:35:51 -0000
@@ -4,6 +4,8 @@ EXTRA_DIST = fdfixc.sed fdfixh.sed c_str
 
 noinst_LTLIBRARIES = libfdesign.la
 
+SUFFIX = .C .fd
+
 # For (forms_fwd.h, forms_gettext.h) and LString.h, respectively.
 INCLUDES = -I$(srcdir)/..  -I$(top_srcdir)/src
 
@@ -59,5 +61,5 @@ $(libfdesign_la_SOURCES): $(srcdir)/fdfi
 
 libfdesign.la: $(libfdesign_la_OBJECTS) $(libfdesign_la_DEPENDENCIES)
 
-%.C: %.fd
+.fd.C:
 	$(SHELL) $(SCRIPT) $<

Reply via email to