summaryrefslogtreecommitdiff
path: root/src/glx/mini/Makefile.solo
blob: 94e54f46a54b339e364eb3d3677ace9fc2ad20b1 (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
# Build a subset DRI-based libGL.so library.
# Indirect rendering not supported, etc.

TOP = ../../..

default: linux-solo

C_SOURCES = dispatch.c \
	  dri_util.c \
	  ../../mesa/glapi/glapi.c \
	  ../../mesa/glapi/glthread.c \
	  miniglx.c \
	  miniglx_events.c \
	  xf86drm.c 

OBJECTS = $(C_SOURCES:.c=.o)

INCLUDES = -I. $(INCLUDE_DIRS)
LIBS = -ldl 

### Include directories

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/transform \
	-I$(TOP)/src/mesa/swrast \
	-I$(TOP)/src/mesa/swrast_setup


##### RULES #####

.c.o:
	$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@

.S.o:
	$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES)  $< -o $@


##### TARGETS #####

targets: depend libGL.so.1.2

libGL.so.1.2:  $(OBJECTS) Makefile.solo
	rm -f $@ && gcc -shared -Wl,-soname,libGL.so -Wl,-Bsymbolic $(OBJECTS) $(LIBS) -o $@ 
	rm -f $(TOP)/lib/libGL.so* 
	rm -f $(TOP)/lib/miniglx.conf
	install -D libGL.so.1.2 $(TOP)/lib/libGL.so.1.2
	ln -s libGL.so.1.2 $(TOP)/lib/libGL.so.1
	ln -s libGL.so.1 $(TOP)/lib/libGL.so
	install example.miniglx.conf $(TOP)/lib/miniglx.conf

drmtest: xf86drm.o drmtest.o
	rm -f drmtest && $(CC) -o drmtest xf86drm.o drmtest.o

# Run 'make -f Makefile.solo dep' to update the dependencies if you change
# what's included by any source file.
depend: $(C_SOURCES) $(ASM_SOURCES)
	makedepend -fdepend -Y $(INCLUDES) \
		$(C_SOURCES) $(ASM_SOURCES)


# Emacs tags
tags:
	etags `find . -name \*.[ch]` `find ../include`


# Remove .o and backup files
clean:
	-rm -f drmtest $(TOP)/lib/libGL.so*
	-rm -f libGL.so*
	-rm -f *.o *~


include $(TOP)/Make-config

include depend