1#
2# default base directory for YAP installation
3# (EROOT for architecture-dependent files)
4#
5prefix = @prefix@
6exec_prefix = @exec_prefix@
7ROOTDIR = $(prefix)
8EROOTDIR = @exec_prefix@
9abs_top_builddir = @abs_top_builddir@
10#
11# where the binary should be
12#
13BINDIR = $(EROOTDIR)/bin
14#
15# where YAP should look for libraries
16#
17LIBDIR=@libdir@
18YAPLIBDIR=@libdir@/Yap
19#
20#
21CC=@CC@
22CFLAGS= @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../.. -I$(srcdir)/../../include
23LDFLAGS=@LDFLAGS@
24#
25#
26# You shouldn't need to change what follows.
27#
28INSTALL=@INSTALL@
29INSTALL_DATA=@INSTALL_DATA@
30INSTALL_PROGRAM=@INSTALL_PROGRAM@
31SHELL=/bin/sh
32RANLIB=@RANLIB@
33srcdir=@srcdir@
34SO=@SO@
35#4.1VPATH=@srcdir@:@srcdir@/OPTYap
36CWD=$(PWD)
37#
38
39OBJS=regexp.o @NO_BUILTIN_REGEXP@ regcomp.o regexec.o regerror.o regfree.o
40SOBJS=regexp.@SO@  @NO_BUILTIN_REGEXP@ regcomp.@SO@ regexec.@SO@ regerror.@SO@ regfree.@SO@
41
42#in some systems we just create a single object, in others we need to
43# create a libray
44
45all: $(SOBJS)
46
47regexp.o: $(srcdir)/regexp.c  @NO_BUILTIN_REGEXP@ $(srcdir)/regex2.h  $(srcdir)/engine.c
48	$(CC) -c $(CFLAGS) $(srcdir)/regexp.c -o regexp.o
49
50regcomp.o: $(srcdir)/regcomp.c $(srcdir)/regex2.h
51	$(CC) -c $(CFLAGS) $(srcdir)/regcomp.c -o regcomp.o
52
53regerror.o: $(srcdir)/regerror.c
54	$(CC) -c $(CFLAGS) $(srcdir)/regerror.c -o regerror.o
55
56regfree.o: $(srcdir)/regfree.c $(srcdir)/regex2.h
57	$(CC) -c $(CFLAGS) $(srcdir)/regfree.c -o regfree.o
58
59regexec.o: $(srcdir)/regexec.c
60	$(CC) -c $(CFLAGS) $(srcdir)/regexec.c -o regexec.o
61
62@DO_SECOND_LD@%.@SO@: %.o
63@DO_SECOND_LD@	@SHLIB_LD@ $(LDFLAGS) -o $@ $<  @EXTRA_LIBS_FOR_DLLS@
64
65@DO_SECOND_LD@regexp.@SO@: regexp.o @MERGE_DLL_OBJS@ regcomp.o regerror.o regfree.o regexec.o
66@DO_SECOND_LD@	@SHLIB_LD@ $(LDFLAGS) -o regexp.@SO@ regexp.o  @EXTRA_LIBS_FOR_DLLS@ @MERGE_DLL_OBJS@ regcomp.o regerror.o regfree.o regexec.o
67
68@DO_SECOND_LD@regcomp.@SO@: regcomp.o @MERGE_DLL_OBJS@ regfree.o
69@DO_SECOND_LD@	@SHLIB_LD@ $(LDFLAGS) -o regcomp.@SO@ regcomp.o @MERGE_DLL_OBJS@ regfree.o @EXTRA_LIBS_FOR_DLLS@
70
71@DO_SECOND_LD@regerror.@SO@: regerror.o
72@DO_SECOND_LD@	@SHLIB_LD@ $(LDFLAGS) -o regerror.@SO@ regerror.o @EXTRA_LIBS_FOR_DLLS@
73
74@DO_SECOND_LD@regfree.@SO@: regfree.o
75@DO_SECOND_LD@	@SHLIB_LD@ $(LDFLAGS) -o regfree.@SO@ regfree.o @EXTRA_LIBS_FOR_DLLS@
76
77@DO_SECOND_LD@regexec.@SO@: regexec.o
78@DO_SECOND_LD@	@SHLIB_LD@ $(LDFLAGS) -o regexec.@SO@ regexec.o @EXTRA_LIBS_FOR_DLLS@
79
80install: all
81	$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(YAPLIBDIR)
82
83clean:
84	rm -f *.o *~ $(OBJS) $(SOBJS) *.BAK
85
86