summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/directfb/Makefile
blob: 945eb8b3d9bad8ae02ef592f9968e531da976379 (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
# src/mesa/drivers/directfb/Makefile

TOP = ../../../..

include $(TOP)/configs/current


INCLUDE_DIRS = \
	-I$(TOP)/include \
	-I$(TOP)/src/mesa \
	-I$(TOP)/src/mesa/main \
	-I$(TOP)/src/mesa/glapi \
	-I$(TOP)/src/mesa/math \
	-I$(TOP)/src/mesa/tnl \
	-I$(TOP)/src/mesa/shader \
	-I$(TOP)/src/mesa/swrast \
	-I$(TOP)/src/mesa/swrast_setup

DFB_CFLAGS    = $(shell pkg-config --cflags directfb)
DFB_MODULEDIR = $(shell pkg-config --variable=moduledir directfb-internal)

DIRECTFBGL_MESA_SOURCES = ../common/driverfuncs.c idirectfbgl_mesa.c

DIRECTFBGL_MESA_OBJECTS = $(DIRECTFBGL_MESA_SOURCES:.c=.o)

DIRECTFBGL_MESA = libidirectfbgl_mesa.so

LIBS = $(TOP)/src/mesa/libmesa.a $(TOP)/src/mesa/libglapi.a


.c.o:
	$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DFB_CFLAGS) $< -o $@


default: directfb-libgl directfbgl_mesa


# XXX this used to be in src/mesa/Makefile and is probably broken now
directfb-libgl: $(CORE_OBJECTS)
	@ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
		-major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
		-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(CORE_OBJECTS) \
		$(GL_LIB_DEPS)



# Mesa DirectFBGL module
directfbgl_mesa: $(DIRECTFBGL_MESA_OBJECTS)
	$(CC) -shared $(CFLAGS) $(DIRECTFBGL_MESA_OBJECTS) -o $(DIRECTFBGL_MESA) \
	-Wl,-soname -Wl,$(DIRECTFBGL_MESA) -L$(TOP)/$(LIB_DIR) -lGL -lm


install:
	@if test -d $(DFB_MODULEDIR); then \
		echo "Installing DirectFBGL module."; \
	else \
		echo "*** Failed to determine DirectFB module's directory."; \
		echo "*** Installation aborted."; \
		exit 1; \
	fi;
	test -d $(DFB_MODULEDIR)/interfaces/IDirectFBGL/ || mkdir $(DFB_MODULEDIR)/interfaces/IDirectFBGL/
	install -m 755 $(DIRECTFBGL_MESA) $(DFB_MODULEDIR)/interfaces/IDirectFBGL/


clean:
	-rm -f *.o *.so