52 lines
1.3 KiB
Makefile
52 lines
1.3 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
|
|
|
|
runner: lex.yy.c runner.o
|
|
$(CC) $(CFLAGS) -o $(EXE) runner.o lex.yy.c
|
|
|
|
bison: grammar.y
|
|
bison -d grammar.y
|
|
|
|
debug: CFLAGS += -DDEBUG=1
|
|
debug: clean compiler
|
|
|
|
test:
|
|
./$(EXE) ./tests/test_comments.alpha
|
|
./$(EXE) ./tests/test_generalTokenTest.alpha
|
|
./$(EXE) ./tests/test_keywords.alpha
|
|
./$(EXE) ./tests/test_operators.alpha
|
|
./$(EXE) ./tests/test_otherpunc.alpha
|
|
./$(EXE) ./tests/test_simpleIntTest.alpha
|
|
./$(EXE) ./tests/test_simpleLiterals.alpha
|
|
./$(EXE) ./tests/test_real_alpha_file.alpha
|
|
./$(EXE) ./tests/test_real_alpha_2.alpha
|
|
./$(EXE) -tok ./tests/test_comments.alpha
|
|
./$(EXE) -tok ./tests/test_generalTokenTest.alpha
|
|
./$(EXE) -tok ./tests/test_keywords.alpha
|
|
./$(EXE) -tok ./tests/test_operators.alpha
|
|
./$(EXE) -tok ./tests/test_otherpunc.alpha
|
|
./$(EXE) -tok ./tests/test_simpleIntTest.alpha
|
|
./$(EXE) -tok ./tests/test_simpleLiterals.alpha
|
|
./$(EXE) -tok ./tests/test_real_alpha_file.alpha
|
|
./$(EXE) -tok ./tests/test_real_alpha_2.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
|