summaryrefslogtreecommitdiffstats
path: root/progs/glsl/Makefile
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-04-18 14:18:59 -0600
committerBrian Paul <brianp@vmware.com>2009-04-18 14:18:59 -0600
commitc0565e86b4d4375ed52b20d9464daace616b50a8 (patch)
tree4bb87545853ab291574d86fbb475b5b68e1a84e1 /progs/glsl/Makefile
parent3595732f28b0b8fdca1724305f8e6f3377f1e7fe (diff)
downloadexternal_mesa3d-c0565e86b4d4375ed52b20d9464daace616b50a8.zip
external_mesa3d-c0565e86b4d4375ed52b20d9464daace616b50a8.tar.gz
external_mesa3d-c0565e86b4d4375ed52b20d9464daace616b50a8.tar.bz2
demos: added glsl/texaaline.c program and overhaul the Makefile
Diffstat (limited to 'progs/glsl/Makefile')
-rw-r--r--progs/glsl/Makefile278
1 files changed, 130 insertions, 148 deletions
diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile
index 8e61ab6..71db895 100644
--- a/progs/glsl/Makefile
+++ b/progs/glsl/Makefile
@@ -5,48 +5,69 @@ include $(TOP)/configs/current
INCDIR = $(TOP)/include
-LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
+LIB_DEP = \
+ $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) \
+ $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) \
+ $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
-PROGS = \
- array \
- bitmap \
- brick \
- bump \
- convolutions \
- deriv \
- identity \
- fragcoord \
- linktest \
- mandelbrot \
- multinoise \
- multitex \
- noise \
- noise2 \
- points \
- pointcoord \
- samplers \
- samplers_array \
- shadow_sampler \
- skinning \
- texdemo1 \
- toyball \
- twoside \
- trirast \
- vert-or-frag-only \
- vert-tex
+INCLUDE_DIRS = -I$(TOP)/progs/util
+
+DEMO_SOURCES = \
+ array.c \
+ bitmap.c \
+ brick.c \
+ bump.c \
+ convolutions.c \
+ deriv.c \
+ fragcoord.c \
+ identity.c \
+ linktest.c \
+ mandelbrot.c \
+ multinoise.c \
+ multitex.c \
+ noise.c \
+ noise2.c \
+ pointcoord.c \
+ points.c \
+ samplers.c \
+ shadow_sampler.c \
+ skinning.c \
+ texaaline.c \
+ texdemo1.c \
+ toyball.c \
+ trirast.c \
+ twoside.c \
+ vert-or-frag-only.c \
+ vert-tex.c
+
+UTIL_HEADERS = \
+ extfuncs.h \
+ shaderutil.h \
+ readtex.h
+
+UTIL_SOURCES = \
+ shaderutil.c \
+ readtex.c
+
+UTIL_OBJS = $(UTIL_SOURCES:.c=.o)
+
+
+PROGS = $(DEMO_SOURCES:%.c=%)
+
##### RULES #####
-.SUFFIXES:
-.SUFFIXES: .c
+# make .o file from .c file:
+.c.o:
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) $< -o $@
-# make executable from .c file:
-.c: $(LIB_DEP)
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
+# make executable from .o files
+.o:
+ $(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(UTIL_OBJS) $(LIBS) -o $@
##### TARGETS #####
@@ -54,202 +75,163 @@ PROGS = \
default: $(PROGS)
+clean:
+ -rm -f $(PROGS)
+ -rm -f *.o *~
+ -rm -f extfuncs.h
+ -rm -f shaderutil.*
+
+
##### Extra dependencies
-extfuncs.h: $(TOP)/progs/util/extfuncs.h
- cp $< .
+extfuncs.h:
+ cp $(TOP)/progs/util/extfuncs.h .
+readtex.c:
+ cp $(TOP)/progs/util/readtex.c .
-readtex.c: $(TOP)/progs/util/readtex.c
- cp $< .
+readtex.h:
+ cp $(TOP)/progs/util/readtex.h .
-readtex.h: $(TOP)/progs/util/readtex.h
- cp $< .
+shaderutil.c:
+ cp $(TOP)/progs/util/shaderutil.c .
-readtex.o: readtex.c readtex.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) readtex.c
+shaderutil.h:
+ cp $(TOP)/progs/util/shaderutil.h .
-shaderutil.c: $(TOP)/progs/util/shaderutil.c
- cp $< .
-shaderutil.h: $(TOP)/progs/util/shaderutil.h
- cp $< .
+array.o: $(UTIL_HEADERS)
-shaderutil.o: shaderutil.c shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) shaderutil.c
+array: array.o $(UTIL_OBJS)
+bitmap.o: $(UTIL_HEADERS)
-array.o: array.c extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) array.c
+bitmap: bitmap.o $(UTIL_OBJS)
-array: array.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) array.o shaderutil.o $(LIBS) -o $@
+brick.o: $(UTIL_HEADERS)
-bitmap.o: bitmap.c extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) bitmap.c
+brick: brick.o $(UTIL_OBJS)
-bitmap: bitmap.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bitmap.o shaderutil.o $(LIBS) -o $@
+bump.o: $(UTIL_HEADERS)
-brick.o: brick.c extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) brick.c
+bump: bump.o $(UTIL_OBJS)
-brick: brick.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) brick.o shaderutil.o $(LIBS) -o $@
+convolutions.o: $(UTIL_HEADERS)
-bump.o: bump.c extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) bump.c
+convolutions: convolutions.o $(UTIL_OBJS)
-bump: bump.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bump.o shaderutil.o $(LIBS) -o $@
+deriv.o: deriv.c $(UTIL_HEADERS)
-convolutions.o: convolutions.c readtex.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) convolutions.c
+deriv: deriv.o $(UTIL_OBJS)
-convolutions: convolutions.o readtex.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) convolutions.o readtex.o $(LIBS) -o $@
+identity.o: $(UTIL_HEADERS)
-deriv.o: deriv.c extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) deriv.c
+identity: identity.o $(UTIL_OBJS)
-deriv: deriv.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) deriv.o shaderutil.o $(LIBS) -o $@
+fragcoord.o: $(UTIL_HEADERS)
-identity.o: identity.c extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) identity.c
+fragcoord: fragcoord.o $(UTIL_OBJS)
-identity: identity.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) identity.o shaderutil.o $(LIBS) -o $@
+linktest.o: $(UTIL_HEADERS)
-fragcoord.o: fragcoord.c extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) fragcoord.c
+linktest: linktest.o $(UTIL_OBJS)
-fragcoord: fragcoord.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) fragcoord.o shaderutil.o $(LIBS) -o $@
+mandelbrot.o: $(UTIL_HEADERS)
-linktest.o: linktest.c extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) linktest.c
+mandelbrot: mandelbrot.o $(UTIL_OBJS)
-linktest: linktest.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) linktest.o shaderutil.o $(LIBS) -o $@
-mandelbrot.o: mandelbrot.c extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) mandelbrot.c
+multinoise.o: $(UTIL_HEADERS)
-mandelbrot: mandelbrot.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) mandelbrot.o shaderutil.o $(LIBS) -o $@
+multinoise: multinoise.o $(UTIL_OBJS)
-multitex.o: multitex.c extfuncs.h readtex.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) multitex.c
-multitex: multitex.o readtex.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) multitex.o readtex.o shaderutil.o $(LIBS) -o $@
+multitex.o: $(UTIL_HEADERS)
+multitex: multitex.o $(UTIL_OBJS)
-noise.o: noise.c extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) noise.c
-noise: noise.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) noise.o shaderutil.o $(LIBS) -o $@
+noise.o: $(UTIL_HEADERS)
+noise: noise.o $(UTIL_OBJS)
-noise2.o: noise2.c extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) noise2.c
-noise2: noise2.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) noise2.o shaderutil.o $(LIBS) -o $@
+noise2.o: $(UTIL_HEADERS)
+noise2: noise2.o $(UTIL_OBJS)
-points.o: points.c extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) points.c
-points: points.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) points.o shaderutil.o $(LIBS) -o $@
+points.o: $(UTIL_HEADERS)
+points: points.o $(UTIL_OBJS)
-pointcoord.o: pointcoord.c readtex.h extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) pointcoord.c
-pointcoord: pointcoord.o readtex.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) pointcoord.o readtex.o shaderutil.o $(LIBS) -o $@
+pointcoord.o: $(UTIL_HEADERS)
+pointcoord: pointcoord.o $(UTIL_OBJS)
-samplers.o: samplers.c readtex.h extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) samplers.c
-samplers: samplers.o readtex.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) samplers.o readtex.o shaderutil.o $(LIBS) -o $@
+samplers.o: $(UTIL_HEADERS)
-samplers_array.o: samplers.c readtex.h extfuncs.h shaderutil.h
- $(APP_CC) -c -DSAMPLERS_ARRAY -I$(INCDIR) $(CFLAGS) samplers.c -o samplers_array.o
+samplers: samplers.o $(UTIL_OBJS)
-samplers_array: samplers_array.o readtex.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) samplers_array.o readtex.o shaderutil.o $(LIBS) -o $@
-skinning.o: skinning.c readtex.h extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) skinning.c
+samplers_array.o: $(UTIL_HEADERS)
-skinning: skinning.o readtex.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) skinning.o readtex.o shaderutil.o $(LIBS) -o $@
+samplers_array: samplers_array.o $(UTIL_OBJS)
-texdemo1.o: texdemo1.c readtex.h extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c
+shadow_sampler.o: $(UTIL_HEADERS)
-texdemo1: texdemo1.o readtex.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) texdemo1.o readtex.o shaderutil.o $(LIBS) -o $@
+shadow_sampler: shadow_sampler.o $(UTIL_OBJS)
-toyball.o: toyball.c extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) toyball.c
+skinning.o: $(UTIL_HEADERS)
-toyball: toyball.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) toyball.o shaderutil.o $(LIBS) -o $@
+skinning: skinning.o $(UTIL_OBJS)
-twoside.o: twoside.c extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) twoside.c
+texaaline.o: $(UTIL_HEADERS)
-twoside: twoside.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) twoside.o shaderutil.o $(LIBS) -o $@
+texaaline: texaaline.o $(UTIL_OBJS)
-trirast.o: trirast.c extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) trirast.c
+texdemo1.o: $(UTIL_HEADERS)
-trirast: trirast.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) trirast.o shaderutil.o $(LIBS) -o $@
+texdemo1: texdemo1.o $(UTIL_OBJS)
-vert-or-frag-only.o: vert-or-frag-only.c extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) vert-or-frag-only.c
+toyball.o: $(UTIL_HEADERS)
-vert-or-frag-only: vert-or-frag-only.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-or-frag-only.o shaderutil.o $(LIBS) -o $@
+toyball: toyball.o $(UTIL_OBJS)
-vert-tex.o: vert-tex.c extfuncs.h shaderutil.h
- $(APP_CC) -c -I$(INCDIR) $(CFLAGS) vert-tex.c
+twoside.o: $(UTIL_HEADERS)
-vert-tex: vert-tex.o shaderutil.o
- $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-tex.o shaderutil.o $(LIBS) -o $@
+twoside: twoside.o $(UTIL_OBJS)
+trirast.o: $(UTIL_HEADERS)
+trirast: trirast.o $(UTIL_OBJS)
-clean:
- -rm -f $(PROGS)
- -rm -f *.o *~
- -rm -f extfuncs.h
- -rm -f shaderutil.*
+
+vert-or-frag-only.o: $(UTIL_HEADERS)
+
+vert-or-frag-only: vert-or-frag-only.o $(UTIL_OBJS)
+
+
+vert-tex.o: $(UTIL_HEADERS)
+
+vert-tex: vert-tex.o $(UTIL_OBJS)