# Makefile for bsd/lib/libc/regex.

CC	= false
ARCH	= eniac
CFLAGS	= -O9 -I/usr/include/bsdcompat
CC1	= $(CC) -m$(ARCH) $(CFLAGS) -c

LIBBSD	= /usr/lib/$(CC)/$(ARCH)/libbsd.a
MAN	= /usr/man

all:	$(LIBBSD) man

BSDOBJ	= \
	$(LIBBSD)(regcomp.o) \
	$(LIBBSD)(regerror.o) \
	$(LIBBSD)(regexec.o) \
	$(LIBBSD)(regfree.o) \

$(LIBBSD):	$(BSDOBJ)
	$(CC) -c.a -o $@ *.o
	rm *.o

$(LIBBSD)(regcomp.o):	regcomp.c
	$(CC1) regcomp.c

$(LIBBSD)(regerror.o):	regerror.c
	$(CC1) regerror.c

$(LIBBSD)(regexec.o):	regexec.c
	$(CC1) regexec.c

$(LIBBSD)(regfree.o):	regfree.c
	$(CC1) regfree.c

man:	\
	$(MAN)/man3/regex.3 \
	$(MAN)/man7/re_format.7 \

$(MAN)/man3/regex.3:	regex.3
	install -lc $? $@

$(MAN)/man7/re_format.7:	re_format.7
	install -lc $? $@
