Merge branch 'gles2-2'
[mesa.git] / src / glx / apple / Makefile
1 TOP = ../../..
2
3 include $(TOP)/configs/current
4
5 #CC=gcc
6 #GL_CFLAGS=-Wall -ggdb3 -Os -DPTHREADS -D_REENTRANT $(RC_CFLAGS) $(CFLAGS)
7 #GL_LDFLAGS=-L$(INSTALL_DIR)/lib -L$(X11_DIR)/lib $(LDFLAGS) -Wl,-single_module
8
9 TCLSH=tclsh8.5
10 MKDIR=mkdir
11 INSTALL=install
12 LN=ln
13 RM=rm
14
15 #INCLUDE=-I. -Iinclude -I.. -DGLX_ALIAS_UNSUPPORTED -I$(INSTALL_DIR)/include -I$(X11_DIR)/include
16
17 #COMPILE=$(CC) $(INCLUDE) $(GL_CFLAGS) -c
18
19 #The directory with the final binaries.
20 BUILD_DIR=builds
21
22 all: $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
23
24 SOURCES = \
25 apple_cgl.c \
26 apple_glx.c \
27 apple_glx_context.c \
28 apple_glx_drawable.c \
29 apple_glx_pbuffer.c \
30 apple_glx_pixmap.c \
31 apple_glx_surface.c \
32 apple_visual.c \
33 apple_xgl_api.c \
34 apple_xgl_api_additional.c \
35 apple_xgl_api_read.c \
36 apple_xgl_api_stereo.c \
37 apple_xgl_api_viewport.c \
38 appledri.c \
39 ../clientattrib.c \
40 ../compsize.c \
41 ../glcontextmodes.c \
42 glx_empty.c \
43 glx_error.c \
44 ../glx_pbuffer.c \
45 ../glx_query.c \
46 ../glxcmds.c \
47 ../glxcurrent.c \
48 ../glxext.c \
49 ../glxextensions.c \
50 glxreply.c \
51 ../pixel.c \
52 ../xfont.c
53
54 include $(TOP)/src/mesa/sources.mak
55
56 LDFLAGS += -lXplugin -framework ApplicationServices -framework CoreFoundation
57
58 MESA_GLAPI_ASM_SOURCES = $(addprefix $(TOP)/src/mesa/, $(GLAPI_ASM_SOURCES))
59 MESA_GLAPI_SOURCES = $(addprefix $(TOP)/src/mesa/, $(GLAPI_SOURCES))
60 MESA_GLAPI_OBJECTS = $(addprefix $(TOP)/src/mesa/, $(GLAPI_OBJECTS))
61
62 OBJECTS = $(SOURCES:.c=.o) # $(MESA_GLAPI_OBJECTS)
63
64 INCLUDES = -I. -Iinclude -I..\
65 -I$(TOP)/include \
66 -I$(TOP)/include/GL/internal \
67 -I$(TOP)/src/mesa \
68 -I$(TOP)/src/mesa/glapi \
69 $(LIBDRM_CFLAGS) \
70 $(DRI2PROTO_CFLAGS) \
71 $(X11_INCLUDES)
72
73 ##### RULES #####
74
75 $(OBJECTS) : apple_xgl_api.h
76
77 apple_xgl_api.c : apple_xgl_api.h
78
79 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
80 $(TCLSH) gen_code.tcl
81
82 .c.o:
83 $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@
84
85 .S.o:
86 $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@
87
88 ##### TARGETS #####
89
90 default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
91
92 # Make libGL
93 $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
94 $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
95 -major 1 -minor 2 $(MKLIB_OPTIONS) \
96 -install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/lib$(GL_LIB).1.dylib \
97 $(GL_LIB_DEPS) $(OBJECTS)
98
99 depend: $(SOURCES) $(MESA_GLAPI_SOURCES) $(MESA_GLAPI_ASM_SOURCES) Makefile
100 rm -f depend
101 touch depend
102 $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) \
103 $(MESA_GLAPI_SOURCES) $(MESA_GLAPI_ASM_SOURCES)
104
105 # Emacs tags
106 tags:
107 etags `find . -name \*.[ch]` `find $(TOP)/include`
108
109 install_headers: include/GL/gl.h
110 $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
111 $(INSTALL) -m 644 include/GL/gl.h $(DESTDIR)$(INSTALL_DIR)/include/GL
112
113 install_libraries: $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
114 $(MAKE) -C $(TOP)/src/mesa install-libgl
115
116 install: install_libraries
117
118 # Remove .o and backup files
119 clean:
120 -rm -f *.o *.a *~
121 -rm -f *.c~ *.h~
122 -rm -f apple_xgl_api.h apple_xgl_api.c
123 -rm -f *.dylib
124 -rm -f include/GL/gl.h
125 -rm -f $(TOP)/$(LIB_DIR)/$(GL_LIB_GLOB)
126 -rm -f *.o *~
127 -rm -f depend depend.bak
128
129 -include depend