summaryrefslogtreecommitdiffstats
path: root/src/glx/apple/Makefile
blob: b3d163aba9c9e33fe9299c86a9f1100c2c8a28f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
INSTALL_DIR = /usr/X11
X11_DIR = $(INSTALL_DIR)

CC=gcc
GL_CFLAGS=-Wall -ggdb3 -Os -DPTHREADS -D_REENTRANT $(RC_CFLAGS) $(CFLAGS)
GL_LDFLAGS=-L$(INSTALL_DIR)/lib -L$(X11_DIR)/lib $(LDFLAGS) -Wl,-single_module

TCLSH=tclsh8.5

MKDIR=mkdir
INSTALL=install
LN=ln
RM=rm

INCLUDE=-I. -Iinclude -Iinclude/internal -I.. -DGLX_ALIAS_UNSUPPORTED -I$(INSTALL_DIR)/include -I$(X11_DIR)/include
COMPILE=$(CC) $(INCLUDE) $(GL_CFLAGS) -c

#The directory with the final binaries.
BUILD_DIR=builds

all: $(BUILD_DIR)/libGL.1.2.dylib

OBJECTS=glxext.o glxcmds.o glx_pbuffer.o glx_query.o glxcurrent.o glxextensions.o \
    appledri.o apple_glx_context.o apple_glx.o pixel.o \
    compsize.o apple_visual.o apple_cgl.o glxreply.o glcontextmodes.o \
    apple_xgl_api.o apple_glx_drawable.o xfont.o apple_glx_pbuffer.o \
    apple_glx_pixmap.o apple_xgl_api_read.o glx_empty.o glx_error.o \
    apple_xgl_api_viewport.o apple_glx_surface.o apple_xgl_api_stereo.o

$(BUILD_DIR)/libGL.1.2.dylib: $(OBJECTS)
	-if ! test -d $(BUILD_DIR); then $(MKDIR) $(BUILD_DIR); fi
	$(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)

.c.o:
	$(COMPILE) $<

apple_glx_drawable.o: apple_glx_drawable.h apple_glx_drawable.c include/GL/gl.h
apple_xgl_api.o: apple_xgl_api.h apple_xgl_api.c apple_xgl_api_stereo.c include/GL/gl.h
apple_xgl_api_read.o: apple_xgl_api_read.h apple_xgl_api_read.c apple_xgl_api.h include/GL/gl.h
apple_xgl_api_viewport.o: apple_xgl_api_viewport.h apple_xgl_api_viewport.c apple_xgl_api.h include/GL/gl.h
apple_xgl_api_stereo.o: apple_xgl_api_stereo.h apple_xgl_api_stereo.c apple_xgl_api.h include/GL/gl.h
glcontextmodes.o: glcontextmodes.c include/GL/gl.h
glxext.o: glxext.c include/GL/gl.h
glxreply.o: glxreply.c include/GL/gl.h
glxcmds.o: glxcmds.c apple_glx_context.h include/GL/gl.h
glx_pbuffer.o: glx_pbuffer.c include/GL/gl.h
glx_error.o: glx_error.c include/GL/gl.h
glx_query.o: glx_query.c include/GL/gl.h
glxcurrent.o: glxcurrent.c include/GL/gl.h
glxextensions.o: glxextensions.c include/GL/gl.h
glxhash.o: glxhash.h glxhash.c include/GL/gl.h
appledri.o: appledri.h appledristr.h appledri.c include/GL/gl.h
apple_glx_context.o: apple_glx_context.c apple_glx_context.h apple_glx_context.h include/GL/gl.h
apple_glx.o: apple_glx.h apple_glx.c apple_xgl_api.h include/GL/gl.h
apple_visual.o: apple_visual.h apple_visual.c include/GL/gl.h
apple_cgl.o: apple_cgl.h apple_cgl.c include/GL/gl.h
apple_glx_pbuffer.o: apple_glx_drawable.h apple_glx_pbuffer.c include/GL/gl.h
apple_glx_pixmap.o: apple_glx_drawable.h apple_glx_pixmap.c appledri.h include/GL/gl.h
apple_glx_surface.o: apple_glx_drawable.h apple_glx_surface.c appledri.h include/GL/gl.h
xfont.o: xfont.c include/GL/gl.h
compsize.o: compsize.c include/GL/gl.h
renderpix.o: renderpix.c include/GL/gl.h
singlepix.o: singlepix.c include/GL/gl.h
pixel.o: pixel.c include/GL/gl.h
glx_empty.o: glx_empty.c include/GL/gl.h

apple_xgl_api.c: apple_xgl_api.h
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
	$(TCLSH) gen_code.tcl

include/GL/gl.h: include/GL/gl.h.template gen_gl_h.sh
	./gen_gl_h.sh include/GL/gl.h.template $@

install_headers: include/GL/gl.h
	$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
	$(INSTALL) -m 644 include/GL/gl.h include/GL/glext.h include/GL/glx.h include/GL/glxext.h $(DESTDIR)$(INSTALL_DIR)/include/GL

install_libraries: $(BUILD_DIR)/libGL.1.2.dylib
	$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/lib
	$(INSTALL) -m 755 $(BUILD_DIR)/libGL.1.2.dylib $(DESTDIR)$(INSTALL_DIR)/lib
	$(RM) -f $(DESTDIR)$(INSTALL_DIR)/lib/libGL.dylib
	$(LN) -s libGL.1.2.dylib $(DESTDIR)$(INSTALL_DIR)/lib/libGL.dylib
	$(RM) -f $(DESTDIR)$(INSTALL_DIR)/lib/libGL.1.dylib
	$(LN) -s libGL.1.2.dylib $(DESTDIR)$(INSTALL_DIR)/lib/libGL.1.dylib

install: install_headers install_libraries

clean:
	rm -rf $(BUILD_DIR)
	rm -f *.o *.a
	rm -f *.c~ *.h~
	rm -f apple_xgl_api.h apple_xgl_api.c
	rm -f *.dylib
	rm -f include/GL/gl.h

%.c : ../%.c
	ln -s $<