-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
179 lines (150 loc) · 6.22 KB
/
Makefile
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
OPTIMIZE=$(OPT)
CCPP=clang++
ifneq ($(OPTIMIZE), true)
OPTFLAGS=-O0 -g
OBJDIR=obj
else
OPTFLAGS=-O3 -g
OBJDIR=opt
endif
DEPSDIR=$(OBJDIR)/deps
PANTHER_INCLUDE_FLAGS=-Ifiles -Ios -Ios/macos -Irust/include -Isettings -Isyntax -Isyntax/languages \
-Itesting -Itext -Ithird_party/concurrent_queue -Ithird_party/json \
-Ithird_party/re2 -Iui -Iui/controls \
-Iui/controls/basic -Iui/controls/main -Iui/controls/textfield -Iutils
SKIA_INCLUDE_FLAGS=-I/Users/myth/Sources/skia/skia/include/core \
-I/Users/myth/Sources/skia/skia/include/config \
-I/Users/myth/Sources/skia/skia/include/codec \
-I/Users/myth/Sources/skia/skia/include/effects
SKIA_LDFLAGS=-L/Users/myth/Sources/skia/skia/out/Static-Release-PNG -lskia
ICU_INCLUDE_FLAGS=
ICU_LDFLAGS=-licuuc -licutu -liculx -licuio -licule -licudata -licui18n
CPPFLAGS=-std=c++11
OBJCFLAGS=-fobjc-arc
ifneq ($(OPTIMIZE), true)
CPPFLAGS+=-DPANTHER_DEBUG -DPANTHER_TESTS -fsanitize=address
CARGO_FLAGS=
RUST_LDFLAGS=-Lrust/target/debug -lpgrust
else
CARGO_FLAGS=--release
RUST_LDFLAGS=-Lrust/target/release -lpgrust
endif
LDFLAGS=-framework AppKit -lobjc -L/opt/local/lib $(ICU_LDFLAGS) $(SKIA_LDFLAGS) $(RUST_LDFLAGS)
INCLUDE_FLAGS=$(SKIA_INCLUDE_FLAGS) $(ICU_INCLUDE_FLAGS) $(PANTHER_INCLUDE_FLAGS)
COBJECTS=$(OBJDIR)/files/directory.o \
$(OBJDIR)/files/file.o \
$(OBJDIR)/files/filemanager.o \
$(OBJDIR)/files/searchindex.o \
$(OBJDIR)/os/windowfunctions.o \
$(OBJDIR)/settings/globalsettings.o \
$(OBJDIR)/settings/keybindings.o \
$(OBJDIR)/settings/settings.o \
$(OBJDIR)/settings/style.o \
$(OBJDIR)/settings/workspace.o \
$(OBJDIR)/syntax/language.o \
$(OBJDIR)/syntax/languages/c.o \
$(OBJDIR)/syntax/languages/findresults.o \
$(OBJDIR)/syntax/languages/keywords.o \
$(OBJDIR)/syntax/languages/xml.o \
$(OBJDIR)/syntax/syntaxhighlighter.o \
$(OBJDIR)/testing/replaymanager.o \
$(OBJDIR)/text/cursor.o \
$(OBJDIR)/text/encoding.o \
$(OBJDIR)/text/findtextmanager.o \
$(OBJDIR)/text/regex.o \
$(OBJDIR)/text/text.o \
$(OBJDIR)/text/textbuffer.o \
$(OBJDIR)/text/textdelta.o \
$(OBJDIR)/text/textfile.o \
$(OBJDIR)/text/textiterator.o \
$(OBJDIR)/text/textline.o \
$(OBJDIR)/text/textposition.o \
$(OBJDIR)/text/textview.o \
$(OBJDIR)/text/unicode.o \
$(OBJDIR)/text/wrappedtextiterator.o \
$(OBJDIR)/ui/controls/basic/button.o \
$(OBJDIR)/ui/controls/basic/decoratedscrollbar.o \
$(OBJDIR)/ui/controls/basic/label.o \
$(OBJDIR)/ui/controls/basic/scrollbar.o \
$(OBJDIR)/ui/controls/basic/splitter.o \
$(OBJDIR)/ui/controls/basic/togglebutton.o \
$(OBJDIR)/ui/controls/container.o \
$(OBJDIR)/ui/controls/control.o \
$(OBJDIR)/ui/controls/controlmanager.o \
$(OBJDIR)/ui/controls/main/findtext.o \
$(OBJDIR)/ui/controls/main/goto.o \
$(OBJDIR)/ui/controls/main/projectexplorer.o \
$(OBJDIR)/ui/controls/main/searchbox.o \
$(OBJDIR)/ui/controls/main/statusbar.o \
$(OBJDIR)/ui/controls/main/statusnotification.o \
$(OBJDIR)/ui/controls/main/toolbar.o \
$(OBJDIR)/ui/controls/notification.o \
$(OBJDIR)/ui/controls/textfield/basictextfield.o \
$(OBJDIR)/ui/controls/textfield/simpletextfield.o \
$(OBJDIR)/ui/controls/textfield/tabcontrol.o \
$(OBJDIR)/ui/controls/textfield/textfield.o \
$(OBJDIR)/ui/controls/textfield/textfieldcontainer.o \
$(OBJDIR)/ui/renderer.o \
$(OBJDIR)/utils/logger.o \
$(OBJDIR)/utils/scheduler.o \
$(OBJDIR)/utils/thread.o \
$(OBJDIR)/utils/utils.o
OBJCOBJECTS=$(OBJDIR)/os/macos/AppDelegate.o \
$(OBJDIR)/os/macos/main.o \
$(OBJDIR)/os/macos/PGView.o \
$(OBJDIR)/os/macos/PGWindow.o
RE2OBJECTS=$(OBJDIR)/third_party/re2/re2/bitstate.o \
$(OBJDIR)/third_party/re2/re2/compile.o \
$(OBJDIR)/third_party/re2/re2/dfa.o \
$(OBJDIR)/third_party/re2/re2/filtered_re2.o \
$(OBJDIR)/third_party/re2/re2/mimics_pcre.o \
$(OBJDIR)/third_party/re2/re2/nfa.o \
$(OBJDIR)/third_party/re2/re2/onepass.o \
$(OBJDIR)/third_party/re2/re2/parse.o \
$(OBJDIR)/third_party/re2/re2/perl_groups.o \
$(OBJDIR)/third_party/re2/re2/prefilter.o \
$(OBJDIR)/third_party/re2/re2/prefilter_tree.o \
$(OBJDIR)/third_party/re2/re2/prog.o \
$(OBJDIR)/third_party/re2/re2/re2.o \
$(OBJDIR)/third_party/re2/re2/regexp.o \
$(OBJDIR)/third_party/re2/re2/set.o \
$(OBJDIR)/third_party/re2/re2/simplify.o \
$(OBJDIR)/third_party/re2/re2/stringpiece.o \
$(OBJDIR)/third_party/re2/re2/tostring.o \
$(OBJDIR)/third_party/re2/re2/unicode_casefold.o \
$(OBJDIR)/third_party/re2/re2/unicode_groups.o \
$(OBJDIR)/third_party/re2/util/rune.o \
$(OBJDIR)/third_party/re2/util/strutil.o
#MAINOBJECTS=$(OBJDIR)/main.o
#TESTOBJECTS=$(OBJDIR)/testmain.o \
$(OBJDIR)/tester.o
.PHONY: all clean test create_build_directory rust.app panther.app
all: create_build_directory $(RE2OBJECTS) $(COBJECTS) $(OBJCOBJECTS) $(MAINOBJECTS) rust.app panther.app
#test: create_build_directory $(RE2OBJECTS) $(COBJECTS) $(OBJCOBJECTS) $(TESTOBJECTS) rust.app test_output
clean:
rm -rf obj
rm -rf opt
rm -f main.app
create_build_directory:
mkdir -p $(OBJDIR)
mkdir -p $(DEPSDIR)
DEPS = $(shell find $(DEPSDIR) -name "*.d")
-include $(DEPS)
rust.app:
cd rust && cargo build $(CARGO_FLAGS) && cd ..
$(OBJDIR)/%.o: %.cc
mkdir -p $(shell dirname $@)
mkdir -p $(subst $(OBJDIR),$(DEPSDIR),$(shell dirname $@))
$(CCPP) $(CPPFLAGS) -MMD -MF $(subst $(OBJDIR),$(DEPSDIR),$(subst .o,.d,$@)) $(INCLUDE_FLAGS) $(OPTFLAGS) -c $(subst $(OBJDIR)/,,$(subst .o,.cc,$@)) -o $@
$(OBJDIR)/%.o: %.mm
mkdir -p $(shell dirname $@)
mkdir -p $(subst $(OBJDIR),$(DEPSDIR),$(shell dirname $@))
$(CCPP) $(OBJCFLAGS) -MMD -MF $(subst $(OBJDIR),$(DEPSDIR),$(subst .o,.d,$@)) $(CPPFLAGS) $(INCLUDE_FLAGS) $(OPTFLAGS) -c $(subst $(OBJDIR)/,,$(subst .o,.mm,$@)) -o $@
$(OBJDIR)/%.o: %.cpp
mkdir -p $(shell dirname $@)
mkdir -p $(subst $(OBJDIR),$(DEPSDIR),$(shell dirname $@))
$(CCPP) $(CPPFLAGS) -MMD -MF $(subst $(OBJDIR),$(DEPSDIR),$(subst .o,.d,$@)) $(INCLUDE_FLAGS) $(OPTFLAGS) -c $(subst $(OBJDIR)/,,$(subst .o,.cpp,$@)) -o $@
test_output:
$(CCPP) $(OBJCFLAGS) $(LDFLAGS) $(CPPFLAGS) $(INCLUDE_FLAGS) $(OBJCOBJECTS) $(RE2OBJECTS) $(COBJECTS) $(TESTOBJECTS) $(OPTFLAGS) -o test.out
panther.app:
$(CCPP) $(OBJCFLAGS) $(LDFLAGS) $(CPPFLAGS) $(INCLUDE_FLAGS) $(OBJCOBJECTS) $(RE2OBJECTS) $(MAINOBJECTS) $(COBJECTS) $(OPTFLAGS) -o main.app