You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
notepad-plus-plus/scintilla/gtk/makefile

173 lines
4.6 KiB

# 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 9.0+ is used and changes will be needed to use other compilers.
# Clang 9.0+ 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.
.PHONY: static shared all clean analyze depend
.SUFFIXES: .cxx .c .o .h .a .list
srcdir ?= .
basedir = $(srcdir)/..
WARNINGS = -Wpedantic -Wall
ifdef CLANG
CXX = clang++
CC = clang
WARNINGS += -Wno-deprecated-register
ifdef windir
# Turn off some warnings that occur when Clang is being used on Windows where it
# is including Microsoft headers.
# incompatible-ms-struct is because more complex structs are not quite the same as MSVC
WARNINGS += -Wno-incompatible-ms-struct
# language-extension-token is because of __int64 in glib-2.0 glibconfig.h
WARNINGS += -Wno-language-extension-token
# register may be used in glib
# This produces a warning since -Wno-register is not valid for C files but it still works
WARNINGS += -Wno-register
endif
# 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
BASE_FLAGS += -fsanitize=$(SANITIZE)
endif
ARFLAGS = rc
RANLIB ?= ranlib
PKG_CONFIG ?= pkg-config
GTK_VERSION = $(if $(GTK3),gtk+-3.0,gtk+-2.0)
# 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
BASE_FLAGS += -fPIC
ifeq ($(shell uname),Darwin)
LDFLAGS += -dynamiclib
endif
endif
LDFLAGS += -shared
# Take care of changing Unix style '/' directory separator to '\' on Windows
normalize = $(if $(windir),$(subst /,\,$1),$1)
PYTHON = $(if $(windir),pyw,python3)
SHAREDEXTENSION = $(if $(windir),dll,so)
ifdef windir
CC = gcc
DEL = del /q
else
DEL = rm -f
endif
COMPLIB=$(basedir)/bin/scintilla.a
COMPONENT=$(basedir)/bin/libscintilla.$(SHAREDEXTENSION)
vpath %.h $(srcdir) $(basedir)/src $(basedir)/include
vpath %.c $(srcdir)
vpath %.cxx $(srcdir) $(basedir)/src
INCLUDES=-I $(basedir)/include -I $(basedir)/src
DEFINES += -DGTK
BASE_FLAGS += $(WARNINGS)
ifdef NO_CXX11_REGEX
DEFINES += -DNO_CXX11_REGEX
endif
DEFINES += -D$(if $(DEBUG),DEBUG,NDEBUG)
Update to Scintilla 5.3.2 and Lexilla 5.2.1 update to https://www.scintilla.org/scintilla532.zip with: Released 6 December 2022. Add SCI_REPLACETARGETMINIMAL to change text without causing unchanged prefix and suffix to be marked as modified in change history. Draw background colour for EOL annotations with standard and boxed visuals. Add SCI_GETSTYLEDTEXTFULL to support 64-bit document positions on Win32 replacing SCI_GETSTYLEDTEXT which is not safe for huge documents. Feature #1455. Send SCN_AUTOCCOMPLETED for SCI_AUTOCSHOW triggering insertion because of SCI_AUTOCSETCHOOSESINGLE mode. Feature #1459. Change 'paragraph up' commands SCI_PARAUP and SCI_PARAUPEXTEND to go to the start position of the paragraph containing the caret. Only if the caret is already at the start of the paragraph will it go to the start of the previous paragraph. Bug #2363. Change release compilation optimization option to favour speed over space. -O2 for MSVC and -O3 for gcc and clang. On Win32, avoid blurry display with DirectWrite in GDI scaling mode. Bug #2344. On Win32, use the top-level window to find the monitor for DirectWrite rendering parameters. Temporarily switch DPI awareness to find correct monitor in GDI scaling mode. Bug #2344. On Qt, implement SCI_SETRECTANGULARSELECTIONMODIFIER for all platforms. On Qt, allow string form XPM images for SCI_REGISTERIMAGE. and https://www.scintilla.org/lexilla521.zip with Released 6 December 2022. Update to Unicode 14. Feature #1461. Change default compilation optimization option to favour speed over space. -O2 for MSVC and -O3 for gcc and clang. Batch: Fix comments starting inside strings. Issue #115. F#: Lex signed numeric literals more accurately. Issue #110, Issue #111. F#: Add specifiers for 64-bit integer and floating point literals. Issue #112. Markdown: Stop styling numbers at line start in PRECHAR style. Issue #117. PowerShell: Recognise numeric literals more accurately. Issue #118. Close #12624
2 years ago
BASE_FLAGS += $(if $(DEBUG),-g,-O3)
CXX_BASE_FLAGS =--std=c++17 $(BASE_FLAGS)
CXX_ALL_FLAGS =$(DEFINES) $(INCLUDES) $(CXX_BASE_FLAGS) $(CONFIG_FLAGS)
CONFIG_FLAGS:=$(shell $(PKG_CONFIG) --cflags $(GTK_VERSION))
CONFIGLIB:=$(shell $(PKG_CONFIG) --libs $(GTK_VERSION) gmodule-no-export-2.0)
MARSHALLER=scintilla-marshal.o
all: $(COMPLIB) $(COMPONENT)
static: $(COMPLIB)
shared: $(COMPONENT)
clean:
$(DEL) *.o $(call normalize,$(COMPLIB)) $(call normalize,$(COMPONENT)) *.plist
%.o: %.cxx
$(CXX) $(CPPFLAGS) $(CXX_ALL_FLAGS) $(CXXFLAGS) -c $<
%.o: %.c
$(CC) $(CPPFLAGS) $(DEFINES) $(INCLUDES) $(CONFIG_FLAGS) $(BASE_FLAGS) $(CFLAGS) -w -c $<
GLIB_GENMARSHAL = glib-genmarshal
GLIB_GENMARSHAL_FLAGS = --prefix=scintilla_marshal
%.h: %.list
$(GLIB_GENMARSHAL) --header $(GLIB_GENMARSHAL_FLAGS) $< > $@
%.c: %.list
$(GLIB_GENMARSHAL) --body $(GLIB_GENMARSHAL_FLAGS) $< > $@
analyze:
clang --analyze $(DEFINES) $(INCLUDES) $(CONFIG_FLAGS) $(CXX_BASE_FLAGS) $(CXXFLAGS) $(srcdir)/*.cxx $(basedir)/src/*.cxx
depend deps.mak:
$(PYTHON) DepGen.py
# Required for base Scintilla
SRC_OBJS = \
AutoComplete.o \
CallTip.o \
CaseConvert.o \
CaseFolder.o \
CellBuffer.o \
ChangeHistory.o \
CharacterCategoryMap.o \
CharacterType.o \
CharClassify.o \
ContractionState.o \
DBCS.o \
Decoration.o \
Document.o \
EditModel.o \
Editor.o \
EditView.o \
Geometry.o \
Indicator.o \
KeyMap.o \
LineMarker.o \
MarginView.o \
PerLine.o \
PositionCache.o \
RESearch.o \
RunStyles.o \
Selection.o \
Style.o \
Updated to Scintilla 5.4.2 & Lexilla 5.3.1 https://www.scintilla.org/scintilla542.zip Release 5.4.2 Released 5 March 2024. Significantly reduce memory used for undo actions, often to a half or quarter of previous versions. Feature #1458. Add APIs for saving and restoring undo history. For GTK, when laying out text, detect runs with both left-to-right and right-to-left ranges and divide into an ASCII prefix and more complex suffix. Lay out the ASCII prefix in the standard manner but, for the suffix, measure the whole width and spread that over the suffix bytes. This produces more usable results where the caret moves over the ASCII prefix correctly and over the suffix reasonably but not accurately. For ScintillaEdit on Qt, fix reference from ScintillaDocument to Document to match change in 5.4.1 using IDocumentEditable for SCI_GETDOCPOINTER and SCI_SETDOCPOINTER. For Direct2D on Win32, use the multi-threaded option to avoid crashes when Scintilla instances created on different threads. There may be more problems with this scenario so it should be avoided. Bug #2420. For Win32, ensure keyboard-initiated context menu appears in multi-screen situations. https://www.scintilla.org/lexilla531.zip Release 5.3.1 Released 5 March 2024. Assembler: After comments, treat \r\n line ends the same as \n. This makes testing easier. Bash: Fix folding when line changed to/from comment and previous line is comment. Issue #224. Batch: Fix handling ':' next to keywords. Issue #222. JavaScript: in cpp lexer, add lexer.cpp.backquoted.strings=2 mode to treat ` back-quoted strings as template literals which allow embedded ${expressions}. Issue #94. Python: fix lexing of rb'' and rf'' strings. Issue #223, Pull request #227. Ruby: fix lexing of methods on numeric literals like '3.times' so the '.' and method name do not appear in numeric style. Issue #225.
9 months ago
UndoHistory.o \
UniConversion.o \
UniqueString.o \
ViewStyle.o \
XPM.o
GTK_OBJS = \
ScintillaBase.o \
PlatGTK.o \
ScintillaGTK.o \
ScintillaGTKAccessible.o
$(COMPLIB): $(SRC_OBJS) $(GTK_OBJS) $(MARSHALLER)
$(AR) $(ARFLAGS) $@ $^
$(RANLIB) $@
$(COMPONENT): $(SRC_OBJS) $(GTK_OBJS) $(MARSHALLER)
$(CXX) $(CXX_ALL_FLAGS) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(CONFIGLIB)
# Automatically generate header dependencies with "make depend"
include deps.mak