Calling flex from a makefile

前端 未结 4 1277
醉酒成梦
醉酒成梦 2021-01-28 10:39

I would like to call flex to build a .l file, then call gcc to build everything.

I tryed:

comp:
    lex scanner.l   \\
    gcc -o a.out main.c hash.c -I.         


        
4条回答
  •  孤街浪徒
    2021-01-28 11:13

    all: a.out
    
    lex.yy.c: scanner.l
        lex scanner.l
    
    a.out: lex.yy.c main.c hash.c
        gcc -o a.out main.c hash.c -I.  
    

提交回复
热议问题