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.
|
|
|
|
|
|
|
|
.SUFFIXES: .cxx .c .o .h .a
|
|
|
|
ifdef CLANG
|
2015-06-07 21:19:26 +00:00
|
|
|
CXX = clang++ -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
|
2010-08-21 23:59:56 +00:00
|
|
|
endif
|
|
|
|
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
|
|
|
|
|
2011-03-22 00:16:49 +00:00
|
|
|
ifdef windir
|
|
|
|
DEL = del /q
|
|
|
|
COMPLIB=..\bin\scintilla.a
|
|
|
|
else
|
|
|
|
DEL = rm -f
|
2010-08-21 23:59:56 +00:00
|
|
|
COMPLIB=../bin/scintilla.a
|
2011-03-22 00:16:49 +00:00
|
|
|
endif
|
2010-08-21 23:59:56 +00:00
|
|
|
|
|
|
|
vpath %.h ../src ../include ../lexlib
|
|
|
|
vpath %.cxx ../src ../lexlib ../lexers
|
|
|
|
|
|
|
|
INCLUDEDIRS=-I ../include -I ../src -I ../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
|
2015-06-07 21:19:26 +00:00
|
|
|
CXXBASEFLAGS=-Wall -pedantic -DGTK -DSCI_LEXER $(INCLUDEDIRS) $(DEPRECATED)
|
2010-08-21 23:59:56 +00:00
|
|
|
|
|
|
|
ifdef NOTHREADS
|
|
|
|
THREADFLAGS=-DG_THREADS_IMPL_NONE
|
|
|
|
else
|
|
|
|
THREADFLAGS=
|
|
|
|
endif
|
|
|
|
|
2015-06-07 21:19:26 +00:00
|
|
|
ifdef CXX11_REGEX
|
|
|
|
REFLAGS=-DCXX11_REGEX
|
|
|
|
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
|
|
|
|
|
2015-06-07 21:19:26 +00:00
|
|
|
CFLAGS:=$(CTFLAGS)
|
|
|
|
CXXTFLAGS:=--std=c++0x $(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
|
|
|
|
|
|
|
|
.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:
|
2015-06-07 21:19:26 +00:00
|
|
|
$(CC) $(CONFIGFLAGS) $(CFLAGS) -w -c $<
|
2010-08-21 23:59:56 +00:00
|
|
|
|
|
|
|
LEXOBJS:=$(addsuffix .o,$(basename $(notdir $(wildcard ../lexers/Lex*.cxx))))
|
|
|
|
|
|
|
|
all: $(COMPLIB)
|
|
|
|
|
|
|
|
clean:
|
2013-08-28 00:44:27 +00:00
|
|
|
$(DEL) *.o $(COMPLIB) *.plist
|
|
|
|
|
|
|
|
analyze:
|
|
|
|
clang --analyze $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx
|
2010-08-21 23:59:56 +00:00
|
|
|
|
|
|
|
deps:
|
2015-06-07 21:19:26 +00:00
|
|
|
$(CXX) -MM $(CONFIGFLAGS) $(CXXTFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx | sed -e 's/\/usr.* //' | grep [a-zA-Z] >deps.mak
|
2010-08-21 23:59:56 +00:00
|
|
|
|
|
|
|
$(COMPLIB): Accessor.o CharacterSet.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 \
|
2013-08-28 00:44:27 +00:00
|
|
|
KeyMap.o LineMarker.o PositionCache.o ScintillaGTK.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)
|
|
|
|
$(AR) rc $@ $^
|
|
|
|
$(RANLIB) $@
|
|
|
|
|
|
|
|
# Automatically generate header dependencies with "make deps"
|
|
|
|
include deps.mak
|