52 lines
1.4 KiB
Makefile
52 lines
1.4 KiB
Makefile
CC := gcc
|
|
FLEX := flex
|
|
LEX := lexicalStructure.lex
|
|
EXE := alpha
|
|
CFLAGS :=
|
|
|
|
compiler: lex.yy.c runner.o runner
|
|
|
|
lex.yy.c: lexicalStructure.lex
|
|
$(FLEX) -o lex.yy.c $(LEX)
|
|
|
|
runner.o: runner.c runner.h flex.h
|
|
$(CC) $(CFLAGS) -o runner.o -c runner.c
|
|
|
|
symbol.o: symbol_table.c symbol_table.h
|
|
$(CC) $(CFLAGS) -o symbol_table.o symbol_table.c
|
|
|
|
runner: lex.yy.c runner.o symbol_table.o
|
|
$(CC) $(CFLAGS) -o $(EXE) runner.o lex.yy.c symbol_table.o
|
|
|
|
bison: grammar.y
|
|
bison -d grammar.y
|
|
|
|
debug: CFLAGS += -DDEBUG=1
|
|
debug: clean compiler
|
|
|
|
test:
|
|
./$(EXE) -tok ./tests/sprint1/test_comment_fix1.alpha
|
|
./$(EXE) -tok ./tests/sprint1/test_comment_fix2.alpha
|
|
./$(EXE) -tok ./tests/sprint1/test_comment_issues.alpha
|
|
./$(EXE) -tok ./tests/sprint1/test_comments.alpha
|
|
./$(EXE) -tok ./tests/sprint1/test_general_token.alpha
|
|
./$(EXE) -tok ./tests/sprint1/test_keywords.alpha
|
|
./$(EXE) -tok ./tests/sprint1/test_operators.alpha
|
|
./$(EXE) -tok ./tests/sprint1/test_other_punc.alpha
|
|
./$(EXE) -tok ./tests/sprint1/test_punc_grouping.alpha
|
|
./$(EXE) -tok ./tests/sprint1/test_real_alpha_file1.alpha
|
|
./$(EXE) -tok ./tests/sprint1/test_real_alpha_file2.alpha
|
|
./$(EXE) -tok ./tests/sprint1/test_simple_int.alpha
|
|
./$(EXE) -tok ./tests/sprint1/test_simple_literals.alpha
|
|
./$(EXE) -tok ./tests/sprint1/test_variables.alpha
|
|
|
|
clean:
|
|
rm -f *.o
|
|
rm -f lex.yy.c
|
|
rm -f $(EXE)
|
|
rm -f flex.h
|
|
rm -f *.tok
|
|
rm -f grammar.tab.c
|
|
rm -f grammar.tab.h
|
|
rm -f *.st
|
|
rm -rf out
|