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
|
|
|
|
2022-01-05 00:07:50 +01:00
|
|
|
DIR_O=.
|
2019-05-04 20:14:48 +02:00
|
|
|
DIR_BIN=../bin
|
|
|
|
|
|
|
|
COMPONENT = $(DIR_BIN)/Scintilla.dll
|
|
|
|
LIBSCI = $(DIR_BIN)/libscintilla.a
|
|
|
|
|
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
|
|
|
|
2022-01-05 00:07:50 +01:00
|
|
|
vpath %.h ../src ../include
|
|
|
|
vpath %.cxx ../src
|
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
|
|
|
|
2022-01-05 00:07:50 +01:00
|
|
|
INCLUDES=-I ../include -I ../src
|
2021-02-21 05:53:09 +01:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
2022-01-05 00:07:50 +01:00
|
|
|
all: $(COMPONENT) $(LIBSCI)
|
2009-04-25 01:35:41 +02:00
|
|
|
|
|
|
|
clean:
|
2022-01-05 00:07:50 +01:00
|
|
|
$(DEL) $(call normalize, $(addprefix $(DIR_O)/, *.exe *.o *.a *.obj *.dll *.res *.map *.plist) $(COMPONENT) $(LIBSCI))
|
2019-05-04 20:14:48 +02:00
|
|
|
|
2022-01-05 00:07:50 +01:00
|
|
|
$(DIR_O)/%.o: %.cxx
|
|
|
|
$(CXX) $(CXX_ALL_FLAGS) $(CXXFLAGS) -c $< -o $@
|
2013-08-28 02:44:27 +02:00
|
|
|
|
|
|
|
analyze:
|
2022-01-05 00:07:50 +01:00
|
|
|
$(CXX) --analyze $(CXX_ALL_FLAGS) $(CXXFLAGS) *.cxx ../src/*.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
|
|
|
|
2019-05-04 20:14:48 +02:00
|
|
|
# Required for base Scintilla
|
2021-02-21 05:53:09 +01:00
|
|
|
SRC_OBJS = \
|
2022-01-05 00:07:50 +01:00
|
|
|
$(DIR_O)/AutoComplete.o \
|
|
|
|
$(DIR_O)/CallTip.o \
|
|
|
|
$(DIR_O)/CaseConvert.o \
|
|
|
|
$(DIR_O)/CaseFolder.o \
|
|
|
|
$(DIR_O)/CellBuffer.o \
|
|
|
|
$(DIR_O)/CharacterCategoryMap.o \
|
|
|
|
$(DIR_O)/CharacterType.o \
|
|
|
|
$(DIR_O)/CharClassify.o \
|
|
|
|
$(DIR_O)/ContractionState.o \
|
|
|
|
$(DIR_O)/DBCS.o \
|
|
|
|
$(DIR_O)/Decoration.o \
|
|
|
|
$(DIR_O)/Document.o \
|
|
|
|
$(DIR_O)/EditModel.o \
|
|
|
|
$(DIR_O)/Editor.o \
|
|
|
|
$(DIR_O)/EditView.o \
|
|
|
|
$(DIR_O)/Geometry.o \
|
|
|
|
$(DIR_O)/Indicator.o \
|
|
|
|
$(DIR_O)/KeyMap.o \
|
|
|
|
$(DIR_O)/LineMarker.o \
|
|
|
|
$(DIR_O)/MarginView.o \
|
|
|
|
$(DIR_O)/PerLine.o \
|
|
|
|
$(DIR_O)/PositionCache.o \
|
|
|
|
$(DIR_O)/RESearch.o \
|
|
|
|
$(DIR_O)/RunStyles.o \
|
|
|
|
$(DIR_O)/Selection.o \
|
|
|
|
$(DIR_O)/Style.o \
|
|
|
|
$(DIR_O)/UniConversion.o \
|
|
|
|
$(DIR_O)/UniqueString.o \
|
|
|
|
$(DIR_O)/ViewStyle.o \
|
|
|
|
$(DIR_O)/XPM.o
|
2009-04-25 01:35:41 +02:00
|
|
|
|
2021-02-21 05:53:09 +01:00
|
|
|
COMPONENT_OBJS = \
|
|
|
|
$(SRC_OBJS) \
|
2022-01-05 00:07:50 +01:00
|
|
|
$(DIR_O)/HanjaDic.o \
|
|
|
|
$(DIR_O)/PlatWin.o \
|
|
|
|
$(DIR_O)/ScintillaBase.o \
|
|
|
|
$(DIR_O)/ScintillaWin.o
|
|
|
|
|
|
|
|
SHARED_OBJS = \
|
|
|
|
$(DIR_O)/ScintillaDLL.o \
|
|
|
|
$(DIR_O)/ScintRes.o
|
2021-02-21 05:53:09 +01:00
|
|
|
|
2022-01-05 00:07:50 +01:00
|
|
|
$(COMPONENT): $(COMPONENT_OBJS) $(SHARED_OBJS)
|
2021-02-21 05:53:09 +01:00
|
|
|
$(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
|
|
|
|
2022-01-05 00:07:50 +01:00
|
|
|
# Automatically generate dependencies for most files with "make depend"
|
2009-04-25 01:35:41 +02:00
|
|
|
include deps.mak
|
|
|
|
|
2022-01-05 00:07:50 +01:00
|
|
|
$(DIR_O)/ScintRes.o: ScintRes.rc
|
|
|
|
$(WINDRES) $< $@
|
2009-04-25 01:35:41 +02:00
|
|
|
|