parser/Makefile
changeset 37 0fbbe329c3a2
parent 36 f52a9deddfc0
child 38 48f6f3918b82
equal deleted inserted replaced
36:f52a9deddfc0 37:0fbbe329c3a2
     1 CC=gcc
       
     2 LD=ld
       
     3 YACC=bison -y
       
     4 FLEX=flex
       
     5 CFLAGS=-Wall -O2 -ansi 
       
     6 LDFLAGS=
       
     7 INCLUDE=include
       
     8 OBJECTS=main.o parser.o lexer.o
       
     9 TARGET=parser
       
    10 
       
    11 .SUFFIXES: .c .yy .ll
       
    12 
       
    13 .c.o: 
       
    14 	$(CC) -c $(CFLAGS) -I$(INCLUDE) $(CONFIG) $<
       
    15 
       
    16 .yy.c:
       
    17 	$(YACC) -d $< -o $@
       
    18 
       
    19 .ll.c:
       
    20 	$(FLEX) -o $@ $<
       
    21 
       
    22 all: $(TARGET)
       
    23 
       
    24 
       
    25 $(TARGET): $(OBJECTS)
       
    26 	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) -o $@
       
    27 
       
    28 .PHONY: distclean clean
       
    29 
       
    30 clean:
       
    31 	rm -f *.[oae];
       
    32 	rm -f *~;
       
    33 
       
    34 distclean:
       
    35 	make clean
       
    36 	rm -f $(TARGET)