-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
227 lines (206 loc) · 4.73 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
PSPPATH := $(shell psp-config --psp-prefix)
PSPSDK := $(shell psp-config --pspsdk-path)
ARCH = psp-
CC = $(ARCH)gcc -std=gnu99
AR = $(ARCH)ar
RANLIB = $(ARCH)ranlib
RM = rm -f
CFLAGS = -g -Wall -Wmissing-prototypes -Os -G0 -fsingle-precision-constant -I. -I $(PSPPATH)/include -I $(PSPSDK)/include -funit-at-a-time
LFLAGS = -g -Wall -Os -G0 -L$(PSPPATH)/lib
DEPDIR = .deps
API_OBJS = \
eglBindTexImage.o \
eglChooseConfig.o \
eglCreateContext.o \
eglCreatePbufferSurface.o \
eglCreateWindowSurface.o \
eglDestroyContext.o \
eglDestroySurface.o \
eglGetConfigAttrib.o \
eglGetConfigs.o \
eglGetError.o \
eglGetDisplay.o \
eglInitialize.o \
eglMakeCurrent.o \
eglQueryString.o \
eglSwapBuffers.o \
eglSwapInterval.o \
eglTerminate.o \
eglWaitGL.o \
eglWaitNative.o \
glAlphaFunc.o \
glArrayElement.o \
glBegin.o \
glDrawBezierArrays.o \
glDrawBezierElements.o \
glDrawSplineArrays.o \
glDrawSplineElements.o \
glBindBufferARB.o \
glBindTexture.o \
glBlendEquation.o \
glBlendFunc.o \
glBufferDataARB.o \
glBufferSubDataARB.o \
glClear.o \
glClearColor.o \
glClearDepth.o \
glClearDepthf.o \
glClearStencil.o \
glColor.o \
glColorMask.o \
glColorPointer.o \
glColorTable.o \
glCompressedTexImage2D.o \
glCopyTexImage2D.o \
glCullFace.o \
glDeleteBuffersARB.o \
glDeleteTextures.o \
glDepthFunc.o \
glDepthMask.o \
glDepthRange.o \
glDepthRangef.o \
glDrawArrays.o \
glDrawBuffer.o \
glDrawElements.o \
glEnable.o \
glEnableClientState.o \
glEnd.o \
glFinish.o \
glFlush.o \
glFog.o \
glFrontFace.o \
glFrustumf.o \
glFrustum.o \
glGenBuffersARB.o \
glGenTextures.o \
glGetBufferSubDataARB.o \
glGetFloatv.o \
glGetIntegerv.o \
glGetError.o \
glGetString.o \
glInterleavedArrays.o \
glIsTexture.o \
glLight.o \
glLightModel.o \
glLineWidth.o \
glLoadIdentity.o \
glLoadMatrixf.o \
glLockArraysEXT.o \
glLogicOp.o \
glMapBufferARB.o \
glMaterial.o \
glMatrixMode.o \
glMultMatrixf.o \
glNormal.o \
glNormald.o \
glNormalPointer.o \
glOrtho.o \
glOrthof.o \
glPixelStore.o \
glPushAttrib.o \
glPushClientAttrib.o \
glPopMatrix.o \
glPushMatrix.o \
glPolygonMode.o \
glPolygonOffset.o \
glPrioritizeTextures.o \
glReadBuffer.o \
glReadPixels.o \
glRotatef.o \
glScalef.o \
glScaled.o \
glScissor.o \
glShadeModel.o \
glStencilFunc.o \
glStencilMask.o \
glStencilOp.o \
glTexCoord.o \
glTexCoordPointer.o \
glTexEnv.o \
glTexGen.o \
glTexImage2D.o \
glTexSubImage2D.o \
glTexParameter.o \
glTranslatef.o \
glUnmapBufferARB.o \
glVertex.o \
glVertexd.o \
glVertexi.o \
glVertexPointer.o \
glViewport.o \
glWeightPointerPSP.o \
pspgl_buffers.o \
pspgl_context.o \
pspgl_copy_pixels.o \
pspgl_dlist.o \
pspgl_ge_init.o \
pspgl_hash.o \
pspgl_matrix.o \
pspgl_misc.o \
pspgl_stats.o \
pspgl_texobj.o \
pspgl_varray.o \
pspgl_varray_draw.o \
pspgl_varray_draw_elts.o \
pspgl_varray_draw_range_elts.o \
pspgl_vidmem.o
libGL.a_OBJS = \
$(API_OBJS) \
eglGetProcAddress.o
# glGenLists.o
# glIsList.o
# glDeleteLists.o
libGLU.a_OBJS = \
gluBuildMipmaps.o \
gluLookAt.o \
gluLookAtf.o \
gluPerspective.o \
gluPerspectivef.o \
gluScaleImage.o \
pspglu.o
libglut.a_OBJS = \
glut.o
all: $(DEPDIR) $(libGL.a_OBJS) $(libGLU.a_OBJS) $(libglut.a_OBJS) libGL.a libGLU.a libglut.a
%.a: $(libGL.a_OBJS) $(libGLU.a_OBJS) $(libglut.a_OBJS)
$(RM) $@
$(AR) cru $@ $($@_OBJS)
$(RANLIB) $@
@$(ARCH)nm -o -fp -g --defined-only $@ | \
awk '$$2~/^(gl|egl|glut|__pspgl)/ { next } \
{ if (!bad) print "Bad symbols:"; print "\t", $$1, $$2; bad++ } \
END { if (bad) { \
print bad," bad symbol(s)"; exit(1) \
} else { \
print "Namespace OK" } \
}'
eglGetProcAddress.o: eglGetProcAddress.c pspgl_proctable.h
# Extract all the public GL and EGL API symbols which are extensions (ends with PSP, ARB or EXT)
# Symbols must be sorted by name so that bsearch can be used to look for them.
pspgl_proctable.h: $(API_OBJS) Makefile
$(ARCH)nm -fp -g --defined-only $(API_OBJS) | sort -k1 | \
awk '$$2=="T" && $$1 ~ /^(gl|egl)[A-Z][a-zA-Z]+(PSP|ARB|EXT)/ \
{ print "\t{ \"" $$1 "\", (void (*)())"$$1 " }," }' > $@ \
|| rm -f $@
$(DEPDIR):
mkdir $(DEPDIR)
.c.o:
$(CC) $(CFLAGS) -MD -MF $(DEPDIR)/$*.d -c $<
.S.o:
$(CC) $(CFLAGS) -c $<
tar: clean
( cd .. && tar cvfz pspgl-`date "+%Y-%m-%d"`.tar.gz pspgl --exclude "*.DS_Store" && cd - )
clean:
$(RM) -rf *.o *.a $(DEPDIR) pspgl_proctable.h
make -C tools clean
make -C tests clean
make -C test-q3 clean
make -C test-vfpu clean
install: all
mkdir -p $(PSPPATH)/include $(PSPPATH)/lib
mkdir -p $(PSPPATH)/include/GL $(PSPPATH)/include/GLES
cp GL/*.h $(PSPPATH)/include/GL
cp GLES/*.h $(PSPPATH)/include/GLES
cp libGL.a $(PSPPATH)/lib
cp libGLU.a $(PSPPATH)/lib
cp libglut.a $(PSPPATH)/lib
-include $(wildcard $(DEPDIR)/*.d) dummy