On Fri, Dec 03, 1999 at 06:03:13PM -0500, Rick Scott wrote:
> On 03-Dec-99 at 17:43, Dave Johnson ([EMAIL PROTECTED]) wrote:
> >
-- snip --
> >
> > I have other fixes in progress, mostly things that go wrong if you
> > do a checkout with CVSREAD:
> >
> > 1) in src/exec/dxmods/, there is no dependency to force building
> > of _compparse.h before trying to build _complex.o
> > Add _complex.o: _compparse.h line to end of Makefile.am.
>
> This can be fixed simply by placing _compparse.y before _complex.c in the
> Makefile.am. Otherwise be very very carefull, you are getting into the details
> of the differences between bison and yacc. Automake does a pretty good job of
> things if you follow their instructions very carefully.
I looked into this, and it's not quite that simple.
I believe Automake can do a pretty decent job when
the compiler is like gcc in that it supports cc -MD.
However the native compilers on AIX do not.
_complex.c actually includes _compparse.h, and so make depend
would include just such a line as I suggested. Whether you use
bison or yacc is completely irrelevant, since the include file
must exist before the object file can be made.
Where my fix might have a problem is if the object file extension
is not ".o".... Your suggestion will work, but only if you build
_compparse.c and _compparse.h in the same rule. See patch below.
>
> >
> > 2) src/exec/dxmods has a copy of y.output checked into the tree.
> > Either fix Makefile.am to do -$(RM) y.output before running $(YACC),
> > or delete it from the tree.
>
> I think if you follow the automake instructions, all of these y.* files will
> not even get made, or made then renamed. In any case I highly recomend
> checking
> out the automake manual for flex/bison support.
>
I don't think so.
y.output is created when you give yacc (or bison -y) the -v option.
The file is trash and should not be checked into CVS.
When I build in a tree checked out with CVSREAD, it dies horribly.
Alternately one could safely remove the -v option and then the
problem would be moot.
Other changes I would make:
a) y.tab.c is only an intermediate file, _compparse.c is a built source.
Switch y.tab.c and _compparse.c between BUILT_SOURCES and DISTCLEANFILES.
b) avoid repetition by using $(BUILT_SOURCES)
I don't know why "AQC_PROG_YACC" (sic in configure.in) is not being
used, but it would simplify things here.
> >
> > 3) several other places in the same Makefile.am, and in
> > src/exec/libdx/local.mk, "rm" is used without the -f option.
> > If cp (of a readonly file) results in another readonly file, this
> > becomes important, as in _plane.c and tmp.c.
> > Should use -$(RM) (which is defined with -f already) everywhere.
Here are my diffs for src/exec/dxmods/Makefile.am and src/exec/libdx/local.mk:
Index: Makefile.am
===================================================================
RCS file: /src/master/dx/src/exec/dxmods/Makefile.am,v
retrieving revision 1.24
diff -c -r1.24 Makefile.am
*** Makefile.am 1999/11/03 20:25:21 1.24
--- Makefile.am 1999/12/09 20:29:47
***************
*** 6,14 ****
noinst_LIBRARIES = libDXMODS.a libusercm.a
SUFFIXES = .c .y .c .s .h .o
! BUILT_SOURCES = user.c _compparse.h y.tab.c usercm.c
! DISTCLEANFILES = y.tab.h _compparse.c _compparse.h dx.mdf dxcm.mdf user.c
usercm.c tmp.c
dxmdf_DATA = dx.mdf
--- 6,14 ----
noinst_LIBRARIES = libDXMODS.a libusercm.a
SUFFIXES = .c .y .c .s .h .o
! BUILT_SOURCES = _compparse.c _compparse.h user.c usercm.c
! DISTCLEANFILES = y.tab.c y.tab.h dx.mdf dxcm.mdf tmp.c $(BUILT_SOURCES)
dxmdf_DATA = dx.mdf
***************
*** 69,77 ****
vectorlist.c verify.c visualobject.c writeimage.c \
simplesurf.c dxmdf.src user.c \
_autocolor.c _autogray.c \
! _cat_util.c _color.c _colormap.c _complex.c \
_compoper.c _compoper1.c _compoper2.c _compcmplx.c \
! _compinput.c _compexec.c _compparse.y _compputils.c
SOURCES6 = \
_connectgrids.c _connectvor.c _construct.c _divcurl.c \
_getfield.c _gif.c _glyph.c _gradient.c \
--- 69,77 ----
vectorlist.c verify.c visualobject.c writeimage.c \
simplesurf.c dxmdf.src user.c \
_autocolor.c _autogray.c \
! _cat_util.c _color.c _colormap.c _compparse.y _complex.c \
_compoper.c _compoper1.c _compoper2.c _compcmplx.c \
! _compinput.c _compexec.c _compputils.c
SOURCES6 = \
_connectgrids.c _connectvor.c _construct.c _divcurl.c \
_getfield.c _gif.c _glyph.c _gradient.c \
***************
*** 113,136 ****
awk -f ../../../lib/mdf2c.awk < dx.mdf > user.c
dxcm.mdf: dxmdf.src
! -rm -f dxcm.mdf
cp dxmdf.src tmp.c
$(CPP) $(MDF) $(DEFS) tmp.c > dxcm.mdf
! -rm -f tmp.c
dx.mdf: dxmdf.src
! -rm -f dx.mdf
cp dxmdf.src tmp.c
$(CPP) $(MDF) $(DEFS) -DCPLUSPLUS_UI -DEXECUTIVE_MODS tmp.c > dx.mdf
! -rm -f tmp.c
y.tab.c: _compparse.y
$(YACC) -vd _compparse.y
! _compparse.c: y.tab.c
sed -e "s/yy/_dxfcc/g" -e "s/YY/_CC/g" y.tab.c > _compparse.c
-
- _compparse.h: y.tab.c
sed -e "s/yy/_dxfcc/g" -e "s/YY/_CC/g" y.tab.h > _compparse.h
--- 113,135 ----
awk -f ../../../lib/mdf2c.awk < dx.mdf > user.c
dxcm.mdf: dxmdf.src
! -$(RM) dxcm.mdf tmp.c
cp dxmdf.src tmp.c
$(CPP) $(MDF) $(DEFS) tmp.c > dxcm.mdf
! -$(RM) tmp.c
dx.mdf: dxmdf.src
! -$(RM) dx.mdf tmp.c
cp dxmdf.src tmp.c
$(CPP) $(MDF) $(DEFS) -DCPLUSPLUS_UI -DEXECUTIVE_MODS tmp.c > dx.mdf
! -$(RM) tmp.c
y.tab.c: _compparse.y
+ -$(RM) y.output
$(YACC) -vd _compparse.y
! _compparse.c _compparse.h: y.tab.c
sed -e "s/yy/_dxfcc/g" -e "s/YY/_CC/g" y.tab.c > _compparse.c
sed -e "s/yy/_dxfcc/g" -e "s/YY/_CC/g" y.tab.h > _compparse.h
Index: local.mk
===================================================================
RCS file: /src/master/dx/src/exec/libdx/local.mk,v
retrieving revision 1.1
diff -c -r1.1 local.mk
*** local.mk 1999/07/09 13:13:57 1.1
--- local.mk 1999/12/09 19:21:03
***************
*** 1,11 ****
SUFFIXES = .X .Z .h .m .c .o .s .i
.X.h: class.awk
! rm -f $*.h
sh ./class -h $*.X >$*.h
.X.c: class.awk
! rm -f $*.c
sh ./class -c $*.X > $*.c
buffer.c: buffer.Z
--- 1,11 ----
SUFFIXES = .X .Z .h .m .c .o .s .i
.X.h: class.awk
! $(RM) $*.h
sh ./class -h $*.X >$*.h
.X.c: class.awk
! $(RM) $*.c
sh ./class -c $*.X > $*.c
buffer.c: buffer.Z
***************
*** 15,21 ****
| sed -e '/^#/d' \
-e 's/INCLUDE2/#include/' \
-e 's/^pragma/#pragma/' > buffer.c
! rm -f __buffer.c
shade.c: shade.Z
sed -e 's/[ ][ ]*\$$/ $$/' shade.Z > __shade_.c
--- 15,21 ----
| sed -e '/^#/d' \
-e 's/INCLUDE2/#include/' \
-e 's/^pragma/#pragma/' > buffer.c
! $(RM) __buffer.c
shade.c: shade.Z
sed -e 's/[ ][ ]*\$$/ $$/' shade.Z > __shade_.c
***************
*** 25,31 ****
-e 's/DEFINE2/#define/' \
-e 's/INCLUDE2/#include/' \
-e 's/[^#]pragma/#pragma/' > shade.c
! rm -f __shade_.c
triangle.c: triangle.Z
sed -e 's/[ ][ ]*\$$/ $$/' triangle.Z > __triangle.c
--- 25,31 ----
-e 's/DEFINE2/#define/' \
-e 's/INCLUDE2/#include/' \
-e 's/[^#]pragma/#pragma/' > shade.c
! $(RM) __shade_.c
triangle.c: triangle.Z
sed -e 's/[ ][ ]*\$$/ $$/' triangle.Z > __triangle.c
***************
*** 43,49 ****
-e 's/DEFINE3/#define/' \
-e 's/INCLUDE3/#include/' \
-e 's/[^#]pragma/#pragma/' > triangle.c
! rm triangle1.c triangle2.c __triangle.c
quad.c: quad.Z
sed -e 's/[ ][ ]*\$$/ $$/' quad.Z > __quad.c
--- 43,49 ----
-e 's/DEFINE3/#define/' \
-e 's/INCLUDE3/#include/' \
-e 's/[^#]pragma/#pragma/' > triangle.c
! $(RM) triangle1.c triangle2.c __triangle.c
quad.c: quad.Z
sed -e 's/[ ][ ]*\$$/ $$/' quad.Z > __quad.c
***************
*** 61,67 ****
-e 's/DEFINE3/#define/' \
-e 's/INCLUDE3/#include/' \
-e 's/[^#]pragma/#pragma/' > quad.c
! rm quad1.c quad2.c __quad.c
plane.c: plane.Z
cp plane.Z _plane.c
--- 61,67 ----
-e 's/DEFINE3/#define/' \
-e 's/INCLUDE3/#include/' \
-e 's/[^#]pragma/#pragma/' > quad.c
! $(RM) quad1.c quad2.c __quad.c
plane.c: plane.Z
cp plane.Z _plane.c
***************
*** 70,73 ****
| sed -e '/^#/d' \
-e 's/INCLUDE2/#include/' \
-e 's/[^#]pragma/#pragma/' > plane.c
! rm _plane.c
--- 70,73 ----
| sed -e '/^#/d' \
-e 's/INCLUDE2/#include/' \
-e 's/[^#]pragma/#pragma/' > plane.c
! $(RM) _plane.c
> >
> > -- ddj
> >
> > Dave Johnson
> > Brown University TCASCV
> > [EMAIL PROTECTED]
>
-- ddj