Mercurial > hg > pub > prymula > com
comparison DPF-Prymula-audioplugins/dpf/dgl/Makefile @ 3:84e66ea83026
DPF-Prymula-audioplugins-0.231015-2
author | prymula <prymula76@outlook.com> |
---|---|
date | Mon, 16 Oct 2023 21:53:34 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
2:cf2cb71d31dd | 3:84e66ea83026 |
---|---|
1 #!/usr/bin/make -f | |
2 # Makefile for DGL # | |
3 # ---------------- # | |
4 # Created by falkTX | |
5 # | |
6 | |
7 include ../Makefile.base.mk | |
8 | |
9 # --------------------------------------------------------------------------------------------------------------------- | |
10 | |
11 BUILD_C_FLAGS += $(DGL_FLAGS) -I. -Isrc | |
12 BUILD_CXX_FLAGS += $(DGL_FLAGS) -I. -Isrc -DDONT_SET_USING_DGL_NAMESPACE -Wno-unused-parameter | |
13 BUILD_CXX_FLAGS += -Isrc/pugl-upstream/include | |
14 LINK_FLAGS += $(DGL_LIBS) | |
15 | |
16 ifeq ($(MACOS),true) | |
17 BUILD_CXX_FLAGS += -Wno-deprecated-declarations | |
18 else | |
19 PUGL_EXTRA_FLAGS = -Wno-extra -Wmissing-field-initializers | |
20 endif | |
21 | |
22 # ifneq ($(MACOS_OLD),true) | |
23 # needed by sofd right now, fix later | |
24 # BUILD_CXX_FLAGS += -Wno-type-limits -fpermissive | |
25 # endif | |
26 | |
27 # --------------------------------------------------------------------------------------------------------------------- | |
28 | |
29 ifeq ($(MODGUI_BUILD),true) | |
30 BUILD_DIR_SUFFIX = -modgui | |
31 endif | |
32 | |
33 BUILD_DIR = ../build$(BUILD_DIR_SUFFIX) | |
34 | |
35 # --------------------------------------------------------------------------------------------------------------------- | |
36 | |
37 OBJS_common = \ | |
38 $(BUILD_DIR)/dgl/Application.cpp.o \ | |
39 $(BUILD_DIR)/dgl/ApplicationPrivateData.cpp.o \ | |
40 $(BUILD_DIR)/dgl/Color.cpp.o \ | |
41 $(BUILD_DIR)/dgl/EventHandlers.cpp.o \ | |
42 $(BUILD_DIR)/dgl/Geometry.cpp.o \ | |
43 $(BUILD_DIR)/dgl/ImageBase.cpp.o \ | |
44 $(BUILD_DIR)/dgl/ImageBaseWidgets.cpp.o \ | |
45 $(BUILD_DIR)/dgl/Layout.cpp.o \ | |
46 $(BUILD_DIR)/dgl/Resources.cpp.o \ | |
47 $(BUILD_DIR)/dgl/SubWidget.cpp.o \ | |
48 $(BUILD_DIR)/dgl/SubWidgetPrivateData.cpp.o \ | |
49 $(BUILD_DIR)/dgl/TopLevelWidget.cpp.o \ | |
50 $(BUILD_DIR)/dgl/TopLevelWidgetPrivateData.cpp.o \ | |
51 $(BUILD_DIR)/dgl/Widget.cpp.o \ | |
52 $(BUILD_DIR)/dgl/WidgetPrivateData.cpp.o \ | |
53 $(BUILD_DIR)/dgl/Window.cpp.o \ | |
54 $(BUILD_DIR)/dgl/WindowPrivateData.cpp.o | |
55 | |
56 # --------------------------------------------------------------------------------------------------------------------- | |
57 | |
58 OBJS_cairo = $(OBJS_common) \ | |
59 $(BUILD_DIR)/dgl/Cairo.cpp.cairo.o | |
60 | |
61 ifeq ($(MACOS),true) | |
62 OBJS_cairo += $(BUILD_DIR)/dgl/pugl.mm.cairo.o | |
63 else | |
64 OBJS_cairo += $(BUILD_DIR)/dgl/pugl.cpp.cairo.o | |
65 endif | |
66 | |
67 # --------------------------------------------------------------------------------------------------------------------- | |
68 | |
69 OBJS_opengl = $(OBJS_common) \ | |
70 $(BUILD_DIR)/dgl/OpenGL.cpp.opengl.o \ | |
71 $(BUILD_DIR)/dgl/NanoVG.cpp.opengl.o | |
72 | |
73 ifeq ($(MACOS),true) | |
74 OBJS_opengl += $(BUILD_DIR)/dgl/pugl.mm.opengl.o | |
75 else | |
76 OBJS_opengl += $(BUILD_DIR)/dgl/pugl.cpp.opengl.o | |
77 endif | |
78 | |
79 # --------------------------------------------------------------------------------------------------------------------- | |
80 | |
81 OBJS_opengl3 = $(OBJS_common) \ | |
82 $(BUILD_DIR)/dgl/OpenGL.cpp.opengl3.o \ | |
83 $(BUILD_DIR)/dgl/NanoVG.cpp.opengl3.o | |
84 | |
85 ifeq ($(MACOS),true) | |
86 OBJS_opengl3 += $(BUILD_DIR)/dgl/pugl.mm.opengl3.o | |
87 else | |
88 OBJS_opengl3 += $(BUILD_DIR)/dgl/pugl.cpp.opengl3.o | |
89 endif | |
90 | |
91 # --------------------------------------------------------------------------------------------------------------------- | |
92 | |
93 OBJS_stub = $(OBJS_common) | |
94 | |
95 ifeq ($(MACOS),true) | |
96 OBJS_stub += $(BUILD_DIR)/dgl/pugl.mm.o | |
97 else | |
98 OBJS_stub += $(BUILD_DIR)/dgl/pugl.cpp.o | |
99 endif | |
100 | |
101 # --------------------------------------------------------------------------------------------------------------------- | |
102 | |
103 OBJS_vulkan = $(OBJS_common) \ | |
104 $(BUILD_DIR)/dgl/Vulkan.cpp.vulkan.o | |
105 | |
106 ifeq ($(MACOS),true) | |
107 OBJS_vulkan += $(BUILD_DIR)/dgl/pugl.mm.vulkan.o | |
108 else | |
109 OBJS_vulkan += $(BUILD_DIR)/dgl/pugl.cpp.vulkan.o | |
110 endif | |
111 | |
112 # --------------------------------------------------------------------------------------------------------------------- | |
113 | |
114 ifeq ($(HAVE_CAIRO),true) | |
115 TARGETS += $(BUILD_DIR)/libdgl-cairo.a | |
116 endif | |
117 | |
118 ifeq ($(HAVE_OPENGL),true) | |
119 TARGETS += $(BUILD_DIR)/libdgl-opengl.a | |
120 # Compat name, to be removed soon | |
121 TARGETS += $(BUILD_DIR)/libdgl.a | |
122 endif | |
123 | |
124 ifeq ($(HAVE_STUB),true) | |
125 TARGETS += $(BUILD_DIR)/libdgl-stub.a | |
126 endif | |
127 | |
128 ifeq ($(HAVE_VULKAN),true) | |
129 TARGETS += $(BUILD_DIR)/libdgl-vulkan.a | |
130 endif | |
131 | |
132 # --------------------------------------------------------------------------------------------------------------------- | |
133 | |
134 all: $(TARGETS) | |
135 | |
136 cairo: $(BUILD_DIR)/libdgl-cairo.a | |
137 opengl: $(BUILD_DIR)/libdgl-opengl.a | |
138 opengl3: $(BUILD_DIR)/libdgl-opengl3.a | |
139 stub: $(BUILD_DIR)/libdgl-stub.a | |
140 vulkan: $(BUILD_DIR)/libdgl-vulkan.a | |
141 | |
142 # --------------------------------------------------------------------------------------------------------------------- | |
143 | |
144 $(BUILD_DIR)/libdgl-cairo.a: $(OBJS_cairo) | |
145 -@mkdir -p $(BUILD_DIR) | |
146 @echo "Creating libdgl-cairo.a" | |
147 $(SILENT)rm -f $@ | |
148 $(SILENT)$(AR) crs $@ $^ | |
149 | |
150 $(BUILD_DIR)/libdgl-opengl.a: $(OBJS_opengl) | |
151 -@mkdir -p $(BUILD_DIR) | |
152 @echo "Creating libdgl-opengl.a" | |
153 $(SILENT)rm -f $@ | |
154 $(SILENT)$(AR) crs $@ $^ | |
155 | |
156 $(BUILD_DIR)/libdgl-opengl3.a: $(OBJS_opengl3) | |
157 -@mkdir -p $(BUILD_DIR) | |
158 @echo "Creating libdgl-opengl3.a" | |
159 $(SILENT)rm -f $@ | |
160 $(SILENT)$(AR) crs $@ $^ | |
161 | |
162 $(BUILD_DIR)/libdgl-stub.a: $(OBJS_stub) | |
163 -@mkdir -p $(BUILD_DIR) | |
164 @echo "Creating libdgl-stub.a" | |
165 $(SILENT)rm -f $@ | |
166 $(SILENT)$(AR) crs $@ $^ | |
167 | |
168 $(BUILD_DIR)/libdgl-vulkan.a: $(OBJS_vulkan) | |
169 -@mkdir -p $(BUILD_DIR) | |
170 @echo "Creating libdgl-vulkan.a" | |
171 $(SILENT)rm -f $@ | |
172 $(SILENT)$(AR) crs $@ $^ | |
173 | |
174 # Compat name, to be removed soon | |
175 $(BUILD_DIR)/libdgl.a: $(BUILD_DIR)/libdgl-opengl.a | |
176 @echo "Symlinking libdgl.a" | |
177 $(SILENT)ln -sf $< $@ | |
178 | |
179 # --------------------------------------------------------------------------------------------------------------------- | |
180 | |
181 $(BUILD_DIR)/dgl/%.c.o: src/%.c | |
182 -@mkdir -p $(BUILD_DIR)/dgl | |
183 @echo "Compiling $<" | |
184 $(SILENT)$(CC) $< $(BUILD_C_FLAGS) -c -o $@ | |
185 | |
186 $(BUILD_DIR)/dgl/%.cpp.o: src/%.cpp | |
187 -@mkdir -p $(BUILD_DIR)/dgl | |
188 @echo "Compiling $<" | |
189 $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ | |
190 | |
191 $(BUILD_DIR)/dgl/%.mm.o: src/%.mm | |
192 -@mkdir -p $(BUILD_DIR)/dgl | |
193 @echo "Compiling $<" | |
194 $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -ObjC++ -o $@ | |
195 | |
196 # --------------------------------------------------------------------------------------------------------------------- | |
197 | |
198 $(BUILD_DIR)/dgl/pugl.cpp.o: src/pugl.cpp | |
199 -@mkdir -p $(BUILD_DIR)/dgl | |
200 @echo "Compiling $<" | |
201 $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(PUGL_EXTRA_FLAGS) -c -o $@ | |
202 | |
203 $(BUILD_DIR)/dgl/pugl.mm.o: src/pugl.mm | |
204 -@mkdir -p $(BUILD_DIR)/dgl | |
205 @echo "Compiling $<" | |
206 $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(PUGL_EXTRA_FLAGS) -c -ObjC++ -o $@ | |
207 | |
208 # --------------------------------------------------------------------------------------------------------------------- | |
209 | |
210 $(BUILD_DIR)/dgl/%.cpp.cairo.o: src/%.cpp | |
211 -@mkdir -p $(BUILD_DIR)/dgl | |
212 @echo "Compiling $< (Cairo variant)" | |
213 $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(PUGL_EXTRA_FLAGS) $(CAIRO_FLAGS) -DDGL_CAIRO -c -o $@ | |
214 | |
215 $(BUILD_DIR)/dgl/%.mm.cairo.o: src/%.mm | |
216 -@mkdir -p $(BUILD_DIR)/dgl | |
217 @echo "Compiling $< (Cairo variant)" | |
218 $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(PUGL_EXTRA_FLAGS) $(CAIRO_FLAGS) -DDGL_CAIRO -c -ObjC++ -o $@ | |
219 | |
220 # --------------------------------------------------------------------------------------------------------------------- | |
221 | |
222 $(BUILD_DIR)/dgl/%.cpp.opengl.o: src/%.cpp | |
223 -@mkdir -p $(BUILD_DIR)/dgl | |
224 @echo "Compiling $< (OpenGL variant)" | |
225 $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(PUGL_EXTRA_FLAGS) $(OPENGL_FLAGS) -DDGL_OPENGL -c -o $@ | |
226 | |
227 $(BUILD_DIR)/dgl/%.mm.opengl.o: src/%.mm | |
228 -@mkdir -p $(BUILD_DIR)/dgl | |
229 @echo "Compiling $< (OpenGL variant)" | |
230 $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(PUGL_EXTRA_FLAGS) $(OPENGL_FLAGS) -DDGL_OPENGL -c -ObjC++ -o $@ | |
231 | |
232 # --------------------------------------------------------------------------------------------------------------------- | |
233 | |
234 $(BUILD_DIR)/dgl/%.cpp.opengl3.o: src/%.cpp | |
235 -@mkdir -p $(BUILD_DIR)/dgl | |
236 @echo "Compiling $< (OpenGL3 variant)" | |
237 $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(PUGL_EXTRA_FLAGS) $(OPENGL_FLAGS) -DDGL_OPENGL -DDGL_USE_OPENGL3 -c -o $@ | |
238 | |
239 $(BUILD_DIR)/dgl/%.mm.opengl3.o: src/%.mm | |
240 -@mkdir -p $(BUILD_DIR)/dgl | |
241 @echo "Compiling $< (OpenGL3 variant)" | |
242 $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(PUGL_EXTRA_FLAGS) $(OPENGL_FLAGS) -DDGL_OPENGL -DDGL_USE_OPENGL3 -c -ObjC++ -o $@ | |
243 | |
244 # --------------------------------------------------------------------------------------------------------------------- | |
245 | |
246 $(BUILD_DIR)/dgl/%.cpp.vulkan.o: src/%.cpp | |
247 -@mkdir -p $(BUILD_DIR)/dgl | |
248 @echo "Compiling $< (Vulkan variant)" | |
249 $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(PUGL_EXTRA_FLAGS) $(VULKAN_FLAGS) -DDGL_VULKAN -c -o $@ | |
250 | |
251 $(BUILD_DIR)/dgl/%.mm.vulkan.o: src/%.mm | |
252 -@mkdir -p $(BUILD_DIR)/dgl | |
253 @echo "Compiling $< (Vulkan variant)" | |
254 $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(PUGL_EXTRA_FLAGS) $(VULKAN_FLAGS) -DDGL_VULKAN -c -ObjC++ -o $@ | |
255 | |
256 # --------------------------------------------------------------------------------------------------------------------- | |
257 | |
258 clean: | |
259 rm -rf $(BUILD_DIR)/dgl $(BUILD_DIR)/libdgl*.* | |
260 | |
261 debug: | |
262 $(MAKE) DEBUG=true | |
263 | |
264 # --------------------------------------------------------------------------------------------------------------------- | |
265 | |
266 -include $(OBJS_common:%.o=%.d) | |
267 -include $(OBJS_cairo:%.o=%.d) | |
268 -include $(OBJS_opengl:%.o=%.d) | |
269 -include $(OBJS_opengl3:%.o=%.d) | |
270 -include $(OBJS_stub:%.o=%.d) | |
271 -include $(OBJS_vulkan:%.o=%.d) | |
272 | |
273 # --------------------------------------------------------------------------------------------------------------------- |