aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Makefile.am
blob: 3589fdf3955ca01591e8b6afd792404ea825a609 (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
# The Gtk and Curses UIs have their own subdirectories.
# Either of them will build libsciteco-interface.a
if INTERFACE_GTK
SUBDIRS = interface-gtk
LIBSCITECO_INTERFACE = interface-gtk/libsciteco-interface.la
else
SUBDIRS = interface-curses
LIBSCITECO_INTERFACE = interface-curses/libsciteco-interface.la
endif

include $(top_srcdir)/bootstrap.am
include $(top_srcdir)/scintilla.am

AM_CXXFLAGS = -Wall -Wno-char-subscripts

if STATIC_EXECUTABLES
# AM_LDFLAGS are libtool flags, NOT compiler/linker flags
AM_LDFLAGS = -all-static
endif

BUILT_SOURCES =

dist_noinst_SCRIPTS = symbols-extract.tes

# Emscripten HTML page:
EXTRA_DIST = sciteco.html

noinst_LTLIBRARIES = libsciteco-base.la
libsciteco_base_la_SOURCES = main.cpp sciteco.h \
                             memory.cpp memory.h \
                             string-utils.cpp string-utils.h \
                             error.cpp error.h \
                             cmdline.cpp cmdline.h \
                             undo.cpp undo.h \
                             expressions.cpp expressions.h \
                             document.cpp document.h \
                             eol.cpp eol.h \
                             ioview.cpp ioview.h \
                             qregisters.cpp qregisters.h \
                             ring.cpp ring.h \
                             parser.cpp parser.h \
                             search.cpp search.h \
                             spawn.cpp spawn.h \
                             glob.cpp glob.h \
                             goto.cpp goto.h \
                             help.cpp help.h \
                             rbtree.cpp rbtree.h \
                             symbols.cpp symbols.h \
                             interface.cpp interface.h
# NOTE: We cannot link in Scintilla (static library) into
# a libtool convenience library
libsciteco_base_la_LIBADD = $(LIBSCITECO_INTERFACE)

if BOOTSTRAP
noinst_PROGRAMS = sciteco-minimal
symbols-scintilla.cpp symbols-scilexer.cpp : sciteco-minimal$(EXEEXT)
endif
sciteco_minimal_SOURCES = symbols-minimal.cpp
sciteco_minimal_LDADD = libsciteco-base.la \
                        @SCINTILLA_PATH@/bin/scintilla.a

bin_PROGRAMS = sciteco
sciteco_SOURCES =
nodist_sciteco_SOURCES = symbols-scintilla.cpp symbols-scilexer.cpp
sciteco_LDADD = $(sciteco_minimal_LDADD)

# For MinGW: Compile in resource (contains the icon)
if WIN32
sciteco_SOURCES += sciteco.rc
.rc.o:
	@RC@ $< $@
endif

CLEANFILES = $(BUILT_SOURCES) \
	     symbols-scintilla.cpp symbols-scilexer.cpp

symbols-scintilla.cpp : @SCINTILLA_PATH@/include/Scintilla.h \
			symbols-extract.tes
	$(SCITECO_MINIMAL) -m -- @srcdir@/symbols-extract.tes \
	                   -p "SCI_" -n scintilla $@ $<

symbols-scilexer.cpp : @SCINTILLA_PATH@/include/SciLexer.h \
		       symbols-extract.tes
	$(SCITECO_MINIMAL) -m -- @srcdir@/symbols-extract.tes \
	                   -p "SCLEX_,SCE_" -n scilexer $@ $<

# This installs a wrapper script to libexecdir to be used as
# the SciTECO interpreter in Hash-Bang lines.
# It makes sure that option parsing is disabled for all
# script arguments which is necessary for builds against Glib < 2.44.
# NOTE: When we raise the Glib requirement to 2.44, the sciteco-wrapper
# workaround can be removed completely.
libexec_SCRIPTS = sciteco-wrapper
CLEANFILES += $(libexec_SCRIPTS)

.PHONY: sciteco-wrapper
sciteco-wrapper:
	printf '#!/bin/sh\nOPT=$$1\nshift\nexec %s "$$OPT" -- $$@' \
	       "$(SCITECO_INSTALLED)" >$@