Update Scintilla to version 3.5.2
[TortoiseGit.git] / ext / scintilla / win32 / makefile
blob37d3f9a951588a0f56189aa8b0c949281096f09c
1 # Make file for Scintilla on Windows
2 # Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
3 # The License.txt file describes the conditions under which this software may be distributed.
4 # This makefile assumes the MinGW32 version of GCC 4.x is used and changes will
5 # be needed to use other compilers.
7 .SUFFIXES: .cxx
8 ifeq ($(OS),Windows_NT)
9 DEL = del /q
10 else
11 DEL = rm -f
12 endif
13 RANLIB ?= ranlib
14 WINDRES ?= windres
16 COMPONENT = ../bin/Scintilla.dll
17 LEXCOMPONENT = ../bin/SciLexer.dll
18 LEXLIB = Lexers.a
20 vpath %.h ../src ../include ../lexlib
21 vpath %.cxx ../src ../lexlib ../lexers
23 LDFLAGS=-shared -static -Wl,--enable-runtime-pseudo-reloc-v2 -mwindows -Wl,--add-stdcall-alias
24 LIBS=-lstdc++ -limm32 -lole32 -luuid
25 # Add -MMD to get dependencies
26 INCLUDEDIRS=-I ../include -I ../src -I../lexlib
28 # Check if Direct2D headers are available by trying to compile a file that includes them.
29 # Most distributions of MinGW32 do not include Direct2D support but MinGW64 does.
30 ifneq "$(shell g++ -c CheckD2D.cxx 2>&1)" ""
31 D2DFLAGS=-DDISABLE_D2D
32 endif
34 CXXBASEFLAGS=--std=c++0x -Wall -pedantic $(INCLUDEDIRS) -fno-rtti $(D2DFLAGS)
36 ifdef CXX11_REGEX
37 REFLAGS=-DCXX11_REGEX
38 endif
40 ifdef DEBUG
41 CXXFLAGS=-DDEBUG -g $(CXXBASEFLAGS)
42 else
43 CXXFLAGS=-DNDEBUG -Os $(CXXBASEFLAGS)
44 STRIPFLAG=-s
45 endif
47 .cxx.o:
48 $(CXX) $(CXXFLAGS) $(REFLAGS) -c $<
50 ALL: $(COMPONENT) $(LEXCOMPONENT) $(LEXLIB) ScintillaWinS.o
52 clean:
53 $(DEL) *.exe *.o *.obj *.dll *.res *.map *.plist
55 analyze:
56 clang --analyze -D DISABLE_D2D $(CXXFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx
58 deps:
59 $(CXX) -MM $(CXXFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx >deps.mak
61 LEXOBJS:=$(addsuffix .o,$(basename $(notdir $(wildcard ../lexers/Lex*.cxx))))
64 BASEOBJS = \
65 AutoComplete.o \
66 CallTip.o \
67 CaseConvert.o \
68 CaseFolder.o \
69 CellBuffer.o \
70 CharacterCategory.o \
71 CharacterSet.o \
72 CharClassify.o \
73 ContractionState.o \
74 Decoration.o \
75 Document.o \
76 EditModel.o \
77 Editor.o \
78 EditView.o \
79 KeyMap.o \
80 Indicator.o \
81 LineMarker.o \
82 MarginView.o \
83 PerLine.o \
84 PlatWin.o \
85 PositionCache.o \
86 PropSetSimple.o \
87 RESearch.o \
88 RunStyles.o \
89 ScintRes.o \
90 Selection.o \
91 Style.o \
92 UniConversion.o \
93 ViewStyle.o \
94 XPM.o
96 SOBJS = ScintillaWin.o ScintillaBase.o $(BASEOBJS)
98 $(COMPONENT): $(SOBJS) Scintilla.def
99 $(CXX) $(LDFLAGS) -o $@ $(STRIPFLAG) $(SOBJS) $(CXXFLAGS) $(LIBS)
101 LOBJS = \
102 Accessor.o \
103 Catalogue.o \
104 ExternalLexer.o \
105 LexerBase.o \
106 LexerModule.o \
107 LexerSimple.o \
108 ScintillaWinL.o \
109 ScintillaBaseL.o \
110 StyleContext.o \
111 WordList.o \
112 $(BASEOBJS) \
113 $(LEXOBJS)
114 $(LEXCOMPONENT): $(LOBJS) Scintilla.def
115 $(CXX) $(LDFLAGS) -o $@ $(STRIPFLAG) $(LOBJS) $(CXXFLAGS) $(LIBS)
117 $(LEXLIB): $(LEXOBJS)
118 $(AR) rc $@ $^
119 $(RANLIB) $@
121 # Automatically generate dependencies for most files with "make deps"
122 include deps.mak
124 # These dependencies are maintained by hand as they do not use the default output name
126 ScintillaBaseL.o: ScintillaBase.cxx Platform.h \
127 ILexer.h Scintilla.h SciLexer.h PropSetSimple.h \
128 SplitVector.h Partitioning.h RunStyles.h \
129 ContractionState.h CellBuffer.h CallTip.h \
130 KeyMap.h Indicator.h XPM.h LineMarker.h \
131 Style.h ViewStyle.h AutoComplete.h \
132 CharClassify.h Decoration.h Document.h \
133 Selection.h PositionCache.h EditModel.h Editor.h EditView.h \
134 ScintillaBase.h LexAccessor.h Accessor.h \
135 LexerModule.h Catalogue.h CaseFolder.h
137 ScintillaWinL.o: ScintillaWin.cxx Platform.h \
138 ILexer.h Scintilla.h SplitVector.h \
139 Partitioning.h RunStyles.h ContractionState.h \
140 CellBuffer.h CallTip.h KeyMap.h Indicator.h \
141 XPM.h LineMarker.h Style.h AutoComplete.h \
142 ViewStyle.h CharClassify.h Decoration.h \
143 Document.h Selection.h PositionCache.h \
144 EditModel.h Editor.h EditView.h ScintillaBase.h UniConversion.h \
145 LexAccessor.h Accessor.h \
146 LexerModule.h Catalogue.h CaseConvert.h \
147 CaseFolder.h
149 ScintillaWinS.o: ScintillaWin.cxx Platform.h \
150 ILexer.h Scintilla.h SplitVector.h \
151 Partitioning.h RunStyles.h ContractionState.h \
152 CellBuffer.h CallTip.h KeyMap.h Indicator.h \
153 XPM.h LineMarker.h Style.h AutoComplete.h \
154 ViewStyle.h CharClassify.h Decoration.h \
155 Document.h Selection.h PositionCache.h \
156 EditModel.h Editor.h EditView.h ScintillaBase.h UniConversion.h \
157 CaseConvert.h CaseFolder.h
159 ScintillaBaseL.o:
160 $(CXX) $(CXXFLAGS) -D SCI_LEXER -c $< -o $@
162 ScintillaWinS.o:
163 $(CXX) $(CXXFLAGS) -D STATIC_BUILD -c $< -o $@
165 ScintillaWinL.o:
166 $(CXX) $(CXXFLAGS) -D SCI_LEXER -c $< -o $@
168 ScintRes.o: ScintRes.rc
169 $(WINDRES) ScintRes.rc $@