2009-04-25 01:35:41 +02:00
|
|
|
# Make file for Scintilla on Windows
|
2010-07-13 00:19:51 +02:00
|
|
|
# Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
|
2009-04-25 01:35:41 +02:00
|
|
|
# The License.txt file describes the conditions under which this software may be distributed.
|
2019-05-04 20:14:48 +02:00
|
|
|
# This makefile assumes the Mingw-w64 version of GCC 7.1+ is used and changes will
|
2009-04-25 01:35:41 +02:00
|
|
|
# be needed to use other compilers.
|
|
|
|
|
|
|
|
.SUFFIXES: .cxx
|
2019-05-04 20:14:48 +02:00
|
|
|
|
|
|
|
DIR_BIN=../bin
|
|
|
|
|
|
|
|
COMPONENT = $(DIR_BIN)/Scintilla.dll
|
|
|
|
LEXCOMPONENT = $(DIR_BIN)/SciLexer.dll
|
|
|
|
LIBSCI = $(DIR_BIN)/libscintilla.a
|
|
|
|
|
|
|
|
ifdef CLANG
|
|
|
|
CXX = clang++
|
|
|
|
# Clang doesn't like omitting braces in array initialization but they just add noise,
|
|
|
|
# __uuidof is a Microsoft extension but makes COM code neater,
|
|
|
|
# public visibility avoids warnings like 'locally defined symbol __std_terminate imported'
|
|
|
|
CLANG_OPTS = -Wno-missing-braces -Wno-language-extension-token -Xclang -flto-visibility-public-std
|
|
|
|
else
|
|
|
|
# MinGW GCC
|
|
|
|
LDMINGW = -Wl,--enable-runtime-pseudo-reloc-v2 -Wl,--add-stdcall-alias
|
|
|
|
LIBSMINGW = -lstdc++
|
|
|
|
STRIPOPTION = -s
|
|
|
|
endif
|
|
|
|
|
|
|
|
CXXSTD = c++17
|
|
|
|
|
2015-06-07 23:19:26 +02:00
|
|
|
ifeq ($(OS),Windows_NT)
|
2019-05-04 20:14:48 +02:00
|
|
|
DEL = $(if $(wildcard $(dir $(SHELL))rm.exe), $(dir $(SHELL))rm.exe -f, del /q)
|
2015-06-07 23:19:26 +02:00
|
|
|
else
|
|
|
|
DEL = rm -f
|
|
|
|
endif
|
|
|
|
RANLIB ?= ranlib
|
|
|
|
WINDRES ?= windres
|
2009-04-25 01:35:41 +02:00
|
|
|
|
2010-08-22 01:59:56 +02:00
|
|
|
vpath %.h ../src ../include ../lexlib
|
|
|
|
vpath %.cxx ../src ../lexlib ../lexers
|
2009-04-25 01:35:41 +02:00
|
|
|
|
2019-05-04 20:14:48 +02:00
|
|
|
LDFLAGS=-shared -static -mwindows $(LDMINGW)
|
|
|
|
LIBS=-lgdi32 -luser32 -limm32 -lole32 -luuid -loleaut32 -lmsimg32 $(LIBSMINGW)
|
2009-04-25 01:35:41 +02:00
|
|
|
# Add -MMD to get dependencies
|
2010-08-22 01:59:56 +02:00
|
|
|
INCLUDEDIRS=-I ../include -I ../src -I../lexlib
|
2015-06-07 23:19:26 +02:00
|
|
|
|
2019-05-04 20:14:48 +02:00
|
|
|
CXXBASEFLAGS=--std=$(CXXSTD) -Wall -pedantic $(INCLUDEDIRS) -D_CRT_SECURE_NO_DEPRECATE=1 $(CLANG_OPTS)
|
2015-06-07 23:19:26 +02:00
|
|
|
|
2019-05-04 20:14:48 +02:00
|
|
|
ifdef NO_CXX11_REGEX
|
|
|
|
REFLAGS=-DNO_CXX11_REGEX
|
2015-06-07 23:19:26 +02:00
|
|
|
endif
|
2009-04-25 01:35:41 +02:00
|
|
|
|
|
|
|
ifdef DEBUG
|
2009-08-23 04:24:48 +02:00
|
|
|
CXXFLAGS=-DDEBUG -g $(CXXBASEFLAGS)
|
2009-04-25 01:35:41 +02:00
|
|
|
else
|
2009-08-23 04:24:48 +02:00
|
|
|
CXXFLAGS=-DNDEBUG -Os $(CXXBASEFLAGS)
|
2019-05-04 20:14:48 +02:00
|
|
|
STRIPFLAG=$(STRIPOPTION)
|
2009-04-25 01:35:41 +02:00
|
|
|
endif
|
|
|
|
|
2019-05-04 20:14:48 +02:00
|
|
|
all: $(COMPONENT) $(LEXCOMPONENT) $(LIBSCI)
|
2009-04-25 01:35:41 +02:00
|
|
|
|
|
|
|
clean:
|
2019-05-04 20:14:48 +02:00
|
|
|
$(DEL) *.exe *.o *.a *.obj *.dll *.res *.map *.plist
|
|
|
|
|
|
|
|
.cxx.o:
|
|
|
|
$(CXX) $(CXXFLAGS) $(REFLAGS) -c $<
|
2013-08-28 02:44:27 +02:00
|
|
|
|
|
|
|
analyze:
|
2019-05-04 20:14:48 +02:00
|
|
|
$(CXX) --analyze $(CXXFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx
|
2009-04-25 01:35:41 +02:00
|
|
|
|
2019-07-21 15:26:02 +02:00
|
|
|
depend deps.mak:
|
|
|
|
python DepGen.py
|
2010-08-22 01:59:56 +02:00
|
|
|
|
2019-05-04 20:14:48 +02:00
|
|
|
LEXOBJS:=$(addsuffix .o,$(basename $(sort $(notdir $(wildcard ../lexers/Lex*.cxx)))))
|
2010-08-22 01:59:56 +02:00
|
|
|
|
2019-05-04 20:14:48 +02:00
|
|
|
# Required for base Scintilla
|
2010-08-22 01:59:56 +02:00
|
|
|
BASEOBJS = \
|
|
|
|
AutoComplete.o \
|
|
|
|
CallTip.o \
|
2013-08-28 02:44:27 +02:00
|
|
|
CaseConvert.o \
|
|
|
|
CaseFolder.o \
|
2010-08-22 01:59:56 +02:00
|
|
|
CellBuffer.o \
|
2013-08-28 02:44:27 +02:00
|
|
|
CharacterCategory.o \
|
2010-08-22 01:59:56 +02:00
|
|
|
CharacterSet.o \
|
|
|
|
CharClassify.o \
|
|
|
|
ContractionState.o \
|
2019-05-04 20:14:48 +02:00
|
|
|
DBCS.o \
|
2010-08-22 01:59:56 +02:00
|
|
|
Decoration.o \
|
|
|
|
Document.o \
|
2015-06-07 23:19:26 +02:00
|
|
|
EditModel.o \
|
2010-08-22 01:59:56 +02:00
|
|
|
Editor.o \
|
2015-06-07 23:19:26 +02:00
|
|
|
EditView.o \
|
2010-08-22 01:59:56 +02:00
|
|
|
KeyMap.o \
|
|
|
|
Indicator.o \
|
|
|
|
LineMarker.o \
|
2015-06-07 23:19:26 +02:00
|
|
|
MarginView.o \
|
2010-08-22 01:59:56 +02:00
|
|
|
PerLine.o \
|
|
|
|
PlatWin.o \
|
|
|
|
PositionCache.o \
|
|
|
|
PropSetSimple.o \
|
|
|
|
RESearch.o \
|
|
|
|
RunStyles.o \
|
|
|
|
ScintRes.o \
|
|
|
|
Selection.o \
|
|
|
|
Style.o \
|
|
|
|
UniConversion.o \
|
2019-07-21 15:26:02 +02:00
|
|
|
UniqueString.o \
|
2010-08-22 01:59:56 +02:00
|
|
|
ViewStyle.o \
|
2015-06-07 23:19:26 +02:00
|
|
|
XPM.o \
|
|
|
|
HanjaDic.o
|
2010-08-22 01:59:56 +02:00
|
|
|
|
2019-05-04 20:14:48 +02:00
|
|
|
SOBJS = ScintillaDLL.o ScintillaWin.o ScintillaBase.o $(BASEOBJS)
|
2009-04-25 01:35:41 +02:00
|
|
|
|
2019-05-04 20:14:48 +02:00
|
|
|
# Required by lexers
|
|
|
|
LEXLIBOBJS=\
|
2010-08-22 01:59:56 +02:00
|
|
|
Accessor.o \
|
|
|
|
Catalogue.o \
|
|
|
|
ExternalLexer.o \
|
2019-05-04 20:14:48 +02:00
|
|
|
DefaultLexer.o \
|
2010-08-22 01:59:56 +02:00
|
|
|
LexerBase.o \
|
|
|
|
LexerModule.o \
|
|
|
|
LexerSimple.o \
|
|
|
|
StyleContext.o \
|
|
|
|
WordList.o \
|
2019-05-04 20:14:48 +02:00
|
|
|
|
|
|
|
# Required by libraries and DLLs that include lexing
|
|
|
|
SCILEXOBJS=\
|
2010-08-22 01:59:56 +02:00
|
|
|
$(BASEOBJS) \
|
2019-05-04 20:14:48 +02:00
|
|
|
$(LEXLIBOBJS) \
|
|
|
|
$(LEXOBJS) \
|
|
|
|
ScintillaBaseL.o
|
2009-04-25 01:35:41 +02:00
|
|
|
|
2019-05-04 20:14:48 +02:00
|
|
|
$(COMPONENT): $(SOBJS) Scintilla.def
|
|
|
|
$(CXX) $(LDFLAGS) -o $@ $(STRIPFLAG) $(SOBJS) $(CXXFLAGS) $(LIBS)
|
|
|
|
|
|
|
|
$(LEXCOMPONENT): ScintillaDLL.o ScintillaWinL.o $(SCILEXOBJS) Scintilla.def
|
|
|
|
$(CXX) $(LDFLAGS) -o $@ $(STRIPFLAG) ScintillaDLL.o ScintillaWinL.o $(SCILEXOBJS) $(CXXFLAGS) $(LIBS)
|
|
|
|
|
|
|
|
$(LIBSCI): ScintillaWin.o $(SCILEXOBJS)
|
2009-04-25 01:35:41 +02:00
|
|
|
$(AR) rc $@ $^
|
2019-05-04 20:14:48 +02:00
|
|
|
$(RANLIB) $@
|
2009-04-25 01:35:41 +02:00
|
|
|
|
|
|
|
# Automatically generate dependencies for most files with "make deps"
|
|
|
|
include deps.mak
|
|
|
|
|
|
|
|
ScintillaBaseL.o:
|
2015-06-07 23:19:26 +02:00
|
|
|
$(CXX) $(CXXFLAGS) -D SCI_LEXER -c $< -o $@
|
2009-04-25 01:35:41 +02:00
|
|
|
|
|
|
|
ScintillaWinL.o:
|
2015-06-07 23:19:26 +02:00
|
|
|
$(CXX) $(CXXFLAGS) -D SCI_LEXER -c $< -o $@
|
2009-04-25 01:35:41 +02:00
|
|
|
|
2011-03-22 01:16:49 +01:00
|
|
|
ScintRes.o: ScintRes.rc
|
2015-06-07 23:19:26 +02:00
|
|
|
$(WINDRES) ScintRes.rc $@
|
2009-04-25 01:35:41 +02:00
|
|
|
|