# Makefile for the GNU regular expression library
# 1989 Edwin Hoogerbeets
#
# This file may be copied and distributed under the GNU Public
# Licence. See the comment at the top of regex.c for details.
#
# Adapted from Elib by Jim Mackraz and mklib by Edwin Hoogerbeets.
#

CFLAGS=+L -DAMIGA
#-n
LNFLAGS=
#-g

LOBJS=startup.o rtag.o interface.o library.o regex.o malloc.o
LIBOBJS=link.o lib2.o lib1.o
ALIBOBJS=alink.o lib2.o lib1.o

all: regex.library regex.lib tester tinygrep

regex.library: $(LOBJS)
        ln $(LNFLAGS) $(LOBJS) -lc32 -o $@

regex.lib: $(LIBOBJS)
        lb $@ $(LIBOBJS)

aregex.lib: $(ALIBOBJS)
        lb $@ $(ALIBOBJS)

tester: regex.lib tester.o
        ln $(LNFLAGS) tester.o -lregex -lc32 -o $@

tinygrep: regex.lib tinygrep.o
        ln $(LNFLAGS) tinygrep.o -lregex -lc32 -o $@

malloctest: m.o
        ln $(LNFLAGS) m.o -lc32 -o $@

m.o:
        cc $(CFLAGS) -DTESTMALLOC malloc.c -o $@

#
# Flush option only valid on ARP avail command. Used to expunge all
# used libraries, allowing the new regex.library to be tested in
# subsequent runs of tester or tinygrep.
#
install: regex.library
        avail flush
        cp regex.library libs:



