# Makefile for CLISP module set regexp

srcdir = @srcdir@
CC = @CC@
CPPFLAGS = @CPPFLAGS@
CFLAGS = @CFLAGS@
CLISP = @CLISP@ -norc -q
CLISP_LIBDIR = @CLISP_LIBDIR@
CLISP_LINKKIT = @CLISP_LINKKIT@

LN = @LN@
LN_S = @LN_S@

MAKE = make

SHELL = /bin/sh

GENERATED = regexp.fas regexi.o preload.lisp
DISTRIBFILES = link.sh Makefile $(GENERATED) \
	$(srcdir)/README $(srcdir)/regexp.lisp $(srcdir)/regexp.texinfo
distribdir =

# default target: make the module
clisp-module : $(GENERATED)

.PHONY : all am--refresh clisp-module clisp-module-distrib clean distclean force

regexp.fas: $(srcdir)/regexp.lisp
	$(CLISP) -c $(srcdir)/regexp.lisp -o ./

regexi.o : regexi.m.c config.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(CLISP_LINKKIT) \
		-c regexi.m.c -o regexi.o

regexi.m.c : $(srcdir)/regexi.c
	$(CLISP) -C $(CLISP_LINKKIT)/modprep $(srcdir)/regexi.c ./

config.h : $(srcdir)/config.h.in config.status
	sh config.status --header=config.h

preload.lisp : $(srcdir)/preload.lisp
	$(LN_S) $(srcdir)/preload.lisp .

# Make a module distribution into $(distribdir)
clisp-module-distrib : clisp-module force
	$(LN) $(DISTRIBFILES) $(distribdir)

clean : force
	rm -f core *.o *.a *.m.c *.fas *.lib

distclean : clean

force :

