head	1.1;
access;
symbols;
locks; strict;
comment	@# @;


1.1
date	2016.06.09.06.24.33;	author agc;	state Exp;
branches;
next	;
commitid	adANbNSKR1gwVK9z;


desc
@@


1.1
log
@Add a small lib and utility program to convert a basic regular expression into
an extended one. For more information on regexp specifications, please see
re_format(7).

The library implements a single routine called regextend(3), which implements
a simple codec-style transformation from basic to extended regular expression.
This can be useful for regular expression implementations which do not
implement basic regular expressions.
@
text
@# $NetBSD: Makefile,v 1.2 2011/09/01 05:07:12 agc Exp $

.include <bsd.own.mk>

PROG=		regextend
SRCS=		main.c
BINDIR=		/usr/bin

CPPFLAGS+=	-I${.CURDIR}/../dist/

LIB_REGEXTEND_DIR!=	cd ${.CURDIR}/../lib && ${PRINTOBJDIR}
LDADD+=		-L${LIB_REGEXTEND_DIR} -lregextend
DPADD+=		${LIB_REGEXTEND_DIR}/libregextend.a

.ifndef PRODUCTION
CPPFLAGS+=-g -O0
LDFLAGS+=-g -O0
.endif

MAN=		regextend.1

WARNS=		5

.PATH: ${.CURDIR}/../dist

.include <bsd.prog.mk>

t: ${PROG}
	@@echo "1. basics"
	env LD_LIBRARY_PATH=${LIB_REGEXTEND_DIR} ./${PROG} 'PR.*G+|{}()' > 1.out
	diff 1.expected 1.out
	rm -f 1.out
	@@echo "2. delimiters"
	env LD_LIBRARY_PATH=${LIB_REGEXTEND_DIR} ./${PROG} 'PR.*G+|{}()\{\}\(\)' > 2.out
	diff 2.expected 2.out
	rm -f 2.out
	@@echo "3. delimiters"
	env LD_LIBRARY_PATH=${LIB_REGEXTEND_DIR} ./${PROG} '^PR.*G+|{}()\{\}\(\)^$$.*end$$' > 3.out
	diff 3.expected 3.out
	rm -f 3.out
	@@echo "4. * at start"
	env LD_LIBRARY_PATH=${LIB_REGEXTEND_DIR} ./${PROG} '*^PR.*G+|{}()\{\}\(\)^$$.*end$$' > 4.out
	diff 4.expected 4.out
	rm -f 4.out
@
