Below is the file 'src/lsc/Makefile' from this revision. You can also download the file.

# Makefile

PREFIX?=	/usr/local

OBJS=	lexer.o parser.o ast.o codegen.o
SRCS=	ast.c codegen.c

COMMONOBJS=	mem.o hash.o
COMMONDIR=	../common

INCDIR=../include

PROGOBJS=	${OBJS} ${COMMONOBJS:S/^/${COMMONDIR}\//}

YACC=	yacc -d

CFLAGS+=	-Wall -Werror
CPPFLAGS+=	-I${INCDIR}


lsc: ${OBJS}
	${LINK.c} -o ${.TARGET} ${PROGOBJS}

y.tab.h: parser.o

lexer.o: lexer.l y.tab.h types.h

parser.o: parser.y ast.h types.h codegen.h


install: lsc
	${INSTALL} -d ${PREFIX}/bin
	${INSTALL} -c lsc ${PREFIX}/bin/lsc

depend:
	mkdep -- ${CFLAGS} ${CPPFLAGS} ${SRCS}

clean:
	rm -f ${OBJS} lsc y.tab.h