blob: df3192c40add9aee251f329e2c2254140e26415c (
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
|
# Make file for Scintilla on Linux, macOS, or Windows
# @file makefile
# Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
# The License.txt file describes the conditions under which this software may be distributed.
# This makefile assumes GCC 4.8+ is used and changes will be needed to use other compilers.
# Clang 3.4+ can be used with CLANG=1 on command line.
# Builds for GTK+ 2 and 3. GTK 3 requires GTK3=1 on command line.
# Also works with ming32-make on Windows.
.SUFFIXES: .cxx .c .o .h .a .list
srcdir ?= .
ifdef CLANG
CXX = clang++
CXXWARNFLAGS = -Wall -pedantic -Wno-deprecated-register
CC = clang
# Can choose aspect to sanitize: address and undefined can simply change SANITIZE but for
# thread also need to create Position Independent Executable -> search online documentation
SANITIZE = address
#SANITIZE = undefined
else
CXXWARNFLAGS = -Wall -pedantic
endif
ARFLAGS = rc
RANLIB ?= ranlib
ifdef GTK3
GTKVERSION=gtk+-3.0
else
GTKVERSION=gtk+-2.0
endif
# Environment variable windir always defined on Win32
# Enable Position Independent Code except on Windows where it is the default so the flag produces a warning
ifndef windir
PICFLAGS = -fPIC
endif
ifdef windir
CC = gcc
DEL = del /q
COMPLIB=$(srcdir)\..\bin\scintilla.a
else
DEL = rm -f
COMPLIB=$(srcdir)/../bin/scintilla.a
endif
vpath %.h $(srcdir) $(srcdir)/../src $(srcdir)/../include $(srcdir)/../lexlib
vpath %.c $(srcdir)
vpath %.cxx $(srcdir) $(srcdir)/../src $(srcdir)/../lexlib $(srcdir)/../lexers
INCLUDEDIRS=-I $(srcdir)/../include -I $(srcdir)/../src -I $(srcdir)/../lexlib
CXXBASEFLAGS=$(CXXWARNFLAGS) $(PICFLAGS) -DGTK -DSCI_LEXER $(INCLUDEDIRS)
ifdef NO_CXX11_REGEX
REFLAGS=-DNO_CXX11_REGEX
endif
ifdef DEBUG
ifdef CLANG
CTFLAGS=-DDEBUG -g -fsanitize=$(SANITIZE) $(CXXBASEFLAGS)
else
CTFLAGS=-DDEBUG -g $(CXXBASEFLAGS)
endif
else
CTFLAGS=-DNDEBUG -Os $(CXXBASEFLAGS)
endif
CXXTFLAGS:=--std=gnu++0x $(CTFLAGS) $(REFLAGS)
ifdef LPEG_LEXER
CXXTFLAGS+=-DLPEG_LEXER -I ../src/lua
LUA_CFLAGS:=-std=c99 -pedantic -Wall -I ../src/lua -DLUA_USE_POSIX -DLUA_USE_DLOPEN
LUAOBJS:=lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o linit.o \
llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o \
ltable.o ltm.o lundump.o lvm.o lzio.o \
lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o \
lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o \
lpcap.o lpcode.o lpprint.o lptree.o lpvm.o
endif
CONFIGFLAGS:=$(shell pkg-config --cflags $(GTKVERSION))
MARSHALLER=scintilla-marshal.o
all: $(COMPLIB)
clean:
$(DEL) *.o $(COMPLIB) *.plist
.cxx.o:
$(CXX) $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) -c $<
$(MARSHALLER): scintilla-marshal.c
$(CC) $(CONFIGFLAGS) $(CTFLAGS) $(CFLAGS) -w -c $<
$(LUAOBJS): %.o: ../lua/src/%.c
$(CC) $(LUA_CFLAGS) $(CFLAGS) -c $<
GLIB_GENMARSHAL = glib-genmarshal
GLIB_GENMARSHAL_FLAGS = --prefix=scintilla_marshal
.list.h:
$(GLIB_GENMARSHAL) --header $(GLIB_GENMARSHAL_FLAGS) $< > $@
.list.c:
$(GLIB_GENMARSHAL) --body $(GLIB_GENMARSHAL_FLAGS) $< > $@
LEXOBJS:=$(addsuffix .o,$(basename $(sort $(notdir $(wildcard $(srcdir)/../lexers/Lex*.cxx)))))
analyze:
clang --analyze $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) $(srcdir)/*.cxx $(srcdir)/../src/*.cxx $(srcdir)/../lexlib/*.cxx $(srcdir)/../lexers/*.cxx
depend deps.mak:
python DepGen.py
# Required for base Scintilla
SRC_OBJS = \
AutoComplete.o \
CallTip.o \
CaseConvert.o \
CaseFolder.o \
CellBuffer.o \
CharacterCategory.o \
CharacterSet.o \
CharClassify.o \
ContractionState.o \
DBCS.o \
Decoration.o \
Document.o \
EditModel.o \
Editor.o \
EditView.o \
Indicator.o \
KeyMap.o \
LineMarker.o \
MarginView.o \
PerLine.o \
PositionCache.o \
RESearch.o \
RunStyles.o \
Selection.o \
Style.o \
UniConversion.o \
UniqueString.o \
ViewStyle.o \
XPM.o
# Required by lexers
LEXLIB_OBJS = \
Accessor.o \
Catalogue.o \
DefaultLexer.o \
ExternalLexer.o \
LexerBase.o \
LexerModule.o \
LexerSimple.o \
PropSetSimple.o \
StyleContext.o \
WordList.o
GTK_OBJS = \
ScintillaBase.o \
PlatGTK.o \
ScintillaGTK.o \
ScintillaGTKAccessible.o
$(COMPLIB): $(SRC_OBJS) $(LEXLIB_OBJS) $(GTK_OBJS) $(MARSHALLER) $(LEXOBJS) $(LUAOBJS)
$(AR) $(ARFLAGS) $@ $^
$(RANLIB) $@
# Automatically generate header dependencies with "make deps"
include deps.mak
|