简体   繁体   中英

Makefile - what does “>” mean?

i am trying to learn this Book: "Managing Projects with GNU Make". there is an example with this Makefile:

count_words: count_words.o lexer.o -lfl
    gcc counter_words.o lexer.o -lfl -o count_words

count_words.o: count_words.c
    gcc -c count_words.c

lexer.o: lexer.c
    gcc -c lexer.c

lexer.c: lexer.l
    flex -t lexer.l > lexer.c

i totally dont understand this line

flex -t lexer.l > lexer.c

what does the character ">" mean in this case? And what is .l ?

That's an output redirection . It means the output of the flex -t lexer.l command will be written in the file lexer.c .

I can't comment, so I have to answer. I want to address the .l part, The .l files are the sources for flex that generate .c files

The > is a output redirector. See Miklos' answer for more on that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM