LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-16-2009, 04:31 PM   #1
garvey
LQ Newbie
 
Registered: Oct 2005
Location: Cork, Ireland
Posts: 4

Rep: Reputation: 0
makefile problem with gcc bison/flex on ubuntu


I presently have a compiler to write with Flex and Bison.
I have a lex.l file, and a parse.y in which there are no conflicts.
I also have a symtable.h included.

I have a makefile as follows...
============================================================
project: parse.tab.o lex.yy.o
echo ---> compiling and linking project program
cc -DYYDEBUG=1 -o project parse.tab.o lex.yy.o -ly -ll -lm

lex.yy.o: lex.yy.c parse.tab.h # the dependencies of lex.yy.o the lexer object
echo ---> determining dependency for lex.yy.o

lex.yy.o parse.tab.o: symtable.h #just declares that symtable.h is a dependency to both
echo ---> determining symtable.h dependency for lex.yy.o parse.tab.o

parse.tab.c parse.tab.h: parse.y # THE PARSE C AND H FILES MADE... OK to here
echo ---> making parse.tab.c and parse.tab.h
bison -d parse.y

lex.yy.c : lex.l # THE LEX C FILE MADE
echo ---> making lexfile
flex lex.l

============================================================
When I run it, I get the following output. The line numbers don't actually correspond. Could you advise as to how the makefile should be written to not have any error?
============================================================
joe@BlueAcer:/usr/local/project/chk$ make
makefile:9: warning: overriding commands for target `lex.yy.o'
makefile:6: warning: ignoring old commands for target `lex.yy.o'
echo ---> determining symtable.h dependency for lex.yy.o parse.tab.o
echo ---> making lexfile
flex lex.l
echo ---> making parse.tab.c and parse.tab.h
bison -d parse.y
echo ---> determining symtable.h dependency for lex.yy.o parse.tab.o
echo ---> compiling and linking project program
cc -DYYDEBUG=1 -o project parse.tab.o lex.yy.o -ly -ll -lm
cc: parse.tab.o: No such file or directory
cc: lex.yy.o: No such file or directory
make: *** [project] Error 1
joe@BlueAcer:/usr/local/project/chk$
============================================================
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Do flex and bison support C++? ankit4u1 Programming 7 08-08-2011 04:56 PM
installing bison and flex rameshsena Linux - Software 10 06-21-2010 11:33 AM
bison / flex zaman Programming 1 08-16-2005 10:19 AM
Problem with binutils first pass / bison & flex installation peristaltic Linux From Scratch 3 03-20-2005 10:17 AM
bison, flex and make problem ChimpFace9000 Programming 4 05-19-2002 07:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration