Fixed formatting in lex; Updated Makefile t#30
This commit is contained in:
25
Makefile
25
Makefile
@ -5,8 +5,7 @@ EXE := alpha
|
||||
CFLAGS :=
|
||||
YACC := bison
|
||||
|
||||
compiler: tmp/grammar.tab.c tmp/lex.yy.c tmp/runner.o tmp/symbol_table.o
|
||||
$(CC) $(CFLAGS) -o $(EXE) tmp/runner.o tmp/lex.yy.c tmp/symbol_table.o
|
||||
compiler: runner
|
||||
|
||||
tmp/grammar.tab.c: src/grammar.y
|
||||
mkdir -p tmp
|
||||
@ -14,7 +13,7 @@ tmp/grammar.tab.c: src/grammar.y
|
||||
mv grammar.tab.c tmp/
|
||||
mv grammar.tab.h tmp/
|
||||
|
||||
tmp/lex.yy.c: src/lexicalStructure.lex
|
||||
tmp/lex.yy.c: src/lexicalStructure.lex tmp/grammar.tab.c
|
||||
$(FLEX) -o tmp/lex.yy.c $(LEX)
|
||||
mv flex.h tmp/
|
||||
|
||||
@ -25,21 +24,17 @@ tmp/symbol_table.o: src/symbol_table.c src/symbol_table.h
|
||||
$(CC) $(CFLAGS) -o tmp/symbol_table.o -c src/symbol_table.c
|
||||
|
||||
parser : tmp/lex.yy.c tmp/grammar.tab.c
|
||||
$(CC) -o parser tmp/lex.yy.c tmp/grammar.tab.c src/symbol_table.c
|
||||
$(CC) -o parser tmp/lex.yy.c tmp/grammar.tab.c
|
||||
|
||||
runner: tmp/lex.yy.c tmp/runner.o tmp/symbol_table.o
|
||||
$(CC) $(CFLAGS) -o $(EXE) tmp/runner.o tmp/lex.yy.c tmp/symbol_table.o
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
debug: CFLAGS += -DDEBUG=1
|
||||
debug: clean compiler
|
||||
|
||||
test:
|
||||
test: test-s1 test-s2
|
||||
|
||||
test-s1:
|
||||
./$(EXE) -tok ./tests/sprint1/test_comment_fix1.alpha
|
||||
./$(EXE) -tok ./tests/sprint1/test_comment_fix2.alpha
|
||||
./$(EXE) -tok ./tests/sprint1/test_comment_issues.alpha
|
||||
@ -55,6 +50,11 @@ test:
|
||||
./$(EXE) -tok ./tests/sprint1/test_simple_literals.alpha
|
||||
./$(EXE) -tok ./tests/sprint1/test_variables.alpha
|
||||
|
||||
test-s2:
|
||||
./$(EXE) -tok ./tests/sprint2/alpha/test_library.alpha
|
||||
./$(EXE) -tok ./tests/sprint2/alpha/test_one_line.alpha
|
||||
./$(EXE) -tok ./tests/sprint2/alpha/test_simple.alpha
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
rm -f lex.yy.c
|
||||
@ -65,4 +65,5 @@ clean:
|
||||
rm -f grammar.tab.h
|
||||
rm -f *.st
|
||||
rm -rf out
|
||||
rm -rf tmp
|
||||
rm -rf tmp
|
||||
rm -f parser
|
Reference in New Issue
Block a user