From 5c459b392562d98f98efefe64ee2f531235c2ad4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 11 Sep 2008 10:43:14 -0600 Subject: simple quad drawing test --- progs/tests/Makefile | 1 + progs/tests/quads.c | 258 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 259 insertions(+) create mode 100644 progs/tests/quads.c (limited to 'progs/tests') diff --git a/progs/tests/Makefile b/progs/tests/Makefile index 7e8c0c8e34d..3bead54e200 100644 --- a/progs/tests/Makefile +++ b/progs/tests/Makefile @@ -60,6 +60,7 @@ SOURCES = \ pbo.c \ prog_parameter.c \ projtex.c \ + quads.c \ random.c \ readrate.c \ seccolor.c \ diff --git a/progs/tests/quads.c b/progs/tests/quads.c new file mode 100644 index 00000000000..1bf57e6337d --- /dev/null +++ b/progs/tests/quads.c @@ -0,0 +1,258 @@ +/** + * Draw colored quads. + */ + + +#define GL_GLEXT_PROTOTYPES +#include +#include +#include +#include + +#define NUM_QUADS 20 + + +static int Win; +static GLfloat Xrot = 40, Yrot = 0, Zrot = 0; +static GLboolean Anim = GL_TRUE; +static GLuint Vbuffer = 0; + +static GLfloat buf[NUM_QUADS * 6 * 4]; + +static GLboolean SwapBuffers = GL_TRUE; + +static GLint Frames = 0, T0 = 0; + + +static void +Idle(void) +{ + Xrot += 3.0; + Yrot += 4.0; + Zrot += 2.0; + glutPostRedisplay(); +} + + +static void +Draw(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glPushMatrix(); + glRotatef(Xrot, 1, 0, 0); + glRotatef(Yrot, 0, 1, 0); + glRotatef(Zrot, 0, 0, 1); + + glDrawArrays(GL_QUADS, 0, NUM_QUADS*4); + + glPopMatrix(); + + if (SwapBuffers) + glutSwapBuffers(); + /* + else + glFinish(); + */ + + { + GLint t = glutGet(GLUT_ELAPSED_TIME); + Frames++; + if (t - T0 >= 5000) { + GLfloat seconds = (t - T0) / 1000.0; + GLfloat fps = Frames / seconds; + printf("%d frames in %6.3f seconds = %6.3f FPS\n", + Frames, seconds, fps); + T0 = t; + Frames = 0; + } + } +} + + +static void +Reshape(int width, int height) +{ + glViewport(0, 0, width, height); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0, 0.0, -8.0); +} + + +static void +Key(unsigned char key, int x, int y) +{ + const GLfloat step = 3.0; + (void) x; + (void) y; + switch (key) { + case 's': + SwapBuffers = !SwapBuffers; + break; + case 'a': + Anim = !Anim; + if (Anim) + glutIdleFunc(Idle); + else + glutIdleFunc(NULL); + break; + case 'z': + Zrot -= step; + break; + case 'Z': + Zrot += step; + break; + case 27: + glutDestroyWindow(Win); + exit(0); + break; + } + glutPostRedisplay(); +} + + +static void +SpecialKey(int key, int x, int y) +{ + const GLfloat step = 3.0; + (void) x; + (void) y; + switch (key) { + case GLUT_KEY_UP: + Xrot -= step; + break; + case GLUT_KEY_DOWN: + Xrot += step; + break; + case GLUT_KEY_LEFT: + Yrot -= step; + break; + case GLUT_KEY_RIGHT: + Yrot += step; + break; + } + glutPostRedisplay(); +} + + +static void +quad(float x, float y, float z, float *v) +{ + int k = 0; + + /* color */ + v[k++] = x * 0.5 + 0.5; + v[k++] = y * 0.5 + 0.5; + v[k++] = z * 0.5 + 0.5; + /* vert */ + v[k++] = x; + v[k++] = y; + v[k++] = z; + + /* color */ + v[k++] = -x * 0.5 + 0.5; + v[k++] = -y * 0.5 + 0.5; + v[k++] = z * 0.5 + 0.5; + /* vert */ + v[k++] = -x; + v[k++] = -y; + v[k++] = z; + + /* color */ + v[k++] = -x * 0.5 + 0.5; + v[k++] = -y * 0.5 + 0.5; + v[k++] = -z * 0.5 + 0.5; + /* vert */ + v[k++] = -x; + v[k++] = -y; + v[k++] = -z; + + /* color */ + v[k++] = x * 0.5 + 0.5; + v[k++] = y * 0.5 + 0.5; + v[k++] = -z * 0.5 + 0.5; + /* vert */ + v[k++] = x; + v[k++] = y; + v[k++] = -z; +} + +static void +gen_quads(GLfloat *buf) +{ + float *v = buf; + float r = 1.0; + int i; + + for (i = 0; i < NUM_QUADS; i++) { + float angle = i / (float) NUM_QUADS * M_PI; + float x = r * cos(angle); + float y = r * sin(angle); + float z = 1.10; + quad(x, y, z, v); + v += 24; + } + + if (0) { + float *p = buf; + for (i = 0; i < NUM_QUADS * 4 * 2; i++) { + printf("%d: %f %f %f\n", i, p[0], p[1], p[2]); + p += 3; + } + } +} + + +static void +Init(void) +{ + int bytes = NUM_QUADS * 4 * 2 * 3 * sizeof(float); + GLfloat *f; + +#if 1 + glGenBuffers(1, &Vbuffer); + glBindBuffer(GL_ARRAY_BUFFER, Vbuffer); + glBufferData(GL_ARRAY_BUFFER_ARB, bytes, NULL, GL_STATIC_DRAW_ARB); + f = (float *) glMapBuffer(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + gen_quads(f); + glUnmapBuffer(GL_ARRAY_BUFFER_ARB); + glColorPointer(3, GL_FLOAT, 6*sizeof(float), (void *) 0); + glVertexPointer(3, GL_FLOAT, 6*sizeof(float), (void *) 12); +#else + f = buf; + gen_quads(f); + glColorPointer(3, GL_FLOAT, 6*sizeof(float), buf); + glVertexPointer(3, GL_FLOAT, 6*sizeof(float), buf + 3); +#endif + + glEnableClientState(GL_COLOR_ARRAY); + glEnableClientState(GL_VERTEX_ARRAY); + + glEnable(GL_DEPTH_TEST); + + glClearColor(0.5, 0.5, 0.5, 0.0); +} + + +int +main(int argc, char *argv[]) +{ + glutInit(&argc, argv); + glutInitWindowPosition(0, 0); + glutInitWindowSize(600, 600); + glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); + Win = glutCreateWindow(argv[0]); + glutReshapeFunc(Reshape); + glutKeyboardFunc(Key); + glutSpecialFunc(SpecialKey); + glutDisplayFunc(Draw); + if (Anim) + glutIdleFunc(Idle); + Init(); + glutMainLoop(); + return 0; +} -- cgit v1.2.3 From 90c93bbeeec1a8ca75b68004afc5d8cb689860bc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 11 Sep 2008 11:00:54 -0600 Subject: define new APP_CC configuration variable for building apps/demos/tests For Cell, need to use different compilers for the libraries vs. the demos/tests to avoid strange link error regarding "_Unwind_GetIPInfo@GCC_4.2.0" --- configs/default | 4 ++++ configs/linux-cell | 4 +++- progs/demos/Makefile | 28 ++++++++++++++-------------- progs/glsl/Makefile | 12 ++++++------ progs/redbook/Makefile | 2 +- progs/samples/Makefile | 8 ++++---- progs/tests/Makefile | 40 ++++++++++++++++++++-------------------- progs/trivial/Makefile | 16 ++++++++-------- progs/xdemos/Makefile | 22 +++++++++++----------- 9 files changed, 71 insertions(+), 65 deletions(-) (limited to 'progs/tests') diff --git a/configs/default b/configs/default index cd2c39c3650..94582d82746 100644 --- a/configs/default +++ b/configs/default @@ -23,6 +23,10 @@ CFLAGS = -O CXXFLAGS = -O GLU_CFLAGS = +# Compiler for building demos/tests/etc +APP_CC = $(CC) +APP_CXX = $(CXX) + # Misc tools and flags MKLIB_OPTIONS = MKDEP = makedepend diff --git a/configs/linux-cell b/configs/linux-cell index cdaa17c6636..86651b83d7b 100644 --- a/configs/linux-cell +++ b/configs/linux-cell @@ -12,6 +12,8 @@ GALLIUM_DRIVER_DIRS += cell CC = ppu32-gcc CXX = ppu32-g++ HOST_CC = gcc +APP_CC = gcc +APP_CXX = g++ OPT_FLAGS = -O3 @@ -19,7 +21,7 @@ OPT_FLAGS = -O3 ## For SDK 2.1: (plus, remove -DSPU_MAIN_PARAM_LONG_LONG below) #SDK = /opt/ibm/cell-sdk/prototype/sysroot/usr ## For SDK 3.0: -SDK = /opt/cell/sdk/usr/ +SDK = /opt/cell/sdk/usr CFLAGS = $(OPT_FLAGS) -Wall -Winline -fPIC -m32 -mabi=altivec -maltivec \ diff --git a/progs/demos/Makefile b/progs/demos/Makefile index 43874ecdaa0..fe0e0fbd91b 100644 --- a/progs/demos/Makefile +++ b/progs/demos/Makefile @@ -74,7 +74,7 @@ PROGS = \ # make executable from .c file: .c: $(LIB_DEP) readtex.o - $(CC) -I$(INCDIR) $(CFLAGS) $< readtex.o $(APP_LIB_DEPS) -o $@ + $(APP_CC) -I$(INCDIR) $(CFLAGS) $< readtex.o $(APP_LIB_DEPS) -o $@ ##### TARGETS ##### @@ -90,7 +90,7 @@ readtex.h: $(TOP)/progs/util/readtex.h cp $< . readtex.o: readtex.c readtex.h - $(CC) -c -I$(INCDIR) $(CFLAGS) readtex.c + $(APP_CC) -c -I$(INCDIR) $(CFLAGS) readtex.c showbuffer.c: $(TOP)/progs/util/showbuffer.c @@ -100,7 +100,7 @@ showbuffer.h: $(TOP)/progs/util/showbuffer.h cp $< . showbuffer.o: showbuffer.c showbuffer.h - $(CC) -c -I$(INCDIR) $(CFLAGS) showbuffer.c + $(APP_CC) -c -I$(INCDIR) $(CFLAGS) showbuffer.c trackball.c: $(TOP)/progs/util/trackball.c @@ -110,7 +110,7 @@ trackball.h: $(TOP)/progs/util/trackball.h cp $< . trackball.o: trackball.c trackball.h - $(CC) -c -I$(INCDIR) $(CFLAGS) trackball.c + $(APP_CC) -c -I$(INCDIR) $(CFLAGS) trackball.c extfuncs.h: $(TOP)/progs/util/extfuncs.h @@ -118,38 +118,38 @@ extfuncs.h: $(TOP)/progs/util/extfuncs.h reflect: reflect.o showbuffer.o readtex.o - $(CC) reflect.o showbuffer.o readtex.o $(APP_LIB_DEPS) $(ARCH_FLAGS) -o $@ + $(APP_CC) reflect.o showbuffer.o readtex.o $(APP_LIB_DEPS) $(ARCH_FLAGS) -o $@ reflect.o: reflect.c showbuffer.h - $(CC) -c -I$(INCDIR) $(CFLAGS) reflect.c + $(APP_CC) -c -I$(INCDIR) $(CFLAGS) reflect.c shadowtex: shadowtex.o showbuffer.o - $(CC) shadowtex.o showbuffer.o $(APP_LIB_DEPS) $(ARCH_FLAGS) -o $@ + $(APP_CC) shadowtex.o showbuffer.o $(APP_LIB_DEPS) $(ARCH_FLAGS) -o $@ shadowtex.o: shadowtex.c showbuffer.h - $(CC) -c -I$(INCDIR) $(CFLAGS) shadowtex.c + $(APP_CC) -c -I$(INCDIR) $(CFLAGS) shadowtex.c gloss: gloss.o trackball.o readtex.o - $(CC) gloss.o trackball.o readtex.o $(APP_LIB_DEPS) $(ARCH_FLAGS) -o $@ + $(APP_CC) gloss.o trackball.o readtex.o $(APP_LIB_DEPS) $(ARCH_FLAGS) -o $@ gloss.o: gloss.c trackball.h - $(CC) -c -I$(INCDIR) $(CFLAGS) gloss.c + $(APP_CC) -c -I$(INCDIR) $(CFLAGS) gloss.c engine: engine.o trackball.o readtex.o - $(CC) engine.o trackball.o readtex.o $(APP_LIB_DEPS) $(ARCH_FLAGS) -o $@ + $(APP_CC) engine.o trackball.o readtex.o $(APP_LIB_DEPS) $(ARCH_FLAGS) -o $@ engine.o: engine.c trackball.h - $(CC) -c -I$(INCDIR) $(CFLAGS) engine.c + $(APP_CC) -c -I$(INCDIR) $(CFLAGS) engine.c fslight: fslight.o - $(CC) fslight.o $(APP_LIB_DEPS) $(ARCH_FLAGS) -o $@ + $(APP_CC) fslight.o $(APP_LIB_DEPS) $(ARCH_FLAGS) -o $@ fslight.o: fslight.c extfuncs.h - $(CC) -c -I$(INCDIR) $(CFLAGS) fslight.c + $(APP_CC) -c -I$(INCDIR) $(CFLAGS) fslight.c diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile index b9cae668152..9c1d3f8126b 100644 --- a/progs/glsl/Makefile +++ b/progs/glsl/Makefile @@ -26,7 +26,7 @@ PROGS = \ # make executable from .c file: .c: $(LIB_DEP) - $(CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@ + $(APP_CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@ ##### TARGETS ##### @@ -47,7 +47,7 @@ readtex.h: $(TOP)/progs/util/readtex.h cp $< . readtex.o: readtex.c readtex.h - $(CC) -c -I$(INCDIR) $(CFLAGS) readtex.c + $(APP_CC) -c -I$(INCDIR) $(CFLAGS) readtex.c brick.c: extfuncs.h @@ -58,16 +58,16 @@ mandelbrot.c: extfuncs.h toyball.c: extfuncs.h texdemo1: texdemo1.o readtex.o - $(CC) -I$(INCDIR) $(CFLAGS) texdemo1.o readtex.o $(APP_LIB_DEPS) -o $@ + $(APP_CC) -I$(INCDIR) $(CFLAGS) texdemo1.o readtex.o $(APP_LIB_DEPS) -o $@ texdemo1.o: texdemo1.c readtex.h extfuncs.h - $(CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c + $(APP_CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c convolutions: convolutions.o readtex.o - $(CC) -I$(INCDIR) $(CFLAGS) convolutions.o readtex.o $(APP_LIB_DEPS) -o $@ + $(APP_CC) -I$(INCDIR) $(CFLAGS) convolutions.o readtex.o $(APP_LIB_DEPS) -o $@ convolutions.o: convolutions.c readtex.h - $(CC) -c -I$(INCDIR) $(CFLAGS) convolutions.c + $(APP_CC) -c -I$(INCDIR) $(CFLAGS) convolutions.c clean: diff --git a/progs/redbook/Makefile b/progs/redbook/Makefile index febc74441b9..956c398873a 100644 --- a/progs/redbook/Makefile +++ b/progs/redbook/Makefile @@ -24,7 +24,7 @@ PROGS = aaindex aapoly aargb accanti accpersp alpha alpha3D anti \ .SUFFIXES: .c .c: $(LIB_DEP) - $(CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@ + $(APP_CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@ diff --git a/progs/samples/Makefile b/progs/samples/Makefile index 063008dccff..25ce14740a8 100644 --- a/progs/samples/Makefile +++ b/progs/samples/Makefile @@ -18,7 +18,7 @@ PROGS = accum bitmap1 bitmap2 blendeq blendxor copy cursor depth eval fog \ .SUFFIXES: .c .c: $(LIB_DEP) - $(CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@ + $(APP_CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@ ##### TARGETS ##### @@ -27,10 +27,10 @@ default: $(PROGS) sphere: sphere.o readtex.o - $(CC) -I$(INCDIR) $(CFLAGS) sphere.o readtex.o $(APP_LIB_DEPS) -o $@ + $(APP_CC) -I$(INCDIR) $(CFLAGS) sphere.o readtex.o $(APP_LIB_DEPS) -o $@ sphere.o: sphere.c readtex.h - $(CC) -c -I$(INCDIR) $(CFLAGS) sphere.c + $(APP_CC) -c -I$(INCDIR) $(CFLAGS) sphere.c readtex.c: $(TOP)/progs/util/readtex.c cp $< . @@ -39,7 +39,7 @@ readtex.h: $(TOP)/progs/util/readtex.h cp $< . readtex.o: readtex.c readtex.h - $(CC) -c -I$(INCDIR) $(CFLAGS) $< -o $@ + $(APP_CC) -c -I$(INCDIR) $(CFLAGS) $< -o $@ clean: diff --git a/progs/tests/Makefile b/progs/tests/Makefile index 3bead54e200..9c81f870d88 100644 --- a/progs/tests/Makefile +++ b/progs/tests/Makefile @@ -103,13 +103,13 @@ UTIL_FILES = readtex.h readtex.c .SUFFIXES: .c .c: - $(CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@ + $(APP_CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@ .c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ .S.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ ##### TARGETS ##### @@ -129,58 +129,58 @@ getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress. python getprocaddress.py > getproclist.h arraytexture: arraytexture.o readtex.o - $(CC) $(CFLAGS) arraytexture.o readtex.o $(LIBS) -o $@ + $(APP_CC) $(CFLAGS) arraytexture.o readtex.o $(LIBS) -o $@ arraytexture.o: arraytexture.c readtex.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ afsmultiarb: afsmultiarb.o readtex.o - $(CC) $(CFLAGS) afsmultiarb.o readtex.o $(LIBS) -o $@ + $(APP_CC) $(CFLAGS) afsmultiarb.o readtex.o $(LIBS) -o $@ afsmultiarb.o: afsmultiarb.c readtex.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ drawbuffers: drawbuffers.o - $(CC) $(CFLAGS) drawbuffers.o $(LIBS) -o $@ + $(APP_CC) $(CFLAGS) drawbuffers.o $(LIBS) -o $@ drawbuffers.o: drawbuffers.c extfuncs.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ texrect: texrect.o readtex.o - $(CC) $(CFLAGS) texrect.o readtex.o $(LIBS) -o $@ + $(APP_CC) $(CFLAGS) texrect.o readtex.o $(LIBS) -o $@ texrect.o: texrect.c readtex.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ bug_3195: bug_3195.o readtex.o - $(CC) $(CFLAGS) bug_3195.o readtex.o $(LIBS) -o $@ + $(APP_CC) $(CFLAGS) bug_3195.o readtex.o $(LIBS) -o $@ bug_3195.o: bug_3195.c readtex.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ invert: invert.o readtex.o - $(CC) $(CFLAGS) invert.o readtex.o $(LIBS) -o $@ + $(APP_CC) $(CFLAGS) invert.o readtex.o $(LIBS) -o $@ invert.o: invert.c readtex.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ mipmap_view: mipmap_view.o readtex.o - $(CC) $(CFLAGS) mipmap_view.o readtex.o $(LIBS) -o $@ + $(APP_CC) $(CFLAGS) mipmap_view.o readtex.o $(LIBS) -o $@ mipmap_view.o: mipmap_view.c readtex.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ fillrate: fillrate.o readtex.o - $(CC) $(CFLAGS) fillrate.o readtex.o $(LIBS) -o $@ + $(APP_CC) $(CFLAGS) fillrate.o readtex.o $(LIBS) -o $@ fillrate.o: fillrate.c readtex.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ readtex.o: readtex.c - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ readtex.h: $(TOP)/progs/util/readtex.h diff --git a/progs/trivial/Makefile b/progs/trivial/Makefile index d745fefbbf4..c868ab6e6ff 100644 --- a/progs/trivial/Makefile +++ b/progs/trivial/Makefile @@ -139,13 +139,13 @@ UTIL_FILES = readtex.h readtex.c .SUFFIXES: .c .c: - $(CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@ + $(APP_CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@ .c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ .S.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ ##### TARGETS ##### @@ -166,19 +166,19 @@ getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress. texrect: texrect.o readtex.o - $(CC) texrect.o readtex.o $(LIBS) -o $@ + $(APP_CC) texrect.o readtex.o $(LIBS) -o $@ texrect.o: texrect.c readtex.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ invert: invert.o readtex.o - $(CC) invert.o readtex.o $(LIBS) -o $@ + $(APP_CC) invert.o readtex.o $(LIBS) -o $@ invert.o: invert.c readtex.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ readtex.o: readtex.c - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ readtex.h: $(TOP)/progs/util/readtex.h diff --git a/progs/xdemos/Makefile b/progs/xdemos/Makefile index 896b1608780..38f3884d589 100644 --- a/progs/xdemos/Makefile +++ b/progs/xdemos/Makefile @@ -39,7 +39,7 @@ PROGS = glthreads \ .SUFFIXES: .c .c: $(LIB_DEP) - $(CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@ + $(APP_CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@ ##### TARGETS ##### @@ -54,32 +54,32 @@ clean: # special cases pbinfo: pbinfo.o pbutil.o - $(CC) -I$(INCDIR) $(CFLAGS) pbinfo.o pbutil.o $(APP_LIB_DEPS) -o $@ + $(APP_CC) -I$(INCDIR) $(CFLAGS) pbinfo.o pbutil.o $(APP_LIB_DEPS) -o $@ pbdemo: pbdemo.o pbutil.o - $(CC) -I$(INCDIR) $(CFLAGS) pbdemo.o pbutil.o $(APP_LIB_DEPS) -o $@ + $(APP_CC) -I$(INCDIR) $(CFLAGS) pbdemo.o pbutil.o $(APP_LIB_DEPS) -o $@ pbinfo.o: pbinfo.c pbutil.h - $(CC) -c -I. -I$(INCDIR) $(CFLAGS) pbinfo.c + $(APP_CC) -c -I. -I$(INCDIR) $(CFLAGS) pbinfo.c pbdemo.o: pbdemo.c pbutil.h - $(CC) -c -I. -I$(INCDIR) $(CFLAGS) pbdemo.c + $(APP_CC) -c -I. -I$(INCDIR) $(CFLAGS) pbdemo.c pbutil.o: pbutil.c pbutil.h - $(CC) -c -I. -I$(INCDIR) $(CFLAGS) pbutil.c + $(APP_CC) -c -I. -I$(INCDIR) $(CFLAGS) pbutil.c glxgears_fbconfig: glxgears_fbconfig.o pbutil.o - $(CC) -I$(INCDIR) $(CFLAGS) glxgears_fbconfig.o pbutil.o $(APP_LIB_DEPS) -o $@ + $(APP_CC) -I$(INCDIR) $(CFLAGS) glxgears_fbconfig.o pbutil.o $(APP_LIB_DEPS) -o $@ glxgears_fbconfig.o: glxgears_fbconfig.c pbutil.h - $(CC) -I$(INCDIR) $(CFLAGS) -c -I. $(CFLAGS) glxgears_fbconfig.c + $(APP_CC) -I$(INCDIR) $(CFLAGS) -c -I. $(CFLAGS) glxgears_fbconfig.c xrotfontdemo: xrotfontdemo.o xuserotfont.o - $(CC) -I$(INCDIR) $(CFLAGS) xrotfontdemo.o xuserotfont.o $(APP_LIB_DEPS) -o $@ + $(APP_CC) -I$(INCDIR) $(CFLAGS) xrotfontdemo.o xuserotfont.o $(APP_LIB_DEPS) -o $@ xuserotfont.o: xuserotfont.c xuserotfont.h - $(CC) -c -I. -I$(INCDIR) $(CFLAGS) xuserotfont.c + $(APP_CC) -c -I. -I$(INCDIR) $(CFLAGS) xuserotfont.c xrotfontdemo.o: xrotfontdemo.c xuserotfont.h - $(CC) -c -I. -I$(INCDIR) $(CFLAGS) xrotfontdemo.c + $(APP_CC) -c -I. -I$(INCDIR) $(CFLAGS) xrotfontdemo.c -- cgit v1.2.3