summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/egl/Makefile
blob: b696f2fae93cce7af0233f5418f352abddd521c6 (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
TOP = ../../../..
include $(TOP)/configs/current

common_INCLUDES = \
	-I. \
	-I$(TOP)/src/gallium/include \
	-I$(TOP)/src/gallium/auxiliary \
	-I$(TOP)/src/egl/main \
	-I$(TOP)/include

common_SOURCES = $(wildcard common/*.c)
common_OBJECTS = $(common_SOURCES:.c=.o)


x11_INCLUDES = \
	-I$(TOP)/src/gallium/drivers \
	-I$(TOP)/src/glx/x11 \
	-I$(TOP)/src/egl/drivers/xdri \
	-I$(TOP)/src/mesa \
	$(shell pkg-config --cflags-only-I libdrm)

x11_SOURCES = $(wildcard x11/*.c) \
	      $(TOP)/src/glx/x11/dri2.c \
	      $(TOP)/src/egl/drivers/xdri/glxinit.c
x11_OBJECTS = $(x11_SOURCES:.c=.o)


kms_INCLUDES = $(shell pkg-config --cflags-only-I libdrm)
kms_SOURCES = $(wildcard kms/*.c)
kms_OBJECTS = $(kms_SOURCES:.c=.o)


ALL_INCLUDES = $(common_INCLUDES) $(x11_INCLUDES) $(kms_INCLUDES)
ALL_SOURCES = $(common_SOURCES) $(x11_SOURCES) $(kms_SOURCES)
ALL_OBJECTS = $(common_OBJECTS) $(x11_OBJECTS) $(kms_OBJECTS)

##### TARGETS #####

EGL_DISPLAYS_MODS = $(foreach dpy, $(EGL_DISPLAYS), libegl$(dpy).a)

default: depend $(EGL_DISPLAYS_MODS)


libeglx11.a: $(x11_OBJECTS) $(common_OBJECTS) Makefile
	$(MKLIB) -o eglx11 -static $(x11_OBJECTS) $(common_OBJECTS)

libeglkms.a: $(kms_OBJECTS) $(common_OBJECTS) Makefile
	$(MKLIB) -o eglkms -static $(kms_OBJECTS) $(common_OBJECTS)

depend: 
	rm -f depend
	touch depend
	$(MKDEP) $(MKDEP_OPTIONS) $(ALL_INCLUDES) $(ALL_SOURCES) 2> /dev/null

clean:
	rm -f $(ALL_OBJECTS)
	rm -f $(EGL_DISPLAYS_MODS)
	rm -f depend depend.bak

# Dummy target
install:
	@echo -n ""

##### RULES #####

$(common_OBJECTS): %.o: %.c
	$(CC) -c $(common_INCLUDES) $(DEFINES) $(CFLAGS) $< -o $@

$(x11_OBJECTS): %.o: %.c
	$(CC) -c $(common_INCLUDES) $(x11_INCLUDES) $(DEFINES) $(CFLAGS) $< -o $@

$(kms_OBJECTS): %.o: %.c
	$(CC) -c $(common_INCLUDES) $(kms_INCLUDES) $(DEFINES) $(CFLAGS) $< -o $@

sinclude depend