Projet-Systemes-Informatiques/compilateur/Makefile
Raphaël LACROIX 5e4be22e3d big overhaul
2023-05-31 23:20:18 +02:00

36 lines
590 B
Makefile

GRM=yacc.y
LEX=lex.l
BIN=out
CC=gcc
CFLAGS=-Wall -g
OBJ=yacc.tab.o lex.yy.o table.o operations.o blocs.o asmTable.o
asm: $(BIN)
@touch ../tests/testFile # to prevent an error in case of deletion
./out < ../tests/testFile
build: $(BIN)
%.o: %.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
yacc.tab.c: $(GRM)
bison -d -t -v $<
lex.yy.c: $(LEX)
flex $<
$(BIN): $(OBJ)
$(CC) $(CFLAGS) $(CPPFLAGS) $^ -o $@
clean:
rm $(OBJ) yacc.tab.c yacc.tab.h lex.yy.c
vhdl: clean asm
python3 ../cross-Compiler/cross-compiler.py
inter: clean asm
python3 ../interpreter/graph_interpreter.py