Projet-Systemes-Informatiques/Makefile
2023-04-13 11:01:17 +02:00

31 lines
403 B
Makefile

GRM=yacc.y
LEX=lex.l
BIN=out
CC=gcc
CFLAGS=-Wall -g
OBJ=yacc.tab.o lex.yy.o table.o
all: $(BIN)
@touch testFile # to prevent an error in case of deletion
./out < testFile
build: $(BIN)
%.o: %.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
yacc.tab.c: $(GRM)
bison -d $<
lex.yy.c: $(LEX)
flex $<
$(BIN): $(OBJ)
$(CC) $(CFLAGS) $(CPPFLAGS) $^ -o $@
clean:
rm $(OBJ) y.tab.c y.tab.h lex.yy.c