Trouble with flex command in makefile


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Trouble with flex command in makefile
# 1  
Old 12-17-2009
Trouble with flex command in makefile

Hey all, im trying to create a makefile in unix. cpp2html is a program created from the files cpp2html.o and lex.yy.o.
cpp2html.o is created from compiling cpp2html.c and lex.yy.o is created from another created file lex.yy.c. and lex.yy.c is created from a command "flex cppscanner.l" and here is what i have so far

Code:
cpp2html: cpp2html.o lex.yy.o 
	gcc -g -DDEBUG cpp2html.o lex.yy.o
	mv a.out cpp2html
 
cpp2html.o: cpp2html.c
	gcc -g -DDEBUG -c cpps2html.c
 
lex.yy.o: lex.yy.c
	gcc -g -DDEBUG -c lex.yy.c


i do not know where to implement the command "flex cppscanner.l" to make the file lex.yy.c any suggestions would be great

Last edited by pludi; 12-18-2009 at 03:13 AM.. Reason: code tags, please...
# 2  
Old 12-18-2009
add:

Code:
lex.yy.c: cppscanner.l
        flex cppscanner.l

right before the lex.yy.c line.
Make sure that the word "flex" is proceeded by a TAB only.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Trouble using awk command

Hi, I have 2 .txt pads containing data. I need a script which reads content of one .txt file, performs some operations and calculates a number which is stored in a variable. Now , all the content of another .txt pad should be appended to first .txt pad at pre calculated nth line number. ... (4 Replies)
Discussion started by: Ravindra Swan
4 Replies

2. Shell Programming and Scripting

Trouble with awk command

Hi, I need to read a string with ; separated using loop one filed by one field and perform some operation. Can you please check and let me know how to print command parameterised. key=phani;ravi;kiran number_of_keys=`echo $key|awk '{print NF}' FS=';'` for (( i = 1; i <= $number_of_keys;... (4 Replies)
Discussion started by: Ravindra Swan
4 Replies

3. Shell Programming and Scripting

Command pipeline trouble

Hello, I am attempting to ssh to a server and run a set of commands on a remote set of servers. I am getting the following error below, I am thinking quotes may be the problem. This command works on the local machine in bash. Not when I ssh to a remote server. Basically the command should... (3 Replies)
Discussion started by: jaysunn
3 Replies

4. Shell Programming and Scripting

[Solved] Command execution in Makefile

Linux Gurus, I have a query regarding the execution of a complex command in the makefile of the current system. I am currently using shell command in the makefile to execute the command. However my command fails as it is a combination of a many commands and execution collects a huge data...... (4 Replies)
Discussion started by: satishkumar432
4 Replies

5. Shell Programming and Scripting

bash command in makefile (cygwin)

Hello, In my make file (make 3.81), I use a combination of shell commands to automatically create the name of my build directory. OS := $(shell uname -s) ARCH := $(shell uname -m) KERN := $(shell uname -r | cut -d. -f 1,2) BDIR := $(OS)_$(KERN).$(ARCH)When I boot into different OSs, I... (7 Replies)
Discussion started by: LMHmedchem
7 Replies

6. Homework & Coursework Questions

Help with Simple Multi-Level Makefile (Extremely New at Makefile)

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Basically, the prompt is make a makefile with various sub makefiles in their respective subdirectories. All code... (1 Reply)
Discussion started by: Tatl
1 Replies

7. UNIX for Dummies Questions & Answers

Trouble with the Source command..

Hi everyone, I've been writing a script as an assignment which essentially does the exact same thing as the tree -d function (bash shell btw), except next to every directory name it gives a number which you can input into the same command in order to change the current working directory to the... (1 Reply)
Discussion started by: petey22uk
1 Replies

8. UNIX for Advanced & Expert Users

Makefile problem - How to run module load in a Makefile

Hi, I'm trying to run the module load command in a Makefile and i'm getting the following error: make: module: command not found Why is this? Is there any way to run this command in a Makefile? NOTE: command - module load msjava/sunjdk/1.5.0 works fine outside of the Makefile (2 Replies)
Discussion started by: hernandinho
2 Replies

9. Programming

my problems with MAKEFILE command

Hi everyone. I'm a newbies in using c++ in UNIX. And since then I only do maintenance coding not development. so far i understand c++ coding and OOP concepts. currently i'm working onsomething for maintenance purpose.here's the situation : below are my files : source files: advDisc.cpp ... (2 Replies)
Discussion started by: aliasunway
2 Replies

10. Shell Programming and Scripting

trouble using mailx command

Hi. I have been trying to send mail using the mailx command. I also tryed to use the mail command. The thing is that when I try to send the email, i receive automatically to my mailbox a DAEMON response sayng that the mailhost is unknown... The syntax I am using is this: $mailx -s "this... (2 Replies)
Discussion started by: ldrojasm
2 Replies
Login or Register to Ask a Question