2009-04-24 23:35:41 +00:00
|
|
|
# Make file for Scintilla on Windows
|
2021-02-21 04:53:09 +00:00
|
|
|
# @file makefile
|
2010-07-12 22:19:51 +00:00
|
|
|
# Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
|
2009-04-24 23:35:41 +00:00
|
|
|
# The License.txt file describes the conditions under which this software may be distributed.
|
2021-02-21 04:53:09 +00: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-24 23:35:41 +00:00
|
|
|
|
2021-02-21 04:53:09 +00:00
|
|
|
.PHONY: all clean analyze depend
|
|
|
|
|
|
|
|
.SUFFIXES: .cxx .c .o .h .a
|
2019-05-04 18:14:48 +00:00
|
|
|
|
|
|
|
DIR_BIN=../bin
|
|
|
|
|
|
|
|
COMPONENT = $(DIR_BIN)/Scintilla.dll
|
|
|
|
LEXCOMPONENT = $(DIR_BIN)/SciLexer.dll
|
|
|
|
LIBSCI = $(DIR_BIN)/libscintilla.a
|
2021-02-28 00:45:09 +00:00
|
|
|
LIBLEX=$(DIR_BIN)/libscilexer.a
|
2019-05-04 18:14:48 +00:00
|
|
|
|
2021-02-21 04:53:09 +00:00
|
|
|
WARNINGS = -Wpedantic -Wall
|
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
ifdef CLANG
|
|
|
|
CXX = clang++
|
2021-02-21 04:53:09 +00:00
|
|
|
DEFINES += -D_CRT_SECURE_NO_DEPRECATE
|
2019-05-04 18:14:48 +00:00
|
|
|
else
|
|
|
|
# MinGW GCC
|
|
|
|
LIBSMINGW = -lstdc++
|
|
|
|
STRIPOPTION = -s
|
|
|
|
endif
|
2021-02-21 04:53:09 +00:00
|
|
|
ARFLAGS = rc
|
|
|
|
RANLIB ?= ranlib
|
|
|
|
WINDRES ?= windres
|
2019-05-04 18:14:48 +00:00
|
|
|
|
2021-02-21 04:53:09 +00:00
|
|
|
# Environment variable windir always defined on Win32
|
2019-05-04 18:14:48 +00:00
|
|
|
|
2021-02-21 04:53:09 +00: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 18:14:48 +00:00
|
|
|
DEL = $(if $(wildcard $(dir $(SHELL))rm.exe), $(dir $(SHELL))rm.exe -f, del /q)
|
2015-06-07 21:19:26 +00:00
|
|
|
else
|
|
|
|
DEL = rm -f
|
|
|
|
endif
|
2009-04-24 23:35:41 +00:00
|
|
|
|
2010-08-21 23:59:56 +00:00
|
|
|
vpath %.h ../src ../include ../lexlib
|
|
|
|
vpath %.cxx ../src ../lexlib ../lexers
|
2009-04-24 23:35:41 +00:00
|
|
|
|
2021-02-21 04:53:09 +00:00
|
|
|
LDFLAGS=-shared -static -mwindows
|
2019-05-04 18:14:48 +00:00
|
|
|
LIBS=-lgdi32 -luser32 -limm32 -lole32 -luuid -loleaut32 -lmsimg32 $(LIBSMINGW)
|
2015-06-07 21:19:26 +00:00
|
|
|
|
2021-02-21 04:53:09 +00:00
|
|
|
INCLUDES=-I ../include -I ../src -I../lexlib
|
|
|
|
|
|
|
|
BASE_FLAGS += $(WARNINGS)
|
2015-06-07 21:19:26 +00:00
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
ifdef NO_CXX11_REGEX
|
2021-02-21 04:53:09 +00:00
|
|
|
DEFINES += -DNO_CXX11_REGEX
|
2015-06-07 21:19:26 +00:00
|
|
|
endif
|
2009-04-24 23:35:41 +00:00
|
|
|
|
2021-02-21 04:53:09 +00:00
|
|
|
DEFINES += -D$(if $(DEBUG),DEBUG,NDEBUG)
|
|
|
|
BASE_FLAGS += $(if $(DEBUG),-g,-Os)
|
|
|
|
|
|
|
|
ifndef DEBUG
|
2019-05-04 18:14:48 +00:00
|
|
|
STRIPFLAG=$(STRIPOPTION)
|
2009-04-24 23:35:41 +00:00
|
|
|
endif
|
|
|
|
|
2021-02-21 04:53:09 +00:00
|
|
|
CXX_BASE_FLAGS =--std=c++17 $(BASE_FLAGS)
|
|
|
|
CXX_ALL_FLAGS =$(DEFINES) $(INCLUDES) $(CXX_BASE_FLAGS)
|
|
|
|
|
2021-02-28 00:45:09 +00:00
|
|
|
all: $(COMPONENT) $(LEXCOMPONENT) $(LIBSCI) $(LIBLEX)
|
2009-04-24 23:35:41 +00:00
|
|
|
|
|
|
|
clean:
|
2021-02-21 04:53:09 +00:00
|
|
|
$(DEL) *.exe *.o *.a *.obj *.dll *.res *.map *.plist $(call normalize,$(LIBSCI))
|
2019-05-04 18:14:48 +00:00
|
|
|
|
2021-02-21 04:53:09 +00:00
|
|
|
%.o: %.cxx
|
|
|
|
$(CXX) $(CXX_ALL_FLAGS) $(CXXFLAGS) -c $<
|
2013-08-28 00:44:27 +00:00
|
|
|
|
|
|
|
analyze:
|
2021-02-21 04:53:09 +00:00
|
|
|
$(CXX) --analyze $(CXX_ALL_FLAGS) $(CXXFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx
|
2009-04-24 23:35:41 +00:00
|
|
|
|
2019-07-21 13:26:02 +00:00
|
|
|
depend deps.mak:
|
2021-02-21 04:53:09 +00:00
|
|
|
$(PYTHON) DepGen.py
|
2010-08-21 23:59:56 +00:00
|
|
|
|
2021-02-21 04:53:09 +00:00
|
|
|
LEX_OBJS:=$(addsuffix .o,$(basename $(sort $(notdir $(wildcard ../lexers/Lex*.cxx)))))
|
2010-08-21 23:59:56 +00:00
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
# Required for base Scintilla
|
2021-02-21 04:53:09 +00:00
|
|
|
SRC_OBJS = \
|
2010-08-21 23:59:56 +00:00
|
|
|
AutoComplete.o \
|
|
|
|
CallTip.o \
|
2013-08-28 00:44:27 +00:00
|
|
|
CaseConvert.o \
|
|
|
|
CaseFolder.o \
|
2010-08-21 23:59:56 +00:00
|
|
|
CellBuffer.o \
|
2013-08-28 00:44:27 +00:00
|
|
|
CharacterCategory.o \
|
2010-08-21 23:59:56 +00:00
|
|
|
CharacterSet.o \
|
|
|
|
CharClassify.o \
|
|
|
|
ContractionState.o \
|
2019-05-04 18:14:48 +00:00
|
|
|
DBCS.o \
|
2010-08-21 23:59:56 +00:00
|
|
|
Decoration.o \
|
|
|
|
Document.o \
|
2015-06-07 21:19:26 +00:00
|
|
|
EditModel.o \
|
2010-08-21 23:59:56 +00:00
|
|
|
Editor.o \
|
2015-06-07 21:19:26 +00:00
|
|
|
EditView.o \
|
2010-08-21 23:59:56 +00:00
|
|
|
Indicator.o \
|
2021-02-21 04:53:09 +00:00
|
|
|
KeyMap.o \
|
2010-08-21 23:59:56 +00:00
|
|
|
LineMarker.o \
|
2015-06-07 21:19:26 +00:00
|
|
|
MarginView.o \
|
2010-08-21 23:59:56 +00:00
|
|
|
PerLine.o \
|
|
|
|
PositionCache.o \
|
|
|
|
PropSetSimple.o \
|
|
|
|
RESearch.o \
|
|
|
|
RunStyles.o \
|
|
|
|
Selection.o \
|
|
|
|
Style.o \
|
|
|
|
UniConversion.o \
|
2019-07-21 13:26:02 +00:00
|
|
|
UniqueString.o \
|
2010-08-21 23:59:56 +00:00
|
|
|
ViewStyle.o \
|
2021-02-21 04:53:09 +00:00
|
|
|
XPM.o
|
2009-04-24 23:35:41 +00:00
|
|
|
|
2021-02-28 00:45:09 +00: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 18:14:48 +00:00
|
|
|
# Required by lexers
|
2021-02-21 04:53:09 +00:00
|
|
|
LEXLIB_OBJS = \
|
2010-08-21 23:59:56 +00:00
|
|
|
Accessor.o \
|
2021-02-21 04:53:09 +00:00
|
|
|
CatalogueL.o \
|
2019-05-04 18:14:48 +00:00
|
|
|
DefaultLexer.o \
|
2021-02-21 04:53:09 +00:00
|
|
|
ExternalLexer.o \
|
2010-08-21 23:59:56 +00:00
|
|
|
LexerBase.o \
|
|
|
|
LexerModule.o \
|
|
|
|
LexerSimple.o \
|
|
|
|
StyleContext.o \
|
2021-02-21 04:53:09 +00:00
|
|
|
WordList.o
|
2019-05-04 18:14:48 +00:00
|
|
|
|
|
|
|
# Required by libraries and DLLs that include lexing
|
2021-02-21 04:53:09 +00:00
|
|
|
SCILEX_OBJS=\
|
|
|
|
$(SRC_OBJS) \
|
|
|
|
$(LEXLIB_OBJS) \
|
|
|
|
$(LEX_OBJS) \
|
|
|
|
HanjaDic.o \
|
|
|
|
PlatWin.o \
|
|
|
|
ScintillaBaseL.o \
|
|
|
|
ScintillaWin.o
|
2009-04-24 23:35:41 +00:00
|
|
|
|
2021-02-21 04:53:09 +00: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 18:14:48 +00:00
|
|
|
|
2021-02-21 04:53:09 +00:00
|
|
|
LEXCOMPONENT_OBJS = \
|
|
|
|
$(SCILEX_OBJS) \
|
|
|
|
ScintillaDLL.o \
|
|
|
|
ScintRes.o
|
2019-05-04 18:14:48 +00:00
|
|
|
|
2021-02-21 04:53:09 +00: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 18:14:48 +00:00
|
|
|
$(RANLIB) $@
|
2009-04-24 23:35:41 +00:00
|
|
|
|
2021-02-28 00:45:09 +00:00
|
|
|
$(LIBLEX): $(LEXCOMPONENT_OBJS)
|
|
|
|
$(AR) $(ARFLAGS) $@ $^
|
|
|
|
$(RANLIB) $@
|
|
|
|
|
2009-04-24 23:35:41 +00:00
|
|
|
# Automatically generate dependencies for most files with "make deps"
|
|
|
|
include deps.mak
|
|
|
|
|
|
|
|
ScintillaBaseL.o:
|
2021-02-21 04:53:09 +00: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-24 23:35:41 +00:00
|
|
|
|
2021-02-21 04:53:09 +00:00
|
|
|
CatalogueL.o: Catalogue.cxx
|
|
|
|
$(CXX) $(CXX_ALL_FLAGS) $(CXXFLAGS) -D SCI_LEXER -c $< -o $@
|
2009-04-24 23:35:41 +00:00
|
|
|
|
2011-03-22 00:16:49 +00:00
|
|
|
ScintRes.o: ScintRes.rc
|
2015-06-07 21:19:26 +00:00
|
|
|
$(WINDRES) ScintRes.rc $@
|
2009-04-24 23:35:41 +00:00
|
|
|
|