# Makefile
TGT  = spl.exe
HSRC = common.h expr.h expr_opr.h list.h parser.h refobj.h scanner.h stmt.h varstore.h
OBJS = app.o common.o list.o parser.o refobj.o scanner.o varstore.o
OBJS += expr_arith.o expr_comp.o expr_num.o expr_opr.o expr_var.o
OBJS += stmt_assignment.o stmt_compound.o stmt_if.o stmt_read.o stmt_while.o stmt_write.o
LIBS = libregex.a # none for Linux and Mac; libregex.a for Windows

RM   = del  # rm for Linux and Mac, del for Windows
TRUE = cd . # true for Linux and Mac, cd . for Windows

.SUFFIXES:          # reset all suffixes
.SUFFIXES: .c .o	# suffixes to consider

# convert .c to .o
.c.o:; gcc -c $< -o $@	

$(TGT): $(HSRC) $(OBJS)
	gcc -o $@ $(OBJS) $(LIBS)

clean:
	$(RM) *.o | $(TRUE)
