mirror of
https://github.com/iritmaximus/ttk91-compiler.git
synced 2026-10-12 19:13:40 +03:00
made adding files easier to makefile
This commit is contained in:
+5
-1
@@ -4,6 +4,10 @@ CC_FLAGS=-O2 -Wall -Wextra
|
||||
SRCDIR=src
|
||||
INCLUDEDIR=include
|
||||
|
||||
FILES=$(SRCDIR)/main.c \
|
||||
$(SRCDIR)/scanner.c \
|
||||
$(SRCDIR)/parser.c
|
||||
|
||||
scanner:
|
||||
# this is case insensitive!!
|
||||
flex -i -o $(SRCDIR)/scanner.c $(SRCDIR)/scanner.flex
|
||||
@@ -12,4 +16,4 @@ parser:
|
||||
bison --defines=$(INCLUDEDIR)/token.h --output=$(SRCDIR)/parser.c $(SRCDIR)/parser.bison -Wcounterexamples
|
||||
|
||||
all: scanner parser
|
||||
$(CC) $(CC_FLAGS) -I$(INCLUDEDIR) $(SRCDIR)/main.c $(SRCDIR)/scanner.c $(SRCDIR)/parser.c -o compiler
|
||||
$(CC) $(CC_FLAGS) -I$(INCLUDEDIR) $(FILES) -o compiler
|
||||
|
||||
Reference in New Issue
Block a user