summaryrefslogtreecommitdiff
path: root/makefile.voodoo.cygwin
blob: 4f6c1514845e546e2b96646d1793d176a240a01b (plain)
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
#
# Global setup
TOP    = .
SOURCE = $(TOP)/Source
JSSOURCE = $(TOP)/Jslib
CONF_H = $(TOP)/ConfigGeneric

DESTDIR = /

NM ?= nm

#
# Compiler flags
CFLAGS += -ffast-math -Wno-strict-aliasing

CPPFLAGS += -DDIRECTFB_PURE_VOODOO -DUSE_WEAK_NOTIFICATIONS

#ifeq ($(OS),Windows_NT)
#CPPFLAGS += -Dulong='unsigned long'
#endif

#
# Version definition
MAJOR   = 1
MINOR   = 2
TINY    = 8
VERSION = $(MAJOR).$(MINOR).$(TINY)

# Default target
default: all

#
# Compiler flags
CFLAGS += -fpic -pipe -O2 -Wall

#
# Linker flags
LDFLAGS += -L.

#
# Configuration header files
INCLUDES += -I$(CONF_H)

#
# Preprocessor flags
CPPFLAGS += \
	-DHAVE_CONFIG_H							\
	-DHAVE_STDBOOL_H						\
	-D_GNU_SOURCE							\
	-D_REENTRANT							\
	-DVERSION=\"$(VERSION)\"					\
        -DBUILDTIME="\"$(buildtime)\""

#
# Debug option
ifeq ($(DEBUG),yes)
  CPPFLAGS += -DENABLE_DEBUG=1
  CFLAGS   += -g3
else
  CPPFLAGS += -DENABLE_DEBUG=0
endif

#
# Trace option
ifeq ($(TRACE),yes)
  CFLAGS   += -finstrument-functions
  CPPFLAGS += -DENABLE_TRACE=1
else
  CPPFLAGS += -DENABLE_TRACE=0
endif

#
# Installation paths
prefix     ?= /opt/directfb
bindir     ?= $(prefix)/bin
datadir    ?= $(prefix)/share
libdir     ?= $(prefix)/lib
moddir     ?= $(libdir)/directfb
sysconfdir ?= $(prefix)/etc

CPPFLAGS += \
	-DDATADIR=\"$(datadir)\"	\
	-DMODULEDIR=\"$(moddir)\"	\
	-DSYSCONFDIR=\"$(sysconfdir)\"

buildtime = $(shell sh -c date -u +%Y-%m-%d %H:%M)

#
# libdirect object files
LIB_DIRECT_OBJECTS = \
	$(SOURCE)/DirectFB/lib/direct/clock.o				\
	$(SOURCE)/DirectFB/lib/direct/conf.o				\
	$(SOURCE)/DirectFB/lib/direct/debug.o				\
	$(SOURCE)/DirectFB/lib/direct/direct.o				\
	$(SOURCE)/DirectFB/lib/direct/fastlz.o				\
	$(SOURCE)/DirectFB/lib/direct/flz.o				\
	$(SOURCE)/DirectFB/lib/direct/hash.o				\
	$(SOURCE)/DirectFB/lib/direct/interface.o			\
	$(SOURCE)/DirectFB/lib/direct/log.o				\
	$(SOURCE)/DirectFB/lib/direct/list.o				\
	$(SOURCE)/DirectFB/lib/direct/mem.o				\
	$(SOURCE)/DirectFB/lib/direct/memcpy.o				\
	$(SOURCE)/DirectFB/lib/direct/messages.o			\
	$(SOURCE)/DirectFB/lib/direct/modules.o				\
	$(SOURCE)/DirectFB/lib/direct/signals.o				\
	$(SOURCE)/DirectFB/lib/direct/stream.o				\
	$(SOURCE)/DirectFB/lib/direct/system.o				\
	$(SOURCE)/DirectFB/lib/direct/thread.o				\
	$(SOURCE)/DirectFB/lib/direct/trace.o				\
	$(SOURCE)/DirectFB/lib/direct/tree.o				\
	$(SOURCE)/DirectFB/lib/direct/utf8.o				\
	$(SOURCE)/DirectFB/lib/direct/util.o

