From 17d1dc726928760da8569e320b8627ccca2b5656 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Fri, 29 Dec 2023 05:05:17 +0300 Subject: [PATCH] Makefile: restruct Signed-off-by: HeshamTB --- .gitignore | 2 +- Makefile | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 5e2baad..c131ff7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -a.out +hcc # File generated by flex and bison parser.c diff --git a/Makefile b/Makefile index f05f7a7..7098e01 100644 --- a/Makefile +++ b/Makefile @@ -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 --defines=token.h --output=parser.c parser.bison + bison --debug --defines=token.h --output=parser.c parser.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 + +