Debian Codegraph @

scintilla/win32/makefile

raw
1 # Make file for Scintilla on Windows
2 # @file makefile
3 # Copyright 1998-2010 by Neil Hodgson <[email protected]>
4 # The License.txt file describes the conditions under which this software may be distributed.
5 # This makefile assumes Mingw-w64 GCC 9.0+ is used and changes will be needed to use other compilers.
6 # Clang 9.0+ can be used with CLANG=1 on command line.
7
8 .PHONY: all clean analyze depend
9
10 .SUFFIXES: .cxx .c .o .h .a
11
12 DIR_O=.
13 DIR_BIN=../bin
14
15 COMPONENT = $(DIR_BIN)/Scintilla.dll
16 LIBSCI = $(DIR_BIN)/libscintilla.a
17
18 WARNINGS = -Wpedantic -Wall -Wextra
19
20 ifdef CLANG
21 CXX = clang++
22 else
23 # MinGW GCC
24 LIBSMINGW = -lstdc++
25 STRIPOPTION = -s
26 endif
27 ARFLAGS = rc
28 RANLIB ?= ranlib
29 WINDRES ?= windres
30
31 # Environment variable windir always defined on Win32
32
33 # Take care of changing Unix style '/' directory separator to '\' on Windows
34 normalize = $(if $(windir),$(subst /,\,$1),$1)
35
36 PYTHON = $(if $(windir),pyw,python3)
37
38 ifdef windir
39 DEL = $(if $(wildcard $(dir $(SHELL))rm.exe), $(dir $(SHELL))rm.exe -f, del /q)
40 else
41 DEL = rm -f
42 endif
43
44 vpath %.h ../src ../include
45 vpath %.cxx ../src
46
47 LDFLAGS=-shared -static -mwindows
48 LIBS=-lgdi32 -luser32 -limm32 -lole32 -luuid -loleaut32 -ladvapi32 $(LIBSMINGW)
49
50 INCLUDES=-I ../include -I ../src
51
52 BASE_FLAGS += $(WARNINGS)
53
54 ifdef NO_CXX11_REGEX
55 DEFINES += -DNO_CXX11_REGEX
56 endif
57
58 DEFINES += -D$(if $(DEBUG),DEBUG,NDEBUG)
59 BASE_FLAGS += $(if $(DEBUG),-g,-O3)
60
61 ifndef DEBUG
62 STRIPFLAG=$(STRIPOPTION)
63 endif
64
65 CXX_BASE_FLAGS =--std=c++17 $(BASE_FLAGS)
66 CXX_ALL_FLAGS =$(DEFINES) $(INCLUDES) $(CXX_BASE_FLAGS)
67
68 all: $(COMPONENT) $(LIBSCI)
69
70 clean:
71 $(DEL) $(call normalize, $(addprefix $(DIR_O)/, *.exe *.o *.a *.obj *.dll *.res *.map *.plist) $(COMPONENT) $(LIBSCI))
72
73 $(DIR_O)/%.o: %.cxx
74 $(CXX) $(CXX_ALL_FLAGS) $(CXXFLAGS) -c $< -o $@
75
76 analyze:
77 $(CXX) --analyze $(CXX_ALL_FLAGS) $(CXXFLAGS) *.cxx ../src/*.cxx
78
79 depend deps.mak:
80 $(PYTHON) DepGen.py
81
82 # Required for base Scintilla
83 SRC_OBJS = \
84 $(DIR_O)/AutoComplete.o \
85 $(DIR_O)/CallTip.o \
86 $(DIR_O)/CaseConvert.o \
87 $(DIR_O)/CaseFolder.o \
88 $(DIR_O)/CellBuffer.o \
89 $(DIR_O)/ChangeHistory.o \
90 $(DIR_O)/CharacterCategoryMap.o \
91 $(DIR_O)/CharacterType.o \
92 $(DIR_O)/CharClassify.o \
93 $(DIR_O)/ContractionState.o \
94 $(DIR_O)/DBCS.o \
95 $(DIR_O)/Decoration.o \
96 $(DIR_O)/Document.o \
97 $(DIR_O)/EditModel.o \
98 $(DIR_O)/Editor.o \
99 $(DIR_O)/EditView.o \
100 $(DIR_O)/Geometry.o \
101 $(DIR_O)/Indicator.o \
102 $(DIR_O)/KeyMap.o \
103 $(DIR_O)/LineMarker.o \
104 $(DIR_O)/MarginView.o \
105 $(DIR_O)/PerLine.o \
106 $(DIR_O)/PositionCache.o \
107 $(DIR_O)/RESearch.o \
108 $(DIR_O)/RunStyles.o \
109 $(DIR_O)/Selection.o \
110 $(DIR_O)/Style.o \
111 $(DIR_O)/UndoHistory.o \
112 $(DIR_O)/UniConversion.o \
113 $(DIR_O)/UniqueString.o \
114 $(DIR_O)/ViewStyle.o \
115 $(DIR_O)/XPM.o
116
117 COMPONENT_OBJS = \
118 $(SRC_OBJS) \
119 $(DIR_O)/HanjaDic.o \
120 $(DIR_O)/PlatWin.o \
121 $(DIR_O)/ScintillaBase.o \
122 $(DIR_O)/ScintillaWin.o
123
124 SHARED_OBJS = \
125 $(DIR_O)/ScintillaDLL.o \
126 $(DIR_O)/ScintRes.o
127
128 $(COMPONENT): $(COMPONENT_OBJS) $(SHARED_OBJS)
129 $(CXX) $(LDFLAGS) -o $@ $(STRIPFLAG) $^ $(CXXFLAGS) $(LIBS)
130
131 $(LIBSCI): $(COMPONENT_OBJS)
132 $(AR) $(ARFLAGS) $@ $^
133 $(RANLIB) $@
134
135 # Automatically generate dependencies for most files with "make depend"
136 include deps.mak
137
138 $(DIR_O)/ScintRes.o: ScintRes.rc
139 $(WINDRES) $< $@
140