#
# libfusion object files
LIB_FUSION_OBJECTS = \
	$(SOURCE)/DirectFB/lib/fusion/conf.o				\
	$(SOURCE)/DirectFB/lib/fusion/shmalloc.o			\
	$(SOURCE)/DirectFB/lib/fusion/vector.o				\
	$(SOURCE)/DirectFB/lib/fusion/shm/fake.o

#
# libvoodoo object files
LIB_VOODOO_OBJECTS = \
	$(SOURCE)/DirectFB/lib/voodoo/client.o				\
	$(SOURCE)/DirectFB/lib/voodoo/conf.o				\
	$(SOURCE)/DirectFB/lib/voodoo/connection.o			\
	$(SOURCE)/DirectFB/lib/voodoo/connection_packet.o		\
	$(SOURCE)/DirectFB/lib/voodoo/connection_raw.o			\
	$(SOURCE)/DirectFB/lib/voodoo/connection_link.o			\
	$(SOURCE)/DirectFB/lib/voodoo/instance.o			\
	$(SOURCE)/DirectFB/lib/voodoo/interface.o			\
	$(SOURCE)/DirectFB/lib/voodoo/ivoodooplayer.o			\
	$(SOURCE)/DirectFB/lib/voodoo/ivoodooplayer_dispatcher.o	\
	$(SOURCE)/DirectFB/lib/voodoo/ivoodooplayer_requestor.o		\
	$(SOURCE)/DirectFB/lib/voodoo/manager.o			\
	$(SOURCE)/DirectFB/lib/voodoo/manager_c.o			\
	$(SOURCE)/DirectFB/lib/voodoo/mutex.o				\
	$(SOURCE)/DirectFB/lib/voodoo/play.o				\
	$(SOURCE)/DirectFB/lib/voodoo/play_server.o			\
	$(SOURCE)/DirectFB/lib/voodoo/server.o				\
	$(SOURCE)/DirectFB/lib/voodoo/dispatcher.o          \
	$(SOURCE)/DirectFB/lib/voodoo/unix/link_unix.o
#	$(SOURCE)/DirectFB/lib/voodoo/unix/link_unix_1408limit.o

#
# DirectFB object files
DIRECTFB_OBJECTS = \
	$(SOURCE)/DirectFB/src/directfb.o				\
	$(SOURCE)/DirectFB/src/media/idirectfbdatabuffer.o		\
	$(SOURCE)/DirectFB/src/media/idirectfbdatabuffer_file.o		\
	$(SOURCE)/DirectFB/src/media/idirectfbdatabuffer_memory.o	\
	$(SOURCE)/DirectFB/src/media/idirectfbdatabuffer_streamed.o	\
	$(SOURCE)/DirectFB/src/input/idirectfbinputbuffer.o		\
	$(SOURCE)/DirectFB/src/gfx/convert.o				\
	$(SOURCE)/DirectFB/src/misc/conf.o				\
	$(SOURCE)/DirectFB/src/misc/util.o

#
# DirectFB requestor object files
DIRECTFB_OBJECTS += \
	$(SOURCE)/DirectFB/proxy/requestor/idirectfb_requestor.o \
	$(SOURCE)/DirectFB/proxy/requestor/idirectfbdisplaylayer_requestor.o \
	$(SOURCE)/DirectFB/proxy/requestor/idirectfbfont_requestor.o \
	$(SOURCE)/DirectFB/proxy/requestor/idirectfbimageprovider_requestor.o \
	$(SOURCE)/DirectFB/proxy/requestor/idirectfbinputdevice_requestor.o \
	$(SOURCE)/DirectFB/proxy/requestor/idirectfbpalette_requestor.o \
	$(SOURCE)/DirectFB/proxy/requestor/idirectfbscreen_requestor.o \
	$(SOURCE)/DirectFB/proxy/requestor/idirectfbsurface_requestor.o \
	$(SOURCE)/DirectFB/proxy/requestor/idirectfbwindow_requestor.o

