Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!rutgers!pbox!okstate!gregg From: gregg@a.cs.okstate.edu (Gregg Wonderly) Newsgroups: comp.sources.bugs Subject: Re: watcher (v11i082) missing y.tab.h Message-ID: <2784@okstate.UUCP> Date: Tue, 3-Nov-87 10:29:57 EST Article-I.D.: okstate.2784 Posted: Tue Nov 3 10:29:57 1987 Date-Received: Sat, 7-Nov-87 08:54:27 EST References: <4759@elroy.Jpl.Nasa.Gov> Organization: Oklahoma State Univ., Stillwater Lines: 41 > > In article <18476@teknowledge-vaxc.ARPA> mkhaw@teknowledge-vaxc.ARPA writes: >The watcher program has a defs.h file that #include's "y.tab.h", but >there is no y.tab.h in the distribution, and the MANIFEST file doesn't >mention it either. Make terminates (very early) with an error because >y.tab.h is missing. > YACC(1) generates this file, and one of the biggest mistakes some makefile authors make is to not put sufficient information in the makefile to tell MAKE(1) how to create it. The easist thing to do is to move y.tab.o, in the list of OBJ's, to the beginning of the list. MAKE(1) always processes dependents from left to right, so this assures that y.tab.h will be generated by YACC(1) before the other modules are compiled. Better yet, you should always provide sufficent information to MAKE(1) so that it does not ever say "make: don't know how to make y.tab.h". e.g. ================================== OBJ=yacc.o lex.o prog.o util.o SOURCES=yacc.y lex.l prog.c util.c YFLAGS=-d CFLAGS=-DDEBUG prog: $(OBJ) cc $(OBJ) -o prog lex.o: y.tab.h y.tab.h: yacc.o $(OBJ): header.h ================================== -------------- Gregg Wonderly Department of Computing and Information Sciences Oklahoma State University UUCP: {cbosgd, ihnp4, rutgers}!okstate!gregg ARPA: gregg@A.CS.OKSTATE.EDU IBM: Yesterday's technology, tomorrow, for incredible prices