added makefile for text.l

This commit is contained in:
Sven Vogel 2023-11-22 13:01:00 +01:00
parent 514d7ab010
commit af2106a48f
1 changed files with 22 additions and 0 deletions

22
Makefile Normal file
View File

@ -0,0 +1,22 @@
BUILDDIR = build
TARGET_SRC = main
build: mkdir main
all: mkdir main run
mkdir: # create build directory
mkdir -p $(BUILDDIR)
run: # run binary
./$(BUILDDIR)/main
main: lex.yy.c
cc $(BUILDDIR)/lex.yy.c -o $(BUILDDIR)/$(TARGET_SRC) -lfl
# generate c file for lex
lex.yy.c:
flex -o $(BUILDDIR)/lex.yy.c $(TARGET_SRC).l
clean: # wipe the build directory
rm -f $(BUILDDIR)/*