2009-04-25 01:35:41 +02:00
|
|
|
# Make file for Scintilla on Windows
|
2021-02-21 05:53:09 +01:00
|
|
|
# @file makefile
|
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.
|
2021-02-21 05:53:09 +01:00
|
|
|
# This makefile assumes Mingw-w64 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.
|
2009-04-25 01:35:41 +02:00
|
|
|
|
2021-02-21 05:53:09 +01:00
|
|
|
.PHONY: all clean analyze depend
|
|
|
|
|
|
|
|
.SUFFIXES: .cxx .c .o .h .a
|
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
|
2021-02-28 01:45:09 +01:00
|
|
|
LIBLEX=$(DIR_BIN)/libscilexer.a
|
2019-05-04 20:14:48 +02:00
|
|
|
|
2021-02-21 05:53:09 +01:00
|
|
|
WARNINGS = -Wpedantic -Wall
|
|
|
|
|
2019-05-04 20:14:48 +02:00
|
|
|
ifdef CLANG
|
|
|
|
CXX = clang++
|
2021-02-21 05:53:09 +01:00
|
|
|
DEFINES += -D_CRT_SECURE_NO_DEPRECATE
|
2019-05-04 20:14:48 +02:00
|
|
|
else
|
|
|
|
# MinGW GCC
|
|
|
|
LIBSMINGW = -lstdc++
|
|
|
|
STRIPOPTION = -s
|
|
|
|
endif
|
2021-02-21 05:53:09 +01:00
|
|
|
ARFLAGS = rc
|
|
|
|
RANLIB ?= ranlib
|
|
|
|
WINDRES ?= windres
|
2019-05-04 20:14:48 +02:00
|
|
|
|
2021-02-21 05:53:09 +01:00
|
|
|
# Environment variable windir always defined on Win32
|
2019-05-04 20:14:48 +02:00
|
|
|
|
2021-02-21 05:53:09 +01:00
|
|
|
# Take care of changing Unix style '/' directory separator to '\' on Windows
|
|
|
|
normalize = $(if $(windir),$(subst /,\,$1),$1)
|
|
|
|
|
|
|
|
PYTHON = $(if $(windir),pyw,python3)
|
|
|
|
|
|
|
|
ifdef windir
|
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
|
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
|
|
|
|
2021-02-21 05:53:09 +01:00
|
|
|
LDFLAGS=-shared -static -mwindows
|
2019-05-04 20:14:48 +02:00
|
|
|
LIBS=-lgdi32 -luser32 -limm32 -lole32 -luuid -loleaut32 -lmsimg32 $(LIBSMINGW)
|
2015-06-07 23:19:26 +02:00
|
|
|
|
2021-02-21 05:53:09 +01:00
|
|
|
INCLUDES=-I ../include -I ../src -I../lexlib
|
|
|
|
|
|
|
|
BASE_FLAGS += $(WARNINGS)
|
2015-06-07 23:19:26 +02:00
|
|
|
|
2019-05-04 20:14:48 +02:00
|
|
|
ifdef NO_CXX11_REGEX
|
2021-02-21 05:53:09 +01:00
|
|
|
DEFINES += -DNO_CXX11_REGEX
|
2015-06-07 23:19:26 +02:00
|
|
|
endif
|
2009-04-25 01:35:41 +02:00
|
|
|
|
2021-02-21 05:53:09 +01:00
|
|
|
DEFINES += -D$(if $(DEBUG),DEBUG,NDEBUG)
|
|
|
|
BASE_FLAGS += $(if $(DEBUG),-g,-Os)
|
|
|
|
|
|
|
|
ifndef DEBUG
|
2019-05-04 20:14:48 +02:00
|
|
|
STRIPFLAG=$(STRIPOPTION)
|
2009-04-25 01:35:41 +02:00
|
|
|
endif
|
|
|
|
|
2021-02-21 05:53:09 +01:00
|
|
|
CXX_BASE_FLAGS =--std=c++17 $(BASE_FLAGS)
|
|
|
|
CXX_ALL_FLAGS =$(DEFINES) $(INCLUDES) $(CXX_BASE_FLAGS)
|
|
|
|
|
2021-02-28 01:45:09 +01:00
|
|
|
all: $(COMPONENT) $(LEXCOMPONENT) $(LIBSCI) $(LIBLEX)
|
2009-04-25 01:35:41 +02:00
|
|
|
|
|
|
|
clean:
|
2021-02-21 05:53:09 +01:00
|
|
|
$(DEL) *.exe *.o *.a *.obj *.dll *.res *.map *.plist $(call normalize,$(LIBSCI))
|
2019-05-04 20:14:48 +02:00
|
|
|
|
2021-02-21 05:53:09 +01:00
|
|
|
%.o: %.cxx
|
|
|
|
$(CXX) $(CXX_ALL_FLAGS) $(CXXFLAGS) -c $<
|
2013-08-28 02:44:27 +02:00
|
|
|
|
|
|
|
analyze:
|
2021-02-21 05:53:09 +01:00
|
|
|
$(CXX) --analyze $(CXX_ALL_FLAGS) $(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:
|
2021-02-21 05:53:09 +01:00
|
|
|
$(PYTHON) DepGen.py
|
2010-08-22 01:59:56 +02:00
|
|
|
|
2021-02-21 05:53:09 +01:00
|
|
|
LEX_OBJS:=$(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
|
2021-02-21 05:53:09 +01:00
|
|
|
SRC_OBJS = \
|
2010-08-22 01:59:56 +02:00
|
|
|
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
|
|
|
Indicator.o \
|
2021-02-21 05:53:09 +01:00
|
|
|
KeyMap.o \
|
2010-08-22 01:59:56 +02:00
|
|
|
LineMarker.o \
|
2015-06-07 23:19:26 +02:00
|
|
|
MarginView.o \
|
2010-08-22 01:59:56 +02:00
|
|
|
PerLine.o \
|
|
|
|
PositionCache.o \
|
|
|
|
PropSetSimple.o \
|
|
|
|
RESearch.o \
|
|
|
|
RunStyles.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 \
|
2021-02-21 05:53:09 +01:00
|
|
|
XPM.o
|
2009-04-25 01:35:41 +02:00
|
|
|
|
2021-02-28 01:45:09 +01:00
|
|
|
# To have PCRE boost regex with header only is integrated and not just the one from std
|
|
|
|
include ../../boostregex/nppSpecifics_mingw.mak
|
|
|
|
|
2019-05-04 20:14:48 +02:00
|
|
|
# Required by lexers
|
2021-02-21 05:53:09 +01:00
|
|
|
LEXLIB_OBJS = \
|
2010-08-22 01:59:56 +02:00
|
|
|
Accessor.o \
|
2021-02-21 05:53:09 +01:00
|
|
|
CatalogueL.o \
|
2019-05-04 20:14:48 +02:00
|
|
|
DefaultLexer.o \
|
2021-02-21 05:53:09 +01:00
|
|
|
ExternalLexer.o \
|
2010-08-22 01:59:56 +02:00
|
|
|
LexerBase.o \
|
|
|
|
LexerModule.o \
|
|
|
|
LexerSimple.o \
|
|
|
|
StyleContext.o \
|
2021-02-21 05:53:09 +01:00
|
|
|
WordList.o
|
2019-05-04 20:14:48 +02:00
|
|
|
|
|
|
|
# Required by libraries and DLLs that include lexing
|
2021-02-21 05:53:09 +01:00
|
|
|
SCILEX_OBJS=\
|
|
|
|
$(SRC_OBJS) \
|
|
|
|
$(LEXLIB_OBJS) \
|
|
|
|
$(LEX_OBJS) \
|
|
|
|
HanjaDic.o \
|
|
|
|
PlatWin.o \
|
|
|
|
ScintillaBaseL.o \
|
|
|
|
ScintillaWin.o
|
2009-04-25 01:35:41 +02:00
|
|
|
|
2021-02-21 05:53:09 +01:00
|
|
|
COMPONENT_OBJS = \
|
|
|
|
$(SRC_OBJS) \
|
|
|
|
Accessor.o \
|
|
|
|
Catalogue.o \
|
|
|
|
HanjaDic.o \
|
|
|
|
LexerBase.o \
|
|
|
|
LexerModule.o \
|
|
|
|
LexerSimple.o \
|
|
|
|
PlatWin.o \
|
|
|
|
ScintillaBase.o \
|
|
|
|
ScintillaDLL.o \
|
|
|
|
ScintillaWin.o \
|
|
|
|
ScintRes.o \
|
|
|
|
WordList.o
|
2019-05-04 20:14:48 +02:00
|
|
|
|
2021-02-21 05:53:09 +01:00
|
|
|
LEXCOMPONENT_OBJS = \
|
|
|
|
$(SCILEX_OBJS) \
|
|
|
|
ScintillaDLL.o \
|
|
|
|
ScintRes.o
|
2019-05-04 20:14:48 +02:00
|
|
|
|
2021-02-21 05:53:09 +01:00
|
|
|
$(COMPONENT): $(COMPONENT_OBJS)
|
|
|
|
$(CXX) $(LDFLAGS) -o $@ $(STRIPFLAG) $^ $(CXXFLAGS) $(LIBS)
|
|
|
|
|
|
|
|
$(LEXCOMPONENT): $(LEXCOMPONENT_OBJS)
|
|
|
|
$(CXX) $(LDFLAGS) -o $@ $(STRIPFLAG) $^ $(CXXFLAGS) $(LIBS)
|
|
|
|
|
|
|
|
$(LIBSCI): $(COMPONENT_OBJS)
|
|
|
|
$(AR) $(ARFLAGS) $@ $^
|
2019-05-04 20:14:48 +02:00
|
|
|
$(RANLIB) $@
|
2009-04-25 01:35:41 +02:00
|
|
|
|
2021-02-28 01:45:09 +01:00
|
|
|
$(LIBLEX): $(LEXCOMPONENT_OBJS)
|
|
|
|
$(AR) $(ARFLAGS) $@ $^
|
|
|
|
$(RANLIB) $@
|
|
|
|
|
2009-04-25 01:35:41 +02:00
|
|
|
# Automatically generate dependencies for most files with "make deps"
|
|
|
|
include deps.mak
|
|
|
|
|
|
|
|
ScintillaBaseL.o:
|
2021-02-21 05:53:09 +01:00
|
|
|
$(CXX) $(CXX_ALL_FLAGS) $(CXXFLAGS) -D SCI_LEXER -c $< -o $@
|
|
|
|
|
|
|
|
Catalogue.o: Catalogue.cxx
|
|
|
|
$(CXX) $(CXX_ALL_FLAGS) $(CXXFLAGS) -D SCI_LEXER -D SCI_EMPTYCATALOGUE -c $< -o $@
|
2009-04-25 01:35:41 +02:00
|
|
|
|
2021-02-21 05:53:09 +01:00
|
|
|
CatalogueL.o: Catalogue.cxx
|
|
|
|
$(CXX) $(CXX_ALL_FLAGS) $(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
|
|
|
|