glx: Use _X_EXPORT instead of our own PUBLIC macro
[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/mapi \
69 -I$(TOP)/src/mapi/glapi \
70 $(LIBDRM_CFLAGS) \
71 $(DRI2PROTO_CFLAGS) \
72 $(X11_INCLUDES)
73
74 ##### RULES #####
75
76 $(OBJECTS) : apple_xgl_api.h
77
78 apple_xgl_api.c : apple_xgl_api.h
79
80 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
81 $(TCLSH) gen_code.tcl
82
83 .c.o:
84 $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@
85
86 .S.o:
87 $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@
88
89 ##### TARGETS #####
90
91 default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
92
93 # Make libGL
94 $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
95 $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
96 -major 1 -minor 2 $(MKLIB_OPTIONS) \
97 -install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/lib$(GL_LIB).1.dylib \
98 $(GL_LIB_DEPS) $(OBJECTS)
99
100 depend: $(SOURCES) $(MESA_GLAPI_SOURCES) $(MESA_GLAPI_ASM_SOURCES) Makefile
101 rm -f depend
102 touch depend
103 $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) \
104 $(MESA_GLAPI_SOURCES) $(MESA_GLAPI_ASM_SOURCES)
105
106 # Emacs tags
107 tags:
108 etags `find . -name \*.[ch]` `find $(TOP)/include`
109
110 install_headers: include/GL/gl.h
111 $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
112 $(INSTALL) -m 644 include/GL/gl.h $(DESTDIR)$(INSTALL_DIR)/include/GL
113
114 install_libraries: $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
115 $(MAKE) -C $(TOP)/src/mesa install-libgl
116
117 install: install_libraries
118
119 # Remove .o and backup files
120 clean:
121 -rm -f *.o *.a *~
122 -rm -f *.c~ *.h~
123 -rm -f apple_xgl_api.h apple_xgl_api.c
124 -rm -f *.dylib
125 -rm -f include/GL/gl.h
126 -rm -f $(TOP)/$(LIB_DIR)/$(GL_LIB_GLOB)
127 -rm -f *.o *~
128 -rm -f depend depend.bak
129
130 -include depend