# /usr/src/bin/make/Makefile for MacMach

include /usr/src/COPYRIGHTS

CFLAGS=	-O -DASCARCH
LIBC=	/lib/libc.a
SRCS=	main.c doname.c misc.c files.c dirs.c libs.c rules.c \
	dosys.c gram.c dyndep.c
OBJS=	main.o doname.o misc.o files.o dirs.o libs.o rules.o \
	dosys.o gram.o dyndep.o

all:	.depend make

make:	${OBJS} ${LIBC}
	${CC} -o $@ ${CFLAGS} ${OBJS}

gram.c:	gram.y
	yacc gram.y
	mv y.tab.c gram.c

install: FRC
	install -c -s -o bin -g bin -m 755 make ${DESTDIR}/bin/make

clean:	FRC
	rm -f .depend ${OBJS} core make gram.c

compress: clean
	find . -type f ! -name Makefile ! -name '*.Z' -exec compress {} \;

uncompress: FRC
	find . -type f ! -name Makefile -name '*.Z' -exec uncompress {} \;

.depend: gram.c ${SRCS}
	@echo "#`date`" >.depend
	mkdep -f .depend ${CFLAGS} gram.c ${SRCS}

-include .depend

FRC:
