blob: f8c16bb91757bd06da5aaecf78adc56f394eb21b (
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
|
# Tools
CC = @CC@
CROSS ?= @CROSS@
RANLIB ?= $(CROSS)ranlib
AR ?= $(CROSS)ar
# Configuration
jim_libtype := @JIM_LIBTYPE@
SH_CFLAGS ?= @SH_CFLAGS@
SH_LDFLAGS ?= @SH_LDFLAGS@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
DESTDIR ?= @prefix@
# Defines the extensions to include
EXTENSIONS := @JIM_EXTENSIONS@
# Set an initial, default library and auto_path
CPPFLAGS += -DTCL_LIBRARY=\"/lib/jim\"
CPPFLAGS += -DJIM_TCL_COMPAT -DJIM_REFERENCES -D_GNU_SOURCE
CPPFLAGS += -Wall -g $(OPTIM) -I@SRCDIR@ -I. @EXTRA_CFLAGS@
VPATH := @SRCDIR@
ifeq ($(jim_libtype),static)
LIBJIM := libjim.a
else
LIBJIM := libjim.so
CPPFLAGS += $(SH_CFLAGS)
endif
.EXPORT_ALL_VARIABLES:
OBJS := jim-subcmd.o jim-interactive.o jim.o
EXTENSIONS_OBJS := $(patsubst %,jim-%.o,$(EXTENSIONS))
.PRECIOUS: jim-%.c
# Create C extensions from pure Tcl extensions
jim-%.c: %.tcl
echo $@ >>.clean
sh @SRCDIR@/make-c-ext.sh $< >$@
OBJS += jim-load-static-exts.o
all: jimsh
docs: Tcl.html
jimsh: $(LIBJIM) jimsh.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ jimsh.o $(LIBJIM) $(LDLIBS) @LIBSOCK@ @LIBDL@ -lm
install: all docs
install -d $(DESTDIR)/bin
install jimsh $(DESTDIR)/bin
install -d $(DESTDIR)/lib
install $(LIBJIM) $(DESTDIR)/lib
install -d $(DESTDIR)/include
install @SRCDIR@/jim.h @SRCDIR@/jim-*.h $(DESTDIR)/include
install jimautoconfext.h $(DESTDIR)/include/jimautoconf.h
install -d $(DESTDIR)/doc/jim
install Tcl.html $(DESTDIR)/doc/jim
test:
$(MAKE) -C tests
ifeq ($(jim_libtype),static)
$(LIBJIM): $(OBJS) $(EXTENSIONS_OBJS)
$(AR) cr $@ $^
$(RANLIB) $@
else
$(LIBJIM): $(OBJS) $(EXTENSIONS_OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $(SH_LDFLAGS) -o $@ $^
endif
Tcl.html: jim_tcl.txt
asciidoc -o $@ -d manpage $^ || cp @SRCDIR@/Tcl_shipped.html Tcl.html
clean:
rm -f *.o lib*.a jimsh Tcl.html
if [ -f .clean ]; then rm -f `cat .clean` .clean; fi
distclean: clean
rm -f jimautoconf.h jimautoconfext.h Makefile config.status config.log
rm -rf autom4te.cache
ship:
cp Tcl.html Tcl_shipped.html
autoconf && autoheader
|