2010-08-21 23:59:56 +00:00
|
|
|
# Make file for Scintilla on Linux or compatible OS
|
|
|
|
# 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.3 is used and changes will be needed to use other compilers.
|
|
|
|
# GNU make does not like \r\n line endings so should be saved to CVS in binary form.
|
|
|
|
# Builds for GTK+ 2 and no longer supports GTK+ 1.
|
|
|
|
# Also works with ming32-make on Windows.
|
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
.SUFFIXES: .cxx .c .o .h .a .list
|
|
|
|
|
|
|
|
srcdir ?= .
|
|
|
|
|
2010-08-21 23:59:56 +00:00
|
|
|
ifdef CLANG
|
2019-05-04 18:14:48 +00:00
|
|
|
CXX = clang++
|
|
|
|
CXXWARNFLAGS = -Wall -pedantic -Wno-deprecated-register -Wno-missing-braces
|
2015-06-07 21:19:26 +00:00
|
|
|
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
|
2019-05-04 18:14:48 +00:00
|
|
|
else
|
|
|
|
CXXWARNFLAGS = -Wall -pedantic
|
2010-08-21 23:59:56 +00:00
|
|
|
endif
|
2019-05-04 18:14:48 +00:00
|
|
|
ARFLAGS = rc
|
2010-08-21 23:59:56 +00:00
|
|
|
RANLIB = touch
|
|
|
|
|
2011-07-17 22:30:49 +00:00
|
|
|
ifdef GTK3
|
|
|
|
GTKVERSION=gtk+-3.0
|
|
|
|
else
|
|
|
|
GTKVERSION=gtk+-2.0
|
|
|
|
endif
|
|
|
|
|
2011-03-22 00:16:49 +00:00
|
|
|
# Environment variable windir always defined on Win32
|
|
|
|
|
2010-08-21 23:59:56 +00:00
|
|
|
ifndef windir
|
|
|
|
ifeq ($(shell uname),Darwin)
|
|
|
|
RANLIB = ranlib
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
# Enable Position Independent Code except on Windows where it is the default so the flag produces a warning
|
|
|
|
ifndef windir
|
|
|
|
PICFLAGS = -fPIC
|
|
|
|
endif
|
|
|
|
|
2011-03-22 00:16:49 +00:00
|
|
|
ifdef windir
|
2019-05-04 18:14:48 +00:00
|
|
|
CC = gcc
|
2011-03-22 00:16:49 +00:00
|
|
|
DEL = del /q
|
2019-05-04 18:14:48 +00:00
|
|
|
COMPLIB=$(srcdir)\..\bin\scintilla.a
|
2011-03-22 00:16:49 +00:00
|
|
|
else
|
|
|
|
DEL = rm -f
|
2019-05-04 18:14:48 +00:00
|
|
|
COMPLIB=$(srcdir)/../bin/scintilla.a
|
2011-03-22 00:16:49 +00:00
|
|
|
endif
|
2010-08-21 23:59:56 +00:00
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
vpath %.h $(srcdir) $(srcdir)/../src $(srcdir)/../include $(srcdir)/../lexlib
|
|
|
|
vpath %.c $(srcdir)
|
|
|
|
vpath %.cxx $(srcdir) $(srcdir)/../src $(srcdir)/../lexlib $(srcdir)/../lexers
|
2010-08-21 23:59:56 +00:00
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
INCLUDEDIRS=-I $(srcdir)/../include -I $(srcdir)/../src -I $(srcdir)/../lexlib
|
2011-07-17 22:30:49 +00:00
|
|
|
ifdef CHECK_DEPRECATED
|
|
|
|
DEPRECATED=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DDISABLE_GDK_FONT
|
|
|
|
endif
|
2019-05-04 18:14:48 +00:00
|
|
|
CXXBASEFLAGS=$(CXXWARNFLAGS) $(PICFLAGS) -DGTK -DSCI_LEXER $(INCLUDEDIRS) $(DEPRECATED)
|
2010-08-21 23:59:56 +00:00
|
|
|
|
|
|
|
ifdef NOTHREADS
|
|
|
|
THREADFLAGS=-DG_THREADS_IMPL_NONE
|
|
|
|
else
|
|
|
|
THREADFLAGS=
|
|
|
|
endif
|
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
ifdef NO_CXX11_REGEX
|
|
|
|
REFLAGS=-DNO_CXX11_REGEX
|
2015-06-07 21:19:26 +00:00
|
|
|
endif
|
|
|
|
|
2010-08-21 23:59:56 +00:00
|
|
|
ifdef DEBUG
|
2013-08-28 00:44:27 +00:00
|
|
|
ifdef CLANG
|
2015-06-07 21:19:26 +00:00
|
|
|
CTFLAGS=-DDEBUG -g -fsanitize=$(SANITIZE) $(CXXBASEFLAGS) $(THREADFLAGS)
|
2013-08-28 00:44:27 +00:00
|
|
|
else
|
2015-06-07 21:19:26 +00:00
|
|
|
CTFLAGS=-DDEBUG -g $(CXXBASEFLAGS) $(THREADFLAGS)
|
2013-08-28 00:44:27 +00:00
|
|
|
endif
|
2010-08-21 23:59:56 +00:00
|
|
|
else
|
2015-06-07 21:19:26 +00:00
|
|
|
CTFLAGS=-DNDEBUG -Os $(CXXBASEFLAGS) $(THREADFLAGS)
|
2010-08-21 23:59:56 +00:00
|
|
|
endif
|
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
CXXTFLAGS:=--std=gnu++17 $(CTFLAGS) $(REFLAGS)
|
2011-07-17 22:30:49 +00:00
|
|
|
|
|
|
|
CONFIGFLAGS:=$(shell pkg-config --cflags $(GTKVERSION))
|
2010-08-21 23:59:56 +00:00
|
|
|
MARSHALLER=scintilla-marshal.o
|
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
all: $(COMPLIB)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(DEL) *.o $(COMPLIB) *.plist
|
|
|
|
|
2010-08-21 23:59:56 +00:00
|
|
|
.cxx.o:
|
2015-06-07 21:19:26 +00:00
|
|
|
$(CXX) $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) -c $<
|
2010-08-21 23:59:56 +00:00
|
|
|
.c.o:
|
2019-05-04 18:14:48 +00:00
|
|
|
$(CC) $(CONFIGFLAGS) $(CTFLAGS) $(CFLAGS) -w -c $<
|
2010-08-21 23:59:56 +00:00
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
GLIB_GENMARSHAL = glib-genmarshal
|
|
|
|
GLIB_GENMARSHAL_FLAGS = --prefix=scintilla_marshal
|
2010-08-21 23:59:56 +00:00
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
.list.h:
|
|
|
|
$(GLIB_GENMARSHAL) --header $(GLIB_GENMARSHAL_FLAGS) $< > $@
|
|
|
|
.list.c:
|
|
|
|
$(GLIB_GENMARSHAL) --body $(GLIB_GENMARSHAL_FLAGS) $< > $@
|
2010-08-21 23:59:56 +00:00
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
LEXOBJS:=$(addsuffix .o,$(basename $(sort $(notdir $(wildcard $(srcdir)/../lexers/Lex*.cxx)))))
|
2013-08-28 00:44:27 +00:00
|
|
|
|
|
|
|
analyze:
|
2019-05-04 18:14:48 +00:00
|
|
|
clang --analyze $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) $(srcdir)/*.cxx $(srcdir)/../src/*.cxx $(srcdir)/../lexlib/*.cxx $(srcdir)/../lexers/*.cxx
|
2010-08-21 23:59:56 +00:00
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
# To minimize deltas, including between Unix and Windows, the lexer file names are sorted case-insensitively
|
|
|
|
LEXSORTED=$(shell ls $(srcdir)/../lexers/Lex*.cxx | sort -f)
|
|
|
|
DEPSRCS=$(srcdir)/*.cxx $(srcdir)/../src/*.cxx $(srcdir)/../lexlib/*.cxx $(LEXSORTED)
|
|
|
|
deps: deps.mak
|
|
|
|
deps.mak:
|
|
|
|
$(CXX) -MM $(CONFIGFLAGS) $(CXXTFLAGS) $(DEPSRCS) | sed -e 's/\/usr.* //' | grep [a-zA-Z] > $@
|
2010-08-21 23:59:56 +00:00
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
$(COMPLIB): Accessor.o CharacterSet.o DefaultLexer.o LexerBase.o LexerModule.o LexerSimple.o StyleContext.o WordList.o \
|
2013-08-28 00:44:27 +00:00
|
|
|
CharClassify.o Decoration.o Document.o PerLine.o Catalogue.o CallTip.o CaseConvert.o CaseFolder.o \
|
2015-06-07 21:19:26 +00:00
|
|
|
ScintillaBase.o ContractionState.o EditModel.o Editor.o EditView.o ExternalLexer.o MarginView.o \
|
|
|
|
PropSetSimple.o PlatGTK.o \
|
2019-05-04 18:14:48 +00:00
|
|
|
KeyMap.o LineMarker.o PositionCache.o ScintillaGTK.o ScintillaGTKAccessible.o CellBuffer.o CharacterCategory.o ViewStyle.o \
|
2010-08-21 23:59:56 +00:00
|
|
|
RESearch.o RunStyles.o Selection.o Style.o Indicator.o AutoComplete.o UniConversion.o XPM.o \
|
|
|
|
$(MARSHALLER) $(LEXOBJS)
|
2019-05-04 18:14:48 +00:00
|
|
|
$(AR) $(ARFLAGS) $@ $^
|
2010-08-21 23:59:56 +00:00
|
|
|
$(RANLIB) $@
|
|
|
|
|
|
|
|
# Automatically generate header dependencies with "make deps"
|
|
|
|
include deps.mak
|