File: makefile

package info (click to toggle)
codequery 1.0.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,860 kB
  • sloc: cpp: 151,420; xml: 16,576; python: 5,602; ansic: 5,487; makefile: 559; perl: 496; ruby: 209; sql: 194; sh: 106; php: 53; vhdl: 51; erlang: 47; objc: 22; lisp: 18; cobol: 18; modula3: 17; asm: 14; fortran: 12; ml: 11; tcl: 6
file content (140 lines) | stat: -rw-r--r-- 3,369 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# Make file for Scintilla on Windows
# @file makefile
# Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
# The License.txt file describes the conditions under which this software may be distributed.
# 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.

.PHONY: all clean analyze depend

.SUFFIXES: .cxx .c .o .h .a

DIR_O=.
DIR_BIN=../bin

COMPONENT = $(DIR_BIN)/Scintilla.dll
LIBSCI = $(DIR_BIN)/libscintilla.a

WARNINGS = -Wpedantic -Wall -Wextra

ifdef CLANG
CXX = clang++
else
# MinGW GCC
LIBSMINGW = -lstdc++
STRIPOPTION = -s
endif
ARFLAGS = rc
RANLIB ?= ranlib
WINDRES ?= windres

# Environment variable windir always defined on Win32

# Take care of changing Unix style '/' directory separator to '\' on Windows
normalize = $(if $(windir),$(subst /,\,$1),$1)

PYTHON = $(if $(windir),pyw,python3)

ifdef windir
DEL = $(if $(wildcard $(dir $(SHELL))rm.exe), $(dir $(SHELL))rm.exe -f, del /q)
else
DEL = rm -f
endif

vpath %.h ../src ../include
vpath %.cxx ../src

LDFLAGS=-shared -static -mwindows
LIBS=-lgdi32 -luser32 -limm32 -lole32 -luuid -loleaut32 -ladvapi32 $(LIBSMINGW)

INCLUDES=-I ../include -I ../src

BASE_FLAGS += $(WARNINGS)

ifdef NO_CXX11_REGEX
DEFINES += -DNO_CXX11_REGEX
endif

DEFINES += -D$(if $(DEBUG),DEBUG,NDEBUG)
BASE_FLAGS += $(if $(DEBUG),-g,-O3)

ifndef DEBUG
STRIPFLAG=$(STRIPOPTION)
endif

CXX_BASE_FLAGS =--std=c++17 $(BASE_FLAGS)
CXX_ALL_FLAGS =$(DEFINES) $(INCLUDES) $(CXX_BASE_FLAGS)

all:	$(COMPONENT) $(LIBSCI)

clean:
	$(DEL) $(call normalize, $(addprefix $(DIR_O)/, *.exe *.o *.a *.obj *.dll *.res *.map *.plist) $(COMPONENT) $(LIBSCI))

$(DIR_O)/%.o: %.cxx
	$(CXX) $(CXX_ALL_FLAGS) $(CXXFLAGS) -c $< -o $@

analyze:
	$(CXX) --analyze $(CXX_ALL_FLAGS) $(CXXFLAGS) *.cxx ../src/*.cxx

depend deps.mak:
	$(PYTHON) DepGen.py

# Required for base Scintilla
SRC_OBJS = \
	$(DIR_O)/AutoComplete.o \
	$(DIR_O)/CallTip.o \
	$(DIR_O)/CaseConvert.o \
	$(DIR_O)/CaseFolder.o \
	$(DIR_O)/CellBuffer.o \
	$(DIR_O)/ChangeHistory.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)/UndoHistory.o \
	$(DIR_O)/UniConversion.o \
	$(DIR_O)/UniqueString.o \
	$(DIR_O)/ViewStyle.o \
	$(DIR_O)/XPM.o

COMPONENT_OBJS = \
	$(SRC_OBJS) \
	$(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

$(COMPONENT): $(COMPONENT_OBJS) $(SHARED_OBJS)
	$(CXX) $(LDFLAGS) -o $@ $(STRIPFLAG) $^ $(CXXFLAGS) $(LIBS)

$(LIBSCI): $(COMPONENT_OBJS)
	$(AR) $(ARFLAGS) $@ $^
	$(RANLIB) $@

# Automatically generate dependencies for most files with "make depend"
include deps.mak

$(DIR_O)/ScintRes.o: ScintRes.rc
	$(WINDRES) $< $@