Skip to content

Commit

Permalink
add windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvrajsab committed Jun 6, 2021
1 parent 1962274 commit 51a8ee8
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,34 @@ LFLAGS =
YACC = yacc
YFLAGS = -yvd
CC = gcc
CFLAGS =
CFLAGS = -O2

LFILE = update.l
YFILE = update.y

OUTBIN = a.out
ifeq ($(OS),Windows_NT)
OUTBIN = a.exe
endif

default: run

clean:
rm -f lex.yy.c y.* a.out query.txt
rm -f lex.yy.c y.* $(OUTBIN) query.txt

lex.yy.c: $(LFILE)
$(LEX) $(LFLAGS) $(LFILE)

y.tab.c: $(YFILE)
$(YACC) $(YFLAGS) $(YFILE)

a.out: lex.yy.c y.tab.c y.tab.h
createbin: lex.yy.c y.tab.c y.tab.h
$(CC) $(CFLAGS) lex.yy.c y.tab.c

build: clean a.out
build: clean createbin

test: a.out
./a.out TEST
test: createbin
./$(OUTBIN) TEST

run: a.out
./a.out
run: createbin
./$(OUTBIN)

0 comments on commit 51a8ee8

Please sign in to comment.