Makefile: restruct

Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
HeshamTB 2023-12-29 05:05:17 +03:00
parent dfd72482ac
commit 17d1dc7269
2 changed files with 18 additions and 5 deletions

2
.gitignore vendored
View File

@ -1,5 +1,5 @@
a.out hcc
# File generated by flex and bison # File generated by flex and bison
parser.c parser.c

View File

@ -1,9 +1,22 @@
all: flex bison
gcc expr.c parser.c scanner.c main.c SRC=
all: scanner.c parser.c token.h
gcc -o hcc expr.c parser.c scanner.c main.c
scanner.c: flex
parser.c: bison
token.h: bison
bison: bison:
bison --defines=token.h --output=parser.c parser.bison bison --debug --defines=token.h --output=parser.c parser.bison
flex: bison flex: bison
flex -o scanner.c scanner.flex flex --debug -o scanner.c scanner.flex
clean:
rm -vf parser.c scanner.c hcc token.h