Fix Makefiles to copy lib to $(TOP)/lib if missing
[mesa.git] / src / mesa / drivers / dri / i830 / Makefile.X11
1 # $Id: Makefile.X11,v 1.3 2003/10/20 02:17:33 jonsmirl Exp $
2
3 # Mesa 3-D graphics library
4 # Version: 5.0
5 # Copyright (C) 1995-2002 Brian Paul
6
7 TOP = ../../../../..
8
9 default: linux-solo
10
11 SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver
12 MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
13
14 DEFINES += \
15 -D_HAVE_SWRAST=1 \
16 -D_HAVE_SWTNL=1 \
17 -D_HAVE_SANITY=1 \
18 -D_HAVE_CODEGEN=1 \
19 -D_HAVE_LIGHTING=1 \
20 -D_HAVE_TEXGEN=1 \
21 -D_HAVE_USERCLIP=1 \
22 -DGLX_DIRECT_RENDERING
23
24 # Not yet
25 # MINIGLX_SOURCES = server/i830_dri.c
26
27 DRIVER_SOURCES = \
28 i830_context.c \
29 i830_debug.c \
30 i830_ioctl.c \
31 i830_render.c \
32 i830_screen.c \
33 i830_span.c \
34 i830_state.c \
35 i830_tex.c \
36 i830_texmem.c \
37 i830_texstate.c \
38 i830_tris.c \
39 i830_vb.c \
40 ../common/mm.c \
41 ../common/utils.c \
42 ../common/texmem.c \
43 ../common/vblank.c
44
45 INCLUDES = $(MINIGLX_INCLUDES) \
46 $(SHARED_INCLUDES)
47
48
49 C_SOURCES = $(DRIVER_SOURCES) \
50 $(MINIGLX_SOURCES)
51
52 MESA_MODULES = $(TOP)/src/mesa/mesa.a
53
54
55 ifeq ($(WINDOW_SYSTEM),dri)
56 WINOBJ=$(MESABUILDDIR)/dri/dri.a
57 WINLIB=
58 else
59 WINOBJ=
60 WINLIB=-L$(MESA)/src/glx/mini
61 endif
62
63 ASM_SOURCES =
64 OBJECTS = $(C_SOURCES:.c=.o) \
65 $(ASM_SOURCES:.S=.o)
66
67 ### Include directories
68
69 INCLUDE_DIRS = \
70 -I$(TOP)/include \
71 -I$(TOP)/src/mesa \
72 -I$(TOP)/src/mesa/main \
73 -I$(TOP)/src/mesa/glapi \
74 -I$(TOP)/src/mesa/math \
75 -I$(TOP)/src/mesa/transform \
76 -I$(TOP)/src/mesa/swrast \
77 -I$(TOP)/src/mesa/swrast_setup
78
79
80 ##### RULES #####
81
82 .c.o:
83 $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
84
85 .S.o:
86 $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
87
88
89 ##### TARGETS #####
90
91 targets: depend i830_dri.so
92
93 i830_dri.so: $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.X11
94 rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS)
95 rm -f $(TOP)/lib/i830_dri.so && \
96 install i830_dri.so $(TOP)/lib/i830_dri.so
97
98 $(TOP)/lib/i830_dri.so: i830_dri.so
99 rm -f $(TOP)/lib/i830_dri.so && \
100 install i830_dri.so $(TOP)/lib/i830_dri.so
101
102 # Run 'make -f Makefile.X11 dep' to update the dependencies if you change
103 # what's included by any source file.
104 depend: $(C_SOURCES) $(ASM_SOURCES)
105 makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) \
106 $(C_SOURCES) $(ASM_SOURCES)
107
108
109 # Emacs tags
110 tags:
111 etags `find . -name \*.[ch]` `find ../include`
112
113
114 # Remove .o and backup files
115 clean:
116 -rm -f *.o */*.o *~ *.o *~ *.so server/*.o
117
118
119 include $(TOP)/Make-config
120
121 include depend