-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
76 lines (61 loc) · 1.94 KB
/
Makefile.in
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
# Makefile.in
# We do not use Automake because we need a shared library for Tcl
# and Automake wants to make libtool libraries
PREFIX = @prefix@
CC = @CC@
CPPFLAGS = -I . @CPPFLAGS@ @TCL_INCLUDE_SPEC@
CFLAGS = -fPIC @CFLAGS@
LDFLAGS = @TCL_LIB_SPEC@ @LDFLAGS@
LIBS = @LIBS@
RPATHS = -Wl,-rpath -Wl,@USE_LIBTCL_SO@
SED_I = @SED_I@
PLATFORM = @PLATFORM@
ifeq ($(PLATFORM),Mac)
SO_SUFFIX = dylib
MAC_NAME = -install_name $(PREFIX)/$(LIB_TCL_EDITOR)
SHARED = -dynamiclib
else
SO_SUFFIX = so
MAC_NAME =
SHARED = -shared
endif
LIB_TCL_EDITOR = lib/libtcleditor.$(SO_SUFFIX)
all: $(LIB_TCL_EDITOR)
src/editor_wrap.c: src/editor.i src/editor.h Makefile
swig -tcl $(<)
$(SED_I) s/Editor_Init/Tcleditor_Init/ $(@)
$(LIB_TCL_EDITOR): src/editor_wrap.o src/editor.o
gcc $(SHARED) -o $(@) $(^) \
$(LDFLAGS) \
$(LIBS) \
$(RPATHS) \
$(MAC_NAME)
install: $(LIB_TCL_EDITOR)
mkdir -pv $(PREFIX)/bin $(PREFIX)/lib $(PREFIX)/etc
cp -uv bin/led $(PREFIX)/bin
cp -uv lib/led.tcl $(LIB_TCL_EDITOR) $(PREFIX)/lib
cp -uv etc/help.txt etc/inputrc $(PREFIX)/etc
tags: TAGS
TAGS: src/editor.c src/editor.h
# Use GCC to generate header dependencies
# so that readline headers are available in etags
# sed: Remove object file with colon,
# leading spaces, backslashes
# Print 1 path per line
gcc -M -MG $(<) | \
sed 's/.*://;s/ *//;s/\\//' | \
fmt -w 1 > src/editor.d
etags -L src/editor.d
.PHONY: tags
# Replaced: 2024-09-18
# etags $(^) \
# /usr/include/readline/readline.h \
# /usr/include/readline/rlstdc.h \
# /usr/include/readline/rltypedefs.h \
# /usr/include/readline/keymaps.h \
# /usr/include/readline/tilde.h \
# /usr/include/readline/history.h
clean:
rm -fv lib/*.so src/*.o
distclean: clean
rm -fv configure config.cache config.status