summaryrefslogtreecommitdiff
path: root/libguile/Makefile.am
blob: b1f00fc1bb29330430d364ca5190c298e2f3e0df (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
## Process this file with Automake to create Makefile.in

AUTOMAKE_OPTIONS = foreign

## Check for headers in $(srcdir)/.., so that #include
## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're
## building.
INCLUDES = -I.. -I$(srcdir)/..

ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(PROC\|PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/'

lib_LTLIBRARIES = libguile.la
bin_PROGRAMS = guile

guile_SOURCES = guile.c
guile_LDADD = libguile.la ${THREAD_LIBS}

libguile_la_SOURCES = \
    alist.c append.c appinit.c arbiters.c async.c boolean.c chars.c \
    continuations.c dynl.c dynwind.c eq.c error.c eval.c extchrs.c \
    feature.c filesys.c fports.c gc.c gdbint.c genio.c gh_data.c gh_eval.c \
    gh_funcs.c gh_init.c gh_io.c gh_list.c gh_predicates.c gsubr.c hash.c \
    hashtab.c init.c ioext.c kw.c list.c load.c mallocs.c markers.c \
    mbstrings.c net_db.c numbers.c objprop.c options.c pairs.c ports.c \
    posix.c print.c procprop.c procs.c ramap.c read.c root.c scmsigs.c \
    script.c sequences.c simpos.c smob.c socket.c stackchk.c stime.c \
    strings.c strop.c strorder.c strports.c struct.c symbols.c tag.c \
    throw.c unif.c variable.c vectors.c version.c vports.c weaks.c \
    fluids.c

EXTRA_libguile_la_SOURCES = _scm.h \
    backtrace.c stacks.c debug.c srcprop.c \
    strerror.c inet_aton.c putenv.c \
    threads.c alloca.c \
    regex-posix.c

## This is kind of nasty... there are ".c" files that we don't want to
## compile, since they are #included in threads.c.  So instead we list
## them here.  Perhaps we can deal with them normally once the merge
## seems to be working.
noinst_HEADERS = coop-threads.c coop-threads.h coop.c

libguile_la_DEPENDENCIES = @LIBLOBJS@
libguile_la_LIBADD = @LIBLOBJS@
libguile_la_LDFLAGS = -version-info 2:0 -rpath $(libdir)

include_HEADERS = libguile.h

# These are headers visible as <guile/mumble.h> 
pkginclude_HEADERS = gh.h

# These are headers visible as <libguile/mumble.h>.
modincludedir = $(includedir)/libguile
modinclude_HEADERS = __scm.h alist.h append.h arbiters.h async.h \
    backtrace.h boolean.h chars.h continuations.h debug.h dynl.h dynwind.h \
    eq.h error.h eval.h extchrs.h feature.h filesys.h fports.h gc.h \
    gdb_interface.h gdbint.h genio.h gsubr.h hash.h hashtab.h init.h \
    ioext.h kw.h list.h load.h mallocs.h markers.h mbstrings.h net_db.h \
    numbers.h objprop.h options.h pairs.h ports.h posix.h regex-posix.h print.h \
    procprop.h procs.h ramap.h read.h root.h scmhob.h scmsigs.h script.h \
    sequences.h simpos.h smob.h socket.h srcprop.h stackchk.h stacks.h \
    stime.h strings.h strop.h strorder.h strports.h struct.h symbols.h \
    tag.h tags.h throw.h unif.h variable.h vectors.h version.h vports.h \
    weaks.h snarf.h threads.h coop-defs.h fluids.h

## This file is generated at configure time.  That is why it is DATA
## and not a header -- headers are included in the distribution.
modinclude_DATA = scmconfig.h

bin_SCRIPTS = guile-snarf

THREAD_LIBS = @THREAD_LIBS@
check_ldadd = libguile.la ${THREAD_LIBS}
check_PROGRAMS = gh_test_c gh_test_repl
gh_test_c_SOURCES = gh_test_c.c
gh_test_c_LDADD = ${check_ldadd}
gh_test_repl_SOURCES = gh_test_repl.c
gh_test_repl_LDADD = ${check_ldadd}

check-local:
	echo '(+ 1 2 3)' | ./gh_test_c; echo
	echo '(+ 1 2 3)' | ./gh_test_repl; echo

EXTRA_DIST = ChangeLog-gh ChangeLog-scm ChangeLog-threads dynl-dl.c \
    dynl-dld.c dynl-shl.c dynl-vms.c DYNAMIC-LINKING cpp_signal.c cpp_errno.c \
    cpp_err_symbols.in cpp_sig_symbols.in cpp_cnvt.awk coop-threads.h.cygnus \
    coop-threads.c.cygnus mit-pthreads.h mit-pthreads.c fsu-pthreads.h

## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
libpath.h: Makefile
	@echo "Generating libpath.h..." 
	@rm -f libpath.tmp
	@echo '/* generated by Makefile */' > libpath.tmp
	@echo '#define SCM_PKGDATA_DIR "$(pkgdatadir)"' >> libpath.tmp
	@echo '#define SCM_LIBRARY_DIR "$(pkgdatadir)/$(VERSION)"'>>libpath.tmp
	@echo '#define SCM_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp
	@echo '#define SCM_BUILD_INFO { \' >> libpath.tmp
	@echo '	{ "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp
	@echo '	{ "top_srcdir", "'"`cd @top_srcdir@; pwd`"'" }, \' \
		>> libpath.tmp
	@echo '	{ "prefix",	   "@prefix@" }, \' >> libpath.tmp
	@echo '	{ "exec_prefix",   "@exec_prefix@" }, \' >> libpath.tmp
	@echo '	{ "bindir",	   "@bindir@" }, \' >> libpath.tmp
	@echo '	{ "sbindir",	   "@sbindir@" }, \' >> libpath.tmp
	@echo '	{ "libexecdir",	   "@libexecdir@" }, \' >> libpath.tmp
	@echo '	{ "datadir",	   "@datadir@" }, \' >> libpath.tmp
	@echo '	{ "sysconfdir",	   "@sysconfdir@" }, \' >> libpath.tmp
	@echo '	{ "sharedstatedir", "@sharedstatedir@" }, \' >> libpath.tmp
	@echo '	{ "localstatedir", "@localstatedir@" }, \' >> libpath.tmp
	@echo '	{ "libdir",	   "@libdir@" }, \' >> libpath.tmp
	@echo '	{ "infodir",	   "@infodir@" }, \' >> libpath.tmp
	@echo '	{ "mandir",	   "@mandir@" }, \' >> libpath.tmp
	@echo '	{ "includedir",	   "@includedir@" }, \' >> libpath.tmp
	@echo '	{ "pkgdatadir",	   "$(datadir)/@PACKAGE@" }, \' >> libpath.tmp
	@echo '	{ "pkglibdir",	   "$(libdir)/@PACKAGE@" }, \' >> libpath.tmp
	@echo '	{ "pkgincludedir", "$(includedir)/@PACKAGE@" }, \' \
		>> libpath.tmp
	@echo '}' >> libpath.tmp
	@mv libpath.tmp libpath.h

## FIXME: Consider using timestamp file, to avoid unnecessary rebuilds.
versiondat.h: Makefile
	@echo "Generating versiondat.h..."
	@rm -f versiondat.tmp
	@echo '/* generated by Makefile */' > versiondat.tmp
	@echo '#define GUILE_VERSION "$(GUILE_VERSION)"' >> versiondat.tmp
	@echo '#define GUILE_MAJOR_VERSION "$(GUILE_MAJOR_VERSION)"' \
		>> versiondat.tmp
	@echo '#define GUILE_MINOR_VERSION "$(GUILE_MINOR_VERSION)"' \
		>> versiondat.tmp
	@echo '#define GUILE_STAMP   "$(GUILE_STAMP)"' >> versiondat.tmp
	@mv versiondat.tmp versiondat.h

SUFFIXES = .x
.c.x:
	./guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@

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

cpp_err_symbols.c: cpp_err_symbols.in
	$(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_err_symbols.in > \
		cpp_err_symbols.tmp
	mv cpp_err_symbols.tmp cpp_err_symbols.c

cpp_sig_symbols.c: cpp_sig_symbols.in
	$(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_sig_symbols.in > \
		cpp_sig_symbols.tmp
	mv cpp_sig_symbols.tmp cpp_sig_symbols.c

## Create a new version of the cpp_sig_symbols.in file, including all SIGXXX
## macros defined on this platform.
check_signals:
	gcc -undef -dM -E $(srcdir)/cpp_signal.c | egrep ' SIG[A-Z]+' \
	  | cut -f2 -d' ' | sort > cpp_sig_symbols_here
	diff -u $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_here \
          | egrep '^\+S' \
	  | cut -c2- > cpp_sig_symbols_diff
	if test -s cpp_sig_symbols_diff ; then \
	  cat $(srcdir)/cpp_sig_symbols.in cpp_sig_symbols_diff \
	    | sort > cpp_sig_symbols_new ;\
	  echo "cpp_sig_symbols_new has the following additions:" ;\
	  cat cpp_sig_symbols_diff ;\
	else echo "No new symbols found."; \
	fi

## Likewise for cpp_err_symbols.in.
check_errnos:
	gcc -undef -dM -E $(srcdir)/cpp_errno.c | egrep ' E.+' \
	  | cut -f2 -d' ' | sort > cpp_err_symbols_here
	diff -u $(srcdir)/cpp_err_symbols.in cpp_err_symbols_here \
          | egrep '^\+E' \
	  | cut -c2- > cpp_err_symbols_diff
	if test -s cpp_err_symbols_diff ; then \
	  cat $(srcdir)/cpp_err_symbols.in cpp_err_symbols_diff \
	    | sort > cpp_err_symbols_new ;\
	  echo "cpp_err_symbols_new has the following additions:" ;\
	  cat cpp_err_symbols_diff ;\
	else echo "No new symbols found."; \
	fi

MOSTLYCLEANFILES = \
	cpp_err_symbols_here cpp_err_symbols_diff cpp_err_symbols_new \
	cpp_sig_symbols_here cpp_sig_symbols_diff cpp_sig_symbols_new

CLEANFILES = versiondat.h libpath.h

DISTCLEANFILES = *.x