diff options
Diffstat (limited to 'progs/glsl/Makefile')
-rw-r--r-- | progs/glsl/Makefile | 263 |
1 files changed, 131 insertions, 132 deletions
diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile index 0f1a299570f..f97cdb69429 100644 --- a/progs/glsl/Makefile +++ b/progs/glsl/Makefile @@ -5,46 +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 = \ - bitmap \ - brick \ - bump \ - convolutions \ - deriv \ - identity \ - fragcoord \ - linktest \ - mandelbrot \ - multinoise \ - multitex \ - noise \ - 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 ##### @@ -52,188 +75,164 @@ PROGS = \ default: $(PROGS) +clean: + -rm -f $(PROGS) + -rm -f *.o *~ + -rm -f extfuncs.h + -rm -f shaderutil.* + -rm -f readtex.* + + ##### Extra dependencies -extfuncs.h: $(TOP)/progs/util/extfuncs.h +extfuncs.h: $(TOP)/progs/util/extfuncs.h cp $< . - readtex.c: $(TOP)/progs/util/readtex.c cp $< . readtex.h: $(TOP)/progs/util/readtex.h cp $< . -readtex.o: readtex.c readtex.h - $(APP_CC) -c -I$(INCDIR) $(CFLAGS) readtex.c - - shaderutil.c: $(TOP)/progs/util/shaderutil.c cp $< . shaderutil.h: $(TOP)/progs/util/shaderutil.h cp $< . -shaderutil.o: shaderutil.c shaderutil.h - $(APP_CC) -c -I$(INCDIR) $(CFLAGS) shaderutil.c +array.o: $(UTIL_HEADERS) -bitmap.o: bitmap.c extfuncs.h shaderutil.h - $(APP_CC) -c -I$(INCDIR) $(CFLAGS) bitmap.c +array: array.o $(UTIL_OBJS) -bitmap: bitmap.o shaderutil.o - $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bitmap.o shaderutil.o $(LIBS) -o $@ +bitmap.o: $(UTIL_HEADERS) -brick.o: brick.c extfuncs.h shaderutil.h - $(APP_CC) -c -I$(INCDIR) $(CFLAGS) brick.c +bitmap: bitmap.o $(UTIL_OBJS) -brick: brick.o shaderutil.o - $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) brick.o shaderutil.o $(LIBS) -o $@ +brick.o: $(UTIL_HEADERS) -bump.o: bump.c extfuncs.h shaderutil.h - $(APP_CC) -c -I$(INCDIR) $(CFLAGS) bump.c +brick: brick.o $(UTIL_OBJS) -bump: bump.o shaderutil.o - $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bump.o shaderutil.o $(LIBS) -o $@ +bump.o: $(UTIL_HEADERS) -convolutions.o: convolutions.c readtex.h - $(APP_CC) -c -I$(INCDIR) $(CFLAGS) convolutions.c +bump: bump.o $(UTIL_OBJS) -convolutions: convolutions.o readtex.o - $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) convolutions.o readtex.o $(LIBS) -o $@ +convolutions.o: $(UTIL_HEADERS) -deriv.o: deriv.c extfuncs.h shaderutil.h - $(APP_CC) -c -I$(INCDIR) $(CFLAGS) deriv.c +convolutions: convolutions.o $(UTIL_OBJS) -deriv: deriv.o shaderutil.o - $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) deriv.o shaderutil.o $(LIBS) -o $@ +deriv.o: deriv.c $(UTIL_HEADERS) -identity.o: identity.c extfuncs.h shaderutil.h - $(APP_CC) -c -I$(INCDIR) $(CFLAGS) identity.c +deriv: deriv.o $(UTIL_OBJS) -identity: identity.o shaderutil.o - $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) identity.o shaderutil.o $(LIBS) -o $@ +identity.o: $(UTIL_HEADERS) -fragcoord.o: fragcoord.c extfuncs.h shaderutil.h - $(APP_CC) -c -I$(INCDIR) $(CFLAGS) fragcoord.c +identity: identity.o $(UTIL_OBJS) -fragcoord: fragcoord.o shaderutil.o - $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) fragcoord.o shaderutil.o $(LIBS) -o $@ +fragcoord.o: $(UTIL_HEADERS) -linktest.o: linktest.c extfuncs.h shaderutil.h - $(APP_CC) -c -I$(INCDIR) $(CFLAGS) linktest.c +fragcoord: fragcoord.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 +linktest.o: $(UTIL_HEADERS) -mandelbrot: mandelbrot.o shaderutil.o - $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) mandelbrot.o shaderutil.o $(LIBS) -o $@ +linktest: linktest.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 $@ +mandelbrot.o: $(UTIL_HEADERS) +mandelbrot: mandelbrot.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 $@ +multinoise.o: $(UTIL_HEADERS) +multinoise: multinoise.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 $@ +multitex.o: $(UTIL_HEADERS) +multitex: multitex.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 $@ +noise.o: $(UTIL_HEADERS) +noise: noise.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 $@ +noise2.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 +noise2: noise2.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 +points.o: $(UTIL_HEADERS) -skinning: skinning.o readtex.o shaderutil.o - $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) skinning.o readtex.o shaderutil.o $(LIBS) -o $@ +points: points.o $(UTIL_OBJS) -texdemo1.o: texdemo1.c readtex.h extfuncs.h shaderutil.h - $(APP_CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c +pointcoord.o: $(UTIL_HEADERS) -texdemo1: texdemo1.o readtex.o shaderutil.o - $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) texdemo1.o readtex.o shaderutil.o $(LIBS) -o $@ +pointcoord: pointcoord.o $(UTIL_OBJS) -toyball.o: toyball.c extfuncs.h shaderutil.h - $(APP_CC) -c -I$(INCDIR) $(CFLAGS) toyball.c +samplers.o: $(UTIL_HEADERS) -toyball: toyball.o shaderutil.o - $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) toyball.o shaderutil.o $(LIBS) -o $@ +samplers: samplers.o $(UTIL_OBJS) -twoside.o: twoside.c extfuncs.h shaderutil.h - $(APP_CC) -c -I$(INCDIR) $(CFLAGS) twoside.c +samplers_array.o: $(UTIL_HEADERS) -twoside: twoside.o shaderutil.o - $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) twoside.o shaderutil.o $(LIBS) -o $@ +samplers_array: samplers_array.o $(UTIL_OBJS) -trirast.o: trirast.c extfuncs.h shaderutil.h - $(APP_CC) -c -I$(INCDIR) $(CFLAGS) trirast.c +shadow_sampler.o: $(UTIL_HEADERS) -trirast: trirast.o shaderutil.o - $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) trirast.o shaderutil.o $(LIBS) -o $@ +shadow_sampler: shadow_sampler.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 +skinning.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 $@ +skinning: skinning.o $(UTIL_OBJS) -vert-tex.o: vert-tex.c extfuncs.h shaderutil.h - $(APP_CC) -c -I$(INCDIR) $(CFLAGS) vert-tex.c +texaaline.o: $(UTIL_HEADERS) -vert-tex: vert-tex.o shaderutil.o - $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-tex.o shaderutil.o $(LIBS) -o $@ +texaaline: texaaline.o $(UTIL_OBJS) +texdemo1.o: $(UTIL_HEADERS) +texdemo1: texdemo1.o $(UTIL_OBJS) -clean: - -rm -f $(PROGS) - -rm -f *.o *~ - -rm -f extfuncs.h - -rm -f shaderutil.* + +toyball.o: $(UTIL_HEADERS) + +toyball: toyball.o $(UTIL_OBJS) + + +twoside.o: $(UTIL_HEADERS) + +twoside: twoside.o $(UTIL_OBJS) + + +trirast.o: $(UTIL_HEADERS) + +trirast: trirast.o $(UTIL_OBJS) + + +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) |