summaryrefslogtreecommitdiffabout
path: root/src/Makefile.am
blob: 8b44d3789b791cefd5a42999ba7310aaff420b79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# This file is part of guile-sql.
# Copyright (C) 2002, Sergey Poznyakoff
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

INCLUDES =-I$(top_builddir) -I$(srcdir) -I. @GUILE_INCLUDES@ @INCLUDEPATH@

LIB_SQL=libguile-sql.la
LIB_GETTEXT=libguile-gettext.la

EXTRA_LTLIBRARIES=libguile-sql.la libguile-gettext.la

lib_LTLIBRARIES=@BUILD_LIBS@
libguile_sql_la_LIBADD = @LTLIBOBJS@ @GUILE_LIBS@
libguile_sql_la_SOURCES=\
 gsql_conn.c\
 gsql_lib.c

libguile_sql_la_LDFLAGS = -rpath $(libdir) -version-info 0:0:0

libguile_gettext_la_LIBADD = @GUILE_LIBS@ @LTLIBINTL@
libguile_gettext_la_SOURCES = gettext.c

libguile_gettext_la_LDFLAGS = -rpath $(libdir) -version-info 0:0:0


noinst_HEADERS=guile-sql.h app.h gettext.h
EXTRA_DIST=sql.sci gettext.sci

.sci.scm:
	m4 -DVERSION=$(VERSION) -DLIBDIR=$(libdir) \
	   -DBUILDDIR="`pwd`" $< > $@

sql.scm: Makefile $(libguile_sql_la_SOURCES:.c=.inc)
gettext.scm: Makefile $(libguile_gettext_la_SOURCES:.c=.inc)

SCM_SQL=sql.scm
X_SQL=gsql_conn.x

SCM_GETTEXT=gettext.scm
X_GETTEXT=gettext.x

guiledir=$(GUILE_SITE)/$(PACKAGE)
guile_DATA=guile-procedures.txt @BUILD_DATA@
DOT_X_FILES=@BUILD_X@
DOT_DOC_FILES=$(DOT_X_FILES:.x=.doc)
CLEANFILES=*.inc *.x *.doc

BUILT_SOURCES=$(DOT_X_FILES) $(DOT_DOC_FILES) 

DISTCLEANFILES=$(BUILT_SOURCES) guile-procedures.txt @BUILD_DATA@

AM_CPPFLAGS=-DDATADIR=\"$(guiledir)\"
ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/' \
   --regex='/[ \t]*SCM_[G]?DEFINE1?[ \t]*(\([^,]*\),[^,]*/\1/'

GUILE_DOC_SNARF=$(top_srcdir)/scripts/guile-doc-snarf
SUFFIXES=.x .doc .inc .sci .scm

.c.x:
	AWK=$(AWK) \
	$(GUILE_DOC_SNARF) -o $@ \
                           $< $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) 

.c.doc:
	AWK=$(AWK) \
	$(GUILE_DOC_SNARF) -d -o $@ \
                           $< $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) 

.c.inc:
	sed -n 's/SCM_DEFINE *(.[^,]*, *\"\([^"][^"]*\)\".*/[(export \1)]/p' $< > $@

guile-procedures.txt: $(DOT_DOC_FILES)
	cat $(DOT_DOC_FILES) > $@

## Add -MG to make the .x magic work with auto-dep code.
MKDEP = $(CC) -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)

install-sql-hook:
	@here=`pwd`
	 cd $(DESTDIR)$(libdir);\
	 if test -f libguile-sql.so; then \
		$(LN_S) -f libguile-sql.so libguile-sql-v-$(VERSION).so; \
	 fi; \
         cd $$here

install-gettext-hook:
	@here=`pwd`
	 cd $(DESTDIR)$(libdir);\
	 if test -f libguile-gettext.so; then \
		$(LN_S) -f libguile-gettext.so libguile-gettext-v-$(VERSION).so; \
	 fi; \
	 cd $$here

install-data-hook: @INSTALL_HOOKS@
	 

Return to:

Send suggestions and report system problems to the System administrator.