/
Makefile
122 lines (100 loc) · 3.03 KB
/
Makefile
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
TOP = ..
include ${TOP}/arch.mk
SHARED = 1
LIBRARY = crfaker
FILES = getprocaddress load stub context NULLfuncs
LIBRARIES = crmothership crutil spuload
ifeq ($(THREADSAFE), 1)
FILES += tsfuncs
endif
ifeq ($(ARCH), WIN_NT)
FILES += windows_exports wgl
ARCH_EXPORTS_PY = windows_exports.py
ARCH_EXPORTS = windows_exports.c
endif
ifeq ($(ARCH), Linux)
LDFLAGS += -lX11
ifeq ($(MACHTYPE), i386)
FILES += $(ARCH)_$(MACHTYPE)_exports glx xfont
ARCH_EXPORTS_PY = $(ARCH)_$(MACHTYPE)_exports.py
ARCH_EXPORTS = $(ARCH)_$(MACHTYPE)_exports.s
else
FILES += $(ARCH)_exports glx xfont
ARCH_EXPORTS_PY = $(ARCH)_exports.py
ARCH_EXPORTS = $(ARCH)_exports.c
endif
endif
ifeq ($(ARCH), SunOS)
LDFLAGS += -lX11
FILES += $(ARCH)_exports glx xfont
ARCH_EXPORTS_PY = $(ARCH)_exports.py
ARCH_EXPORTS = $(ARCH)_exports.c
endif
ifeq ($(ARCH), FreeBSD)
LDFLAGS += -lX11
FILES += $(ARCH)_exports glx xfont
ARCH_EXPORTS_PY = $(ARCH)_exports.py
ARCH_EXPORTS = $(ARCH)_exports.c
endif
ifeq ($(ARCH), AIX)
OPENGL = 1
FILES += $(ARCH)_exports glx xfont
ARCH_EXPORTS_PY = $(ARCH)_exports.py
ARCH_EXPORTS = $(ARCH)_exports.c
endif
ifeq ($(ARCH), Darwin)
LDFLAGS += -L/System/Library/Frameworks/OpenGL.framework/Libraries
LDFLAGS += -framework Carbon -compatibility_version 1.0.0 -current_version 1.0.0 -sub_library libGLU -lGLU
FILES += $(ARCH)_exports cgl
ARCH_EXPORTS_PY = $(ARCH)_exports.py
ARCH_EXPORTS = $(ARCH)_exports.c
endif
ifeq ($(ARCH), IRIX64)
FILES += $(ARCH)_exports glx xfont
ARCH_EXPORTS_PY = $(ARCH)_exports.py
ARCH_EXPORTS = $(ARCH)_exports.c
endif
ifeq ($(ARCH), IRIX)
FILES += IRIX64_exports glx xfont
ARCH_EXPORTS_PY = IRIX64_exports.py
ARCH_EXPORTS = IRIX64_exports.c
endif
ifeq ($(ARCH), OSF1)
LDFLAGS += -lX11
FILES += $(ARCH)_exports glx xfont
ARCH_EXPORTS_PY = $(ARCH)_exports.py
ARCH_EXPORTS = $(ARCH)_exports.c
endif
PRECOMP = $(ARCH_EXPORTS) getprocaddress.c opengl.def NULLfuncs.c tsfuncs.c
SLOP = $(PRECOMP)
LIB_DEFS = opengl.def
include ${TOP}/cr.mk
ifdef WINDOWS
LDFLAGS += user32.lib ws2_32.lib gdi32.lib
endif
APIFILES = ../glapi_parser/apiutil.py ../glapi_parser/APIspec.txt
opengl.def: defs.py $(APIFILES)
@$(ECHO) "Creating the defs file..."
@$(PYTHON) defs.py > opengl.def
ifeq ($(ARCH), WIN_NT)
getprocaddress.c: windows_getprocaddress.py $(APIFILES)
@$(ECHO) "Creating crGetProcAddress"
@$(PYTHON) windows_getprocaddress.py > getprocaddress.c
else
getprocaddress.c: getprocaddress.py $(APIFILES)
@$(ECHO) "Creating crGetProcAddress"
@$(PYTHON) getprocaddress.py > getprocaddress.c
endif
$(ARCH_EXPORTS): $(ARCH_EXPORTS_PY) $(APIFILES) entrypoints.py
@$(ECHO) "Creating the OpenGL DLL export functions (for $(ARCH))"
@$(PYTHON) $(ARCH_EXPORTS_PY) > $(ARCH_EXPORTS)
NULLfuncs.c: NULLfuncs.py $(APIFILES)
@$(ECHO) "Creating the NULL dispatch table functions"
@$(PYTHON) NULLfuncs.py > NULLfuncs.c
tsfuncs.c: tsfuncs.py $(APIFILES)
@$(ECHO) "Building thread-safe dispatch code"
@$(PYTHON) tsfuncs.py > tsfuncs.c