mga driver, brought over by Jon Smirl
[mesa.git] / src / mesa / drivers / dri / mga / Makefile.X11
1 # $Id: Makefile.X11,v 1.1 2003/08/06 18:01:13 keithw Exp $
2
3 # Mesa 3-D graphics library
4 # Version: 5.0
5 # Copyright (C) 1995-2002 Brian Paul
6
7 TOP = ../../../../..
8
9 SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver
10 MINIGLX_INCLUDES = -I$(TOP)/src/miniglx
11
12 DEFINES += \
13 -D_HAVE_SWRAST=1 \
14 -D_HAVE_SWTNL=1 \
15 -D_HAVE_SANITY=1 \
16 -D_HAVE_CODEGEN=1 \
17 -D_HAVE_LIGHTING=1 \
18 -D_HAVE_TEXGEN=1 \
19 -D_HAVE_USERCLIP=1
20
21 MINIGLX_SOURCES = server/mga_dri.c
22
23 DRIVER_SOURCES = mgabuffers.c \
24 mgadd.c \
25 mgaioctl.c \
26 mgarender.c \
27 mgastate.c \
28 mgatris.c \
29 ../common/mm.c
30
31 FULL_DRIVER_SOURCES = \
32 mgapixel.c \
33 mgaspan.c \
34 mgatex.c \
35 mgatexcnv.c \
36 mgatexmem.c \
37 mgavb.c \
38 mga_xmesa.c
39
40
41 INCLUDES = $(MINIGLX_INCLUDES) \
42 $(SHARED_INCLUDES)
43
44
45 C_SOURCES = $(MINIGLX_SOURCES) \
46 $(FULL_DRIVER_SOURCES) \
47 $(DRIVER_SOURCES)
48
49 MESA_MODULES = $(TOP)/src/mesa/mesa.a
50
51
52 ifeq ($(WINDOW_SYSTEM),dri)
53 WINOBJ=$(MESABUILDDIR)/dri/dri.a
54 WINLIB=
55 else
56 WINOBJ=
57 WINLIB=-L$(MESA)/src/miniglx
58 endif
59
60 ASM_SOURCES =
61 OBJECTS = $(C_SOURCES:.c=.o) \
62 $(ASM_SOURCES:.S=.o)
63
64
65
66 ### Include directories
67
68 INCLUDE_DIRS = \
69 -I$(TOP)/include \
70 -I$(TOP)/src/mesa \
71 -I$(TOP)/src/mesa/main \
72 -I$(TOP)/src/mesa/glapi \
73 -I$(TOP)/src/mesa/math \
74 -I$(TOP)/src/mesa/transform \
75 -I$(TOP)/src/mesa/swrast \
76 -I$(TOP)/src/mesa/swrast_setup
77
78
79 ##### RULES #####
80
81 .c.o:
82 $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
83
84 .S.o:
85 $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
86
87
88 ##### TARGETS #####
89
90 targets: mga_dri.so
91
92 mga_dri.so: $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.X11
93 rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc -lm
94 rm -f $(TOP)/lib/mga_dri.so && \
95 install mga_dri.so $(TOP)/lib/mga_dri.so
96
97 # Run 'make -f Makefile.X11 dep' to update the dependencies if you change
98 # what's included by any source file.
99 dep: $(C_SOURCES) $(ASM_SOURCES)
100 makedepend -fdepend -Y $(SHARED_INCLUDES) \
101 $(C_SOURCES) $(ASM_SOURCES)
102
103
104 # Emacs tags
105 tags:
106 etags `find . -name \*.[ch]` `find ../include`
107
108
109 # Remove .o and backup files
110 clean:
111 -rm -f *.o *~ *.o *~ *.so
112
113
114 include $(TOP)/Make-config
115
116 include depend