Makefile revision 4c9bab78a118953baf307e31cd53e731299f0151
1TOP = ../../.. 2 3include $(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 9TCLSH=tclsh8.5 10MKDIR=mkdir 11INSTALL=install 12LN=ln 13RM=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. 20BUILD_DIR=builds 21 22all: $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) 23 24SOURCES = \ 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 ../glxconfig.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 54include $(TOP)/src/mesa/sources.mak 55 56LDFLAGS += -lXplugin -framework ApplicationServices -framework CoreFoundation 57 58MESA_GLAPI_ASM_SOURCES = $(addprefix $(TOP)/src/mesa/, $(GLAPI_ASM_SOURCES)) 59MESA_GLAPI_SOURCES = $(addprefix $(TOP)/src/mesa/, $(GLAPI_SOURCES)) 60MESA_GLAPI_OBJECTS = $(addprefix $(TOP)/src/mesa/, $(GLAPI_OBJECTS)) 61 62OBJECTS = $(SOURCES:.c=.o) # $(MESA_GLAPI_OBJECTS) 63 64INCLUDES = -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 78apple_xgl_api.c : apple_xgl_api.h 79 80apple_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 91default: 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 100depend: $(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 107tags: 108 etags `find . -name \*.[ch]` `find $(TOP)/include` 109 110install_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 114install_libraries: $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) 115 $(MAKE) -C $(TOP)/src/mesa install-libgl 116 117install: install_libraries 118 119# Remove .o and backup files 120clean: 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 131