#
# DirectFB dispatcher object files
DIRECTFB_OBJECTS += \
	$(SOURCE)/DirectFB/proxy/dispatcher/idirectfbdatabuffer_dispatcher.o	\
	$(SOURCE)/DirectFB/proxy/dispatcher/idirectfbeventbuffer_dispatcher.o

#
# DirectFB Windows extension
DIRECTFB_OBJECTS += \
	$(SOURCE)/DirectFB/interfaces/IDirectFBWindows/idirectfbwindows_requestor.o

#
# DirectFB header files
DIRECTFB_INCLUDES += \
	-I$(SOURCE)/DirectFB/include					\
	-I$(SOURCE)/DirectFB/lib					\
	-I$(SOURCE)/DirectFB/src					\
	-I$(SOURCE)/DirectFB/proxy/requestor				\
	-I$(SOURCE)/DirectFB/proxy/dispatcher				\
	-I$(SOURCE)/DirectFB/systems


#
# DiVine object files
DIVINE_OBJECTS = \
	$(SOURCE)/DiVine/lib/divine.o					\
	$(SOURCE)/DiVine/proxy/requestor/idivine_requestor.o

#
# DiVine header files and defines
DIVINE_INCLUDES += \
	-I$(SOURCE)/DiVine/include					\
	-I$(SOURCE)/DiVine/lib						\
	-I$(SOURCE)/DiVine/proxy/dispatcher

CPPFLAGS += -DDIVINE_MAJOR_VERSION=0 -DDIVINE_MINOR_VERSION=0

#
# FusionDale object files
FUSIONDALE_OBJECTS = \
	$(SOURCE)/FusionDale/src/fusiondale.o				\
	$(SOURCE)/FusionDale/src/misc/dale_config.o			\
	$(SOURCE)/FusionDale/src/coma/policy.o        			\
	$(SOURCE)/FusionDale/proxy/requestor/ifusiondale_requestor.o	\
	$(SOURCE)/FusionDale/proxy/requestor/icoma_requestor.o		\
	$(SOURCE)/FusionDale/proxy/requestor/icomacomponent_requestor.o

#
# ++DFB object files
PPDFB_OBJECTS = \
	$(SOURCE)/++DFB/++dfb/idirectfb.o				\
	$(SOURCE)/++DFB/++dfb/idirectfbdatabuffer.o			\
	$(SOURCE)/++DFB/++dfb/idirectfbdisplaylayer.o			\
	$(SOURCE)/++DFB/++dfb/idirectfbeventbuffer.o			\
	$(SOURCE)/++DFB/++dfb/idirectfbfont.o				\
	$(SOURCE)/++DFB/++dfb/idirectfbimageprovider.o			\
	$(SOURCE)/++DFB/++dfb/idirectfbinputdevice.o			\
	$(SOURCE)/++DFB/++dfb/idirectfbpalette.o			\
	$(SOURCE)/++DFB/++dfb/idirectfbscreen.o				\
	$(SOURCE)/++DFB/++dfb/idirectfbsurface.o			\
	$(SOURCE)/++DFB/++dfb/idirectfbvideoprovider.o			\
	$(SOURCE)/++DFB/++dfb/idirectfbwindow.o				\
	$(SOURCE)/++DFB/++dfb/ppdfb.o

#
# ++DFB header files and defines
PPDFB_INCLUDES += \
	-I$(SOURCE)/++DFB/include

#
# FusionDale header files
FUSIONDALE_INCLUDES += \
	-I$(SOURCE)/FusionDale/include					\
	-I$(SOURCE)/FusionDale/src					\
	-I$(SOURCE)/FusionDale/proxy/dispatcher
	
#
# Build list of all objects
OBJECTS += \
	$(LIB_DIRECT_OBJECTS)						\
	$(LIB_FUSION_OBJECTS)						\
	$(LIB_VOODOO_OBJECTS)						\
	$(DIRECTFB_OBJECTS)						\
	$(DIVINE_OBJECTS)						\
	$(FUSIONDALE_OBJECTS)						\
	$(PPDFB_OBJECTS)

#
# libjslib object files
JSOBJECTS = \
	$(JSSOURCE)/jslibrc/jslibrc_client.o		\

	
#
# DiVine header files and defines
JSLIB_INCLUDES += \
	-I$(JSSOURCE)/jslibrc
	
	
#
# Build complete include path
INCLUDES += \
	$(DIRECTFB_INCLUDES)						\
	$(DIVINE_INCLUDES)						\
	$(FUSIONDALE_INCLUDES)						\
	$(PPDFB_INCLUDES)						\
	$(JSLIB_INCLUDES)						\
	



#
# All libraries
LIBS += \
	-lm								\
	-lpthread							\
	-ldl


#
# All tools and tests
TOOLS += \
	$(SOURCE)/DirectFB/tools/dfbinfo				\
	$(SOURCE)/DirectFB/tools/dfbproxy				\
	$(SOURCE)/DirectFB/tools/voodooplay				\
	$(SOURCE)/DirectFB/tools/voodooplay_client			\
	$(SOURCE)/DirectFB/tools/voodooplay_server			\
	$(SOURCE)/DirectFB/tests/dfbtest_windows_watcher \
	$(SOURCE)/DiVine/examples/spooky				\

#
# All tools and tests
JSTOOLS += \
	$(JSSOURCE)/tools/remco				\
	$(JSSOURCE)/tools/remco2k11				\
	
#
# List of generated header files
GEN_HEADERS = \
	$(SOURCE)/DirectFB/include/directfb_keynames.h			\
	$(SOURCE)/DirectFB/include/directfb_strings.h			\
	$(SOURCE)/DirectFB/include/directfb_version.h


#LIBRARY = libdirectfb.so
LIBRARY = libdirectfb.o

JSLIBRARY = libjslibclient.o

HEADERS = \
	$(CONF_H)/direct/build.h				\
	$(CONF_H)/fusion/build.h				\
	$(SOURCE)/DirectFB/lib/direct/*.h			\
	$(SOURCE)/DirectFB/lib/fusion/*.h			\
	$(SOURCE)/DirectFB/lib/voodoo/*.h			\
	$(SOURCE)/DirectFB/include/dfb_types.h			\
	$(SOURCE)/DirectFB/include/directfb.h			\
	$(SOURCE)/DirectFB/include/directfb_keyboard.h			\
	$(SOURCE)/DirectFB/include/directfb_keynames.h			\
	$(SOURCE)/DirectFB/include/directfb_strings.h			\
	$(SOURCE)/DirectFB/include/directfb_util.h			\
	$(SOURCE)/DirectFB/include/directfb_version.h			\
	$(SOURCE)/DirectFB/include/directfb_windows.h			\
	$(SOURCE)/DirectFB/src/gfx/convert.h				\
	$(SOURCE)/DiVine/include/divine.h				\
	$(SOURCE)/++DFB/include/++dfb.h					\
	$(SOURCE)/++DFB/include/idirectfbdatabuffer.h			\
	$(SOURCE)/++DFB/include/idirectfbdisplaylayer.h			\
	$(SOURCE)/++DFB/include/idirectfbeventbuffer.h			\
	$(SOURCE)/++DFB/include/idirectfbfont.h				\
	$(SOURCE)/++DFB/include/idirectfb.h				\
	$(SOURCE)/++DFB/include/idirectfbimageprovider.h		\
	$(SOURCE)/++DFB/include/idirectfbinputdevice.h			\
	$(SOURCE)/++DFB/include/idirectfbpalette.h			\
	$(SOURCE)/++DFB/include/idirectfbscreen.h			\
	$(SOURCE)/++DFB/include/idirectfbsurface.h			\
	$(SOURCE)/++DFB/include/idirectfbvideoprovider.h		\
	$(SOURCE)/++DFB/include/idirectfbwindow.h \
	$(SOURCE)/FusionDale/include/fusiondale.h				\
	$(JSSOURCE)/jslibrc/jslibrc_types.h				\
	$(JSSOURCE)/jslibrc/jslibrc_client.h				\

	
PACKAGE = DirectFB_Voodoo.tar.gz

#
# Rules
all: $(LIBRARY) $(JSLIBRARY) $(JSTOOLS) $(TOOLS) $(TEST) $(TOOLS:%=%.nm)

package: $(PACKAGE)


libdirectfb.o: $(OBJECTS)
	$(LD) $(LDFLAGS) -r -o $@ $(OBJECTS)

libdirectfb.so: $(OBJECTS)
	$(CXX) -shared -Wl,-soname,libdirectfb.so $(LDFLAGS) $(LIBS) -o $@ $(OBJECTS)

libdirectfb.so.nm: libdirectfb.so
	$(NM) -n libdirectfb.so > libdirectfb.so.nm

libjslibclient.o: $(JSOBJECTS)
	$(LD) $(LDFLAGS) -r -o $@ $(JSOBJECTS)

headers:
	@echo $(HEADERS)

sources:
	@echo $(OBJECTS:%.o=%.c)

objects:
	@echo $(OBJECTS)

%.o: %.c $(GEN_HEADERS)
	$(CC) $(CFLAGS) -c $(CPPFLAGS) $(INCLUDES) -o $@ $<

%.o: %.cpp $(GEN_HEADERS)
	$(CXX) $(CFLAGS) -c $(CPPFLAGS) $(INCLUDES) -o $@ $<

$(SOURCE)/DirectFB/tests/%: $(SOURCE)/DirectFB/tests/%.o libdirectfb.o
	$(CXX) $(LDFLAGS) -o $@ $+ $(LIBS)

$(SOURCE)/DirectFB/tools/%: $(SOURCE)/DirectFB/tools/%.o libdirectfb.o
	$(CXX) $(LDFLAGS) -o $@ $+ $(LIBS)

$(SOURCE)/DiVine/examples/%: $(SOURCE)/DiVine/examples/%.o libdirectfb.o
	$(CXX) $(LDFLAGS) -o $@ $+ $(LIBS)

$(JSSOURCE)/tools/%: $(JSSOURCE)/tools/%.o libdirectfb.o libjslibclient.o
	$(CXX) $(LDFLAGS) -o $@ $+ $(LIBS)
	
%.nm: %
	$(NM) -n $< > $@


.PHONY: clean install

clean::
	rm -f libdirectfb.*o* libjslibclient.*o* $(TOOLS) $(JSTOOLS) $(TEST)
	find -name "*.o" | xargs rm -f
	find -name "*.so" | xargs rm -f
	find -name "*.nm" | xargs rm -f

install:: all
	@(if test -z "$(DESTDIR)"; then echo "**** DESTDIR not set! ****"; exit 1; fi)
	install -d $(DESTDIR)$(bindir)
	install -d $(DESTDIR)$(libdir)
	install -d $(DESTDIR)$(moddir)
	install -d $(DESTDIR)$(moddir)/inputdrivers
	install -d $(DESTDIR)$(moddir)/interfaces
	install -d $(DESTDIR)$(moddir)/gfxdrivers
	install -d $(DESTDIR)$(moddir)/systems
	install -d $(DESTDIR)$(moddir)/wm
	install -c -m 755 $(TEST) $(TOOLS) $(TOOLS:%=%.nm) $(DESTDIR)$(bindir)/
	install -c -m 755 libdirectfb.so $(DESTDIR)$(libdir)/
	install -c -m 644 libdirectfb.so.nm $(DESTDIR)$(libdir)/


$(PACKAGE): $(LIBRARY) $(JSLIBRARY) $(HEADERS)
	./build-package.sh $@ $+


DFBINC  = $(SOURCE)/DirectFB/include
MKNAMES = $(SOURCE)/DirectFB/include/mknames.sh