HOST_CC = $(CC)
CFLAGS = -O
CXXFLAGS = -O
+LDFLAGS =
GLU_CFLAGS =
+ # Compiler for building demos/tests/etc
+ APP_CC = $(CC)
+ APP_CXX = $(CXX)
+
# Misc tools and flags
+SHELL = /bin/sh
+MKLIB = $(SHELL) $(TOP)/bin/mklib
MKLIB_OPTIONS =
MKDEP = makedepend
MKDEP_OPTIONS = -fdepend
# make executable from .c file:
.c: $(LIB_DEP) readtex.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< readtex.o $(LIBS) -o $@
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $< readtex.o $(APP_LIB_DEPS) -o $@
++ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< readtex.o $(APP_LIB_DEPS) -o $@
##### TARGETS #####
reflect: reflect.o showbuffer.o readtex.o
- $(CC) $(CFLAGS) $(LDFLAGS) reflect.o showbuffer.o readtex.o $(LIBS) -o $@
- $(APP_CC) reflect.o showbuffer.o readtex.o $(APP_LIB_DEPS) $(ARCH_FLAGS) -o $@
++ $(APP_CC) $(CFLAGS) $(LDFLAGS) reflect.o showbuffer.o readtex.o $(LIBS) -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) $(CFLAGS) $(LDFLAGS) shadowtex.o showbuffer.o $(LIBS) -o $@
- $(APP_CC) shadowtex.o showbuffer.o $(APP_LIB_DEPS) $(ARCH_FLAGS) -o $@
++ $(APP_CC) $(CFLAGS) $(LDFLAGS) shadowtex.o showbuffer.o $(LIBS) -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) $(CFLAGS) $(LDFLAGS) gloss.o trackball.o readtex.o $(LIBS) -o $@
- $(APP_CC) gloss.o trackball.o readtex.o $(APP_LIB_DEPS) $(ARCH_FLAGS) -o $@
++ $(APP_CC) $(CFLAGS) $(LDFLAGS) gloss.o trackball.o readtex.o $(LIBS) -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) $(CFLAGS) $(LDFLAGS) engine.o trackball.o readtex.o $(LIBS) -o $@
- $(APP_CC) engine.o trackball.o readtex.o $(APP_LIB_DEPS) $(ARCH_FLAGS) -o $@
++ $(APP_CC) $(CFLAGS) $(LDFLAGS) engine.o trackball.o readtex.o $(LIBS) -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) $(CFLAGS) $(LDFLAGS) fslight.o $(LIBS) -o $@
- $(APP_CC) fslight.o $(APP_LIB_DEPS) $(ARCH_FLAGS) -o $@
++ $(APP_CC) $(CFLAGS) $(LDFLAGS) fslight.o $(LIBS) -o $@
fslight.o: fslight.c extfuncs.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) fslight.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) fslight.c
+rain: particles.o rain.o readtex.o
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
+
+rain.o: rain.cxx readtex.h
+ $(CXX) -c -I$(INCDIR) $(CXXFLAGS) $<
+
+particles.o: particles.cxx
+ $(CXX) -c -I$(INCDIR) $(CXXFLAGS) $<
+
+
+viewdds: viewdds.c
+ $(CC) -I$(INCDIR) $(CFLAGS) $< readtex.o $(LIBS) -L. -lgltc -o $@
clean:
# make executable from .c file:
.c: $(LIB_DEP)
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@
++ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
##### TARGETS #####
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
-bump.c: extfuncs.h
+shaderutil.c: $(TOP)/progs/util/shaderutil.c
+ cp $< .
+
+shaderutil.h: $(TOP)/progs/util/shaderutil.h
+ cp $< .
+
+shaderutil.o: shaderutil.c shaderutil.h
+ $(CC) -c -I$(INCDIR) $(CFLAGS) shaderutil.c
+
+
+
+bitmap.o: bitmap.c extfuncs.h shaderutil.h
+ $(CC) -c -I$(INCDIR) $(CFLAGS) bitmap.c
+
+bitmap: bitmap.o shaderutil.o
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bitmap.o shaderutil.o $(LIBS) -o $@
+
+
+brick.o: brick.c extfuncs.h shaderutil.h
+ $(CC) -c -I$(INCDIR) $(CFLAGS) brick.c
+
+brick: brick.o shaderutil.o
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) brick.o shaderutil.o $(LIBS) -o $@
+
+
+bump.o: bump.c extfuncs.h shaderutil.h
+ $(CC) -c -I$(INCDIR) $(CFLAGS) bump.c
+
+bump: bump.o shaderutil.o
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bump.o shaderutil.o $(LIBS) -o $@
+
+
+convolutions.o: convolutions.c readtex.h
+ $(CC) -c -I$(INCDIR) $(CFLAGS) convolutions.c
+
+convolutions: convolutions.o readtex.o
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) convolutions.o readtex.o $(LIBS) -o $@
+
+
+deriv.o: deriv.c extfuncs.h shaderutil.h
+ $(CC) -c -I$(INCDIR) $(CFLAGS) deriv.c
+
+deriv: deriv.o shaderutil.o
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) deriv.o shaderutil.o $(LIBS) -o $@
+
+
+mandelbrot.o: mandelbrot.c extfuncs.h shaderutil.h
+ $(CC) -c -I$(INCDIR) $(CFLAGS) mandelbrot.c
+
+mandelbrot: mandelbrot.o shaderutil.o
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) mandelbrot.o shaderutil.o $(LIBS) -o $@
+
-
+multitex.o: multitex.c extfuncs.h readtex.h shaderutil.h
+ $(CC) -c -I$(INCDIR) $(CFLAGS) multitex.c
+
+multitex: multitex.o readtex.o shaderutil.o
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) multitex.o readtex.o shaderutil.o $(LIBS) -o $@
+
+
+noise.o: noise.c extfuncs.h shaderutil.h
+ $(CC) -c -I$(INCDIR) $(CFLAGS) noise.c
+
+noise: noise.o shaderutil.o
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) noise.o shaderutil.o $(LIBS) -o $@
+
+
+points.o: points.c extfuncs.h shaderutil.h
+ $(CC) -c -I$(INCDIR) $(CFLAGS) points.c
+
+points: points.o shaderutil.o
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) points.o shaderutil.o $(LIBS) -o $@
+
+
+pointcoord.o: pointcoord.c readtex.h extfuncs.h shaderutil.h
+ $(CC) -c -I$(INCDIR) $(CFLAGS) pointcoord.c
+
+pointcoord: pointcoord.o readtex.o shaderutil.o
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) pointcoord.o readtex.o shaderutil.o $(LIBS) -o $@
+
+
+texdemo1.o: texdemo1.c readtex.h extfuncs.h shaderutil.h
+ $(CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c
+
+texdemo1: texdemo1.o readtex.o shaderutil.o
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) texdemo1.o readtex.o shaderutil.o $(LIBS) -o $@
+
+
+toyball.o: toyball.c extfuncs.h shaderutil.h
+ $(CC) -c -I$(INCDIR) $(CFLAGS) toyball.c
+
+toyball: toyball.o shaderutil.o
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) toyball.o shaderutil.o $(LIBS) -o $@
+
+
+twoside.o: twoside.c extfuncs.h shaderutil.h
+ $(CC) -c -I$(INCDIR) $(CFLAGS) twoside.c
+
+twoside: twoside.o shaderutil.o
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) twoside.o shaderutil.o $(LIBS) -o $@
-mandelbrot.c: extfuncs.h
-toyball.c: extfuncs.h
+trirast.o: trirast.c extfuncs.h shaderutil.h
+ $(CC) -c -I$(INCDIR) $(CFLAGS) trirast.c
-texdemo1: texdemo1.o readtex.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) texdemo1.o readtex.o $(APP_LIB_DEPS) -o $@
+trirast: trirast.o shaderutil.o
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) trirast.o shaderutil.o $(LIBS) -o $@
-texdemo1.o: texdemo1.c readtex.h extfuncs.h
- $(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:
.SUFFIXES: .c
.c: $(LIB_DEP)
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@
++ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
.SUFFIXES: .c
.c: $(LIB_DEP)
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@
++ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
##### TARGETS #####
sphere: sphere.o readtex.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) sphere.o readtex.o $(LIBS) -o $@
- $(APP_CC) -I$(INCDIR) $(CFLAGS) sphere.o readtex.o $(APP_LIB_DEPS) -o $@
++ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) sphere.o readtex.o $(LIBS) -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 $< .
.SUFFIXES: .c
.c:
- $(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
- $(APP_CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@
++ $(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(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 #####
-
-default: $(UTIL_FILES) $(PROGS)
-
-clean:
- rm -f $(PROGS)
- rm -f *.o
- rm -f getproclist.h
-
-
# auto code generation
getprocaddress: getprocaddress.c getproclist.h
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) arraytexture.c -o $@
- $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
++ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) arraytexture.c -o $@
afsmultiarb: afsmultiarb.o readtex.o
- $(CC) $(CFLAGS) $(LDFLAGS) afsmultiarb.o readtex.o $(LIBS) -o $@
- $(APP_CC) $(CFLAGS) afsmultiarb.o readtex.o $(LIBS) -o $@
++ $(APP_CC) $(CFLAGS) $(LDFLAGS) afsmultiarb.o readtex.o $(LIBS) -o $@
afsmultiarb.o: afsmultiarb.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) afsmultiarb.c -o $@
- $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
++ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) afsmultiarb.c -o $@
drawbuffers: drawbuffers.o
- $(CC) $(CFLAGS) $(LDFLAGS) drawbuffers.o $(LIBS) -o $@
- $(APP_CC) $(CFLAGS) drawbuffers.o $(LIBS) -o $@
++ $(APP_CC) $(CFLAGS) $(LDFLAGS) drawbuffers.o $(LIBS) -o $@
drawbuffers.o: drawbuffers.c extfuncs.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) drawbuffers.c -o $@
- $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
++ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) drawbuffers.c -o $@
texrect: texrect.o readtex.o
- $(CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
- $(APP_CC) $(CFLAGS) texrect.o readtex.o $(LIBS) -o $@
++ $(APP_CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
texrect.o: texrect.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) texrect.c -o $@
- $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
++ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) texrect.c -o $@
bug_3195: bug_3195.o readtex.o
- $(CC) $(CFLAGS) $(LDFLAGS) bug_3195.o readtex.o $(LIBS) -o $@
- $(APP_CC) $(CFLAGS) bug_3195.o readtex.o $(LIBS) -o $@
++ $(APP_CC) $(CFLAGS) $(LDFLAGS) bug_3195.o readtex.o $(LIBS) -o $@
bug_3195.o: bug_3195.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) bug_3195.c -o $@
- $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
++ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) bug_3195.c -o $@
invert: invert.o readtex.o
- $(CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
- $(APP_CC) $(CFLAGS) invert.o readtex.o $(LIBS) -o $@
++ $(APP_CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
invert.o: invert.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) invert.c -o $@
- $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
++ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) invert.c -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
readtex.o: readtex.c
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) readtex.c -o $@
- $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
++ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) readtex.c -o $@
readtex.h: $(TOP)/progs/util/readtex.h
.SUFFIXES: .c
.c:
- $(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
- $(APP_CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@
++ $(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(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 #####
texrect: texrect.o readtex.o
- $(CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
- $(APP_CC) texrect.o readtex.o $(LIBS) -o $@
++ $(APP_CC) $(CFLAGS) $(LDFLAGS) 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) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
- $(APP_CC) invert.o readtex.o $(LIBS) -o $@
++ $(APP_CC) $(CFLAGS) $(LDFLAGS) 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
.SUFFIXES: .c
.c: $(LIB_DEP)
- $(CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@
++ $(APP_CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
##### TARGETS #####
# special cases
pbinfo: pbinfo.o pbutil.o
- $(CC) $(CFLAGS) $(LDFLAGS) pbinfo.o pbutil.o $(LIBS) -o $@
- $(APP_CC) -I$(INCDIR) $(CFLAGS) pbinfo.o pbutil.o $(APP_LIB_DEPS) -o $@
++ $(APP_CC) $(CFLAGS) $(LDFLAGS) pbinfo.o pbutil.o $(LIBS) -o $@
pbdemo: pbdemo.o pbutil.o
- $(CC) $(CFLAGS) $(LDFLAGS) pbdemo.o pbutil.o $(LIBS) -o $@
- $(APP_CC) -I$(INCDIR) $(CFLAGS) pbdemo.o pbutil.o $(APP_LIB_DEPS) -o $@
++ $(APP_CC) $(CFLAGS) $(LDFLAGS) pbdemo.o pbutil.o $(LIBS) -o $@
pbinfo.o: pbinfo.c pbutil.h
- $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbinfo.c
- $(APP_CC) -c -I. -I$(INCDIR) $(CFLAGS) pbinfo.c
++ $(APP_CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbinfo.c
pbdemo.o: pbdemo.c pbutil.h
- $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbdemo.c
- $(APP_CC) -c -I. -I$(INCDIR) $(CFLAGS) pbdemo.c
++ $(APP_CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbdemo.c
pbutil.o: pbutil.c pbutil.h
- $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbutil.c
- $(APP_CC) -c -I. -I$(INCDIR) $(CFLAGS) pbutil.c
++ $(APP_CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbutil.c
glxgears_fbconfig: glxgears_fbconfig.o pbutil.o
- $(CC) $(CFLAGS) $(LDFLAGS) glxgears_fbconfig.o pbutil.o $(LIBS) -o $@
- $(APP_CC) -I$(INCDIR) $(CFLAGS) glxgears_fbconfig.o pbutil.o $(APP_LIB_DEPS) -o $@
++ $(APP_CC) $(CFLAGS) $(LDFLAGS) glxgears_fbconfig.o pbutil.o $(LIBS) -o $@
glxgears_fbconfig.o: glxgears_fbconfig.c pbutil.h
- $(CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) -c -I. $(CFLAGS) glxgears_fbconfig.c
- $(APP_CC) -I$(INCDIR) $(CFLAGS) -c -I. $(CFLAGS) glxgears_fbconfig.c
++ $(APP_CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) -c -I. $(CFLAGS) glxgears_fbconfig.c
xrotfontdemo: xrotfontdemo.o xuserotfont.o
- $(CC) $(CFLAGS) $(LDFLAGS) xrotfontdemo.o xuserotfont.o $(LIBS) -o $@
- $(APP_CC) -I$(INCDIR) $(CFLAGS) xrotfontdemo.o xuserotfont.o $(APP_LIB_DEPS) -o $@
++ $(APP_CC) $(CFLAGS) $(LDFLAGS) xrotfontdemo.o xuserotfont.o $(LIBS) -o $@
xuserotfont.o: xuserotfont.c xuserotfont.h
- $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) xuserotfont.c
- $(APP_CC) -c -I. -I$(INCDIR) $(CFLAGS) xuserotfont.c
++ $(APP_CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) xuserotfont.c
xrotfontdemo.o: xrotfontdemo.c xuserotfont.h
- $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) xrotfontdemo.c
- $(APP_CC) -c -I. -I$(INCDIR) $(CFLAGS) xrotfontdemo.c
++ $(APP_CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) xrotfontdemo.c
+
+corender: corender.o ipc.o
- $(CC) $(CFLAGS) corender.o ipc.o $(LIBS) -o $@
++ $(APP_CC) $(CFLAGS) corender.o ipc.o $(LIBS) -o $@
+
+corender.o: corender.c ipc.h
- $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) corender.c
++ $(APP_CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) corender.c
+
+ipc.o: ipc.c ipc.h
- $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) ipc.c
++ $(APP_CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) ipc.c
+
+yuvrect_client: yuvrect_client.c
- $(CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -l$(GLU_LIB) -o $@
++ $(APP_CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -l$(GLU_LIB) -o $@
/* override the default array set above */
exec->vtx.inputs[attr] = &arrays[attr];
- arrays[attr].Ptr = (void *)data;
+ if (exec->vtx.bufferobj->Name) {
+ /* a real buffer obj: Ptr is an offset, not a pointer*/
+ int offset;
+ assert(exec->vtx.bufferobj->Pointer); /* buf should be mapped */
+ offset = (GLbyte *) data - (GLbyte *) exec->vtx.bufferobj->Pointer;
+ assert(offset >= 0);
+ arrays[attr].Ptr = (void *) offset;
+ }
+ else {
+ /* Ptr into ordinary app memory */
+ arrays[attr].Ptr = (void *) data;
+ }
++
arrays[attr].Size = exec->vtx.attrsz[src];
arrays[attr].StrideB = exec->vtx.vertex_size * sizeof(GLfloat);
arrays[attr].Stride = exec->vtx.vertex_size * sizeof(GLfloat);