rakitzis / rc

rc shell -- independent re-implementation for Unix of the Plan 9 shell (from circa 1992)
Other
257 stars 23 forks source link

Build error #85

Closed aksr closed 1 year ago

aksr commented 1 year ago

parse.tab.c:102:10: fatal error: parse.tab.h: No such file or directory compilation terminated. make: *** [GNUmakefile:80: parse.o] Error 1

rakitzis commented 1 year ago

What platform is this? You should have seen this step:

echo "GEN parse.c"
yacc -b parse -d parse.y
mv parse.tab.c parse.c
mv parse.tab.h parse.h

A fuller error report would be helpful here.

xyb3rt commented 1 year ago

Please make sure to run make with V=1 when posting its output.

aksr commented 1 year ago

ArchLinux, make (4.4.1), bison (3.8.2)

$ make V=1
CC mksignal
cc -I. -I. -I/usr/local/include  -Wall  -o mksignal mksignal.c
GEN sigmsgs.c
./mksignal
CC builtins.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o builtins.o builtins.c
CC edit-null.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o edit-null.o edit-null.c
CC except.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o except.o except.c
CC exec.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o exec.o exec.c
CC fn.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o fn.o fn.c
CC footobar.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o footobar.o footobar.c
CC getopt.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o getopt.o getopt.c
CC glob.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o glob.o glob.c
CC glom.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o glom.o glom.c
CC hash.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o hash.o hash.c
CC heredoc.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o heredoc.o heredoc.c
CC input.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o input.o input.c
GEN parse.c
yacc -b parse -d parse.y
parse.y:40.15-19: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
   40 | %type <redir> REDIR SREDIR
      |               ^~~~~
parse.y:40.21-26: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
   40 | %type <redir> REDIR SREDIR
      |                     ^~~~~~
parse.y:41.14-17: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
   41 | %type <pipe> PIPE
      |              ^~~~
parse.y:42.13-15: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
   42 | %type <dup> DUP
      |             ^~~
parse.y:43.14-17: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
   43 | %type <word> WORD
      |              ^~~~
mv parse.tab.c parse.c
mv parse.tab.h parse.h
CC lex.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o lex.o lex.c
CC list.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o list.o list.c
GEN version.h
v="$(cd . && git describe --always 2>/dev/null || true)"; \
echo "#define VERSION \"${v:-1.7.4}\"" >version.h
CC main.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o main.o main.c
CC match.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o match.o match.c
CC nalloc.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o nalloc.o nalloc.c
CC open.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o open.o open.c
CC parse.o
cc -I. -I. -I/usr/local/include  -Wall  -c -o parse.o parse.c
parse.tab.c:102:10: fatal error: parse.tab.h: No such file or directory
compilation terminated.
make: *** [Makefile:44: parse.o] Error 1
$ 
xyb3rt commented 1 year ago

You need to install byacc and call make with YACC=byacc. I will make this more explicit in the Makefile or README.

xyb3rt commented 1 year ago

Since commit 554ccf5 byacc is not need anymore when simply building and installing rc.