darwin: Use clientattrib
[mesa.git] / src / glx / apple / Makefile
1 INSTALL_DIR = /usr/X11
2 X11_DIR = $(INSTALL_DIR)
3
4 CC=gcc
5 GL_CFLAGS=-Wall -ggdb3 -Os -DPTHREADS -D_REENTRANT -DGLX_DIRECT_RENDERING -DGLX_USE_APPLEGL -DGLX_ALIAS_UNSUPPORTED $(RC_CFLAGS) $(CFLAGS)
6 GL_LDFLAGS=-L$(INSTALL_DIR)/lib -L$(X11_DIR)/lib $(LDFLAGS) -Wl,-single_module
7
8 TCLSH=tclsh8.5
9
10 MKDIR=mkdir
11 INSTALL=install
12 LN=ln
13 RM=rm
14
15 INCLUDE=-I. -Iinclude -Iinclude/internal -I.. -I../../../include -I../../../src/mesa -I../../../src/mesa/glapi -I$(INSTALL_DIR)/include -I$(X11_DIR)/include
16 COMPILE=$(CC) $(INCLUDE) $(GL_CFLAGS) -c
17
18 #The directory with the final binaries.
19 BUILD_DIR=builds
20
21 all: $(BUILD_DIR)/libGL.1.2.dylib
22
23 OBJECTS=clientattrib.o glxext.o glxcmds.o glx_pbuffer.o glx_query.o glxcurrent.o glxextensions.o \
24 appledri.o apple_glx_context.o apple_glx.o pixel.o \
25 compsize.o apple_visual.o apple_cgl.o glxreply.o glcontextmodes.o \
26 apple_xgl_api.o apple_glx_drawable.o xfont.o apple_glx_pbuffer.o \
27 apple_glx_pixmap.o apple_xgl_api_read.o glx_empty.o glx_error.o \
28 apple_xgl_api_viewport.o apple_glx_surface.o apple_xgl_api_stereo.o
29
30 $(BUILD_DIR)/libGL.1.2.dylib: $(OBJECTS)
31 -if ! test -d $(BUILD_DIR); then $(MKDIR) $(BUILD_DIR); fi
32 $(CC) $(GL_CFLAGS) -o $@ -dynamiclib -install_name $(INSTALL_DIR)/lib/libGL.1.dylib -compatibility_version 1.2 -current_version 1.2 -lXplugin -framework ApplicationServices -framework CoreFoundation $(GL_LDFLAGS) -lXext -lX11 -Wl,-exported_symbols_list,exports.list $(OBJECTS)
33
34 .c.o:
35 $(COMPILE) $<
36
37 apple_glx_drawable.o: apple_glx_drawable.h apple_glx_drawable.c include/GL/gl.h
38 apple_xgl_api.o: apple_xgl_api.h apple_xgl_api.c apple_xgl_api_stereo.c include/GL/gl.h
39 apple_xgl_api_read.o: apple_xgl_api_read.h apple_xgl_api_read.c apple_xgl_api.h include/GL/gl.h
40 apple_xgl_api_viewport.o: apple_xgl_api_viewport.h apple_xgl_api_viewport.c apple_xgl_api.h include/GL/gl.h
41 apple_xgl_api_stereo.o: apple_xgl_api_stereo.h apple_xgl_api_stereo.c apple_xgl_api.h include/GL/gl.h
42 glcontextmodes.o: glcontextmodes.c include/GL/gl.h
43 glxext.o: glxext.c include/GL/gl.h
44 glxreply.o: glxreply.c include/GL/gl.h
45 glxcmds.o: glxcmds.c apple_glx_context.h include/GL/gl.h
46 glx_pbuffer.o: glx_pbuffer.c include/GL/gl.h
47 glx_error.o: glx_error.c include/GL/gl.h
48 glx_query.o: glx_query.c include/GL/gl.h
49 glxcurrent.o: glxcurrent.c include/GL/gl.h
50 glxextensions.o: glxextensions.c include/GL/gl.h
51 glxhash.o: glxhash.h glxhash.c include/GL/gl.h
52 appledri.o: appledri.h appledristr.h appledri.c include/GL/gl.h
53 apple_glx_context.o: apple_glx_context.c apple_glx_context.h apple_glx_context.h include/GL/gl.h
54 apple_glx.o: apple_glx.h apple_glx.c apple_xgl_api.h include/GL/gl.h
55 apple_visual.o: apple_visual.h apple_visual.c include/GL/gl.h
56 apple_cgl.o: apple_cgl.h apple_cgl.c include/GL/gl.h
57 apple_glx_pbuffer.o: apple_glx_drawable.h apple_glx_pbuffer.c include/GL/gl.h
58 apple_glx_pixmap.o: apple_glx_drawable.h apple_glx_pixmap.c appledri.h include/GL/gl.h
59 apple_glx_surface.o: apple_glx_drawable.h apple_glx_surface.c appledri.h include/GL/gl.h
60 xfont.o: xfont.c include/GL/gl.h
61 compsize.o: compsize.c include/GL/gl.h
62 renderpix.o: renderpix.c include/GL/gl.h
63 singlepix.o: singlepix.c include/GL/gl.h
64 pixel.o: pixel.c include/GL/gl.h
65 glx_empty.o: glx_empty.c include/GL/gl.h
66
67 apple_xgl_api.c: apple_xgl_api.h
68 apple_xgl_api.h: gen_api_header.tcl gen_api_library.tcl gen_code.tcl gen_defs.tcl gen_exports.tcl gen_funcs.tcl gen_types.tcl
69 $(TCLSH) gen_code.tcl
70
71 include/GL/gl.h: include/GL/gl.h.template gen_gl_h.sh
72 ./gen_gl_h.sh include/GL/gl.h.template $@
73
74 install_headers: include/GL/gl.h
75 $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
76 $(INSTALL) -m 644 include/GL/gl.h include/GL/glext.h include/GL/glx.h include/GL/glxext.h $(DESTDIR)$(INSTALL_DIR)/include/GL
77
78 install_libraries: $(BUILD_DIR)/libGL.1.2.dylib
79 $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/lib
80 $(INSTALL) -m 755 $(BUILD_DIR)/libGL.1.2.dylib $(DESTDIR)$(INSTALL_DIR)/lib
81 $(RM) -f $(DESTDIR)$(INSTALL_DIR)/lib/libGL.dylib
82 $(LN) -s libGL.1.2.dylib $(DESTDIR)$(INSTALL_DIR)/lib/libGL.dylib
83 $(RM) -f $(DESTDIR)$(INSTALL_DIR)/lib/libGL.1.dylib
84 $(LN) -s libGL.1.2.dylib $(DESTDIR)$(INSTALL_DIR)/lib/libGL.1.dylib
85
86 install: install_headers install_libraries
87
88 clean:
89 rm -rf $(BUILD_DIR)
90 rm -f *.o *.a
91 rm -f *.c~ *.h~
92 rm -f apple_xgl_api.h apple_xgl_api.c
93 rm -f *.dylib
94 rm -f include/GL/gl.h
95
96 %.c : ../%.c
97 ln -s $<