diff options
Diffstat (limited to 'progs/glsl/Makefile')
-rw-r--r-- | progs/glsl/Makefile | 259 |
1 files changed, 70 insertions, 189 deletions
diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile index 6ba24feade..8103a5cbca 100644 --- a/progs/glsl/Makefile +++ b/progs/glsl/Makefile @@ -5,55 +5,86 @@ 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) - -LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) - -PROGS = \ - bitmap \ - brick \ - bump \ - convolutions \ - deriv \ - fragcoord \ - mandelbrot \ - multinoise \ - multitex \ - noise \ - points \ - pointcoord \ - samplers \ - skinning \ - texdemo1 \ - toyball \ - twoside \ - trirast \ - vert-or-frag-only \ - vert-tex - - -##### RULES ##### - -.SUFFIXES: -.SUFFIXES: .c - - -# make executable from .c file: -.c: $(LIB_DEP) - $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@ - +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$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) + +INCLUDE_DIRS = -I$(TOP)/progs/util + +# using : to avoid APP_CC pointing to CC loop +CC:=$(APP_CC) +CFLAGS += -I$(INCDIR) +LDLIBS=$(LIBS) + +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 \ + samplers_array.c \ + shadow_sampler.c \ + shtest.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) +PROG_OBJS = $(DEMO_SOURCES:.c=.o) +PROGS = $(DEMO_SOURCES:%.c=%) ##### TARGETS ##### default: $(PROGS) +$(PROG_OBJS): $(UTIL_HEADERS) + +$(PROGS): $(UTIL_OBJS) + +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 - cp $< . +samplers_array.o: samplers.c + $(APP_CC) $(CFLAGS) -DSAMPLERS_ARRAY $< -c -o $@ +extfuncs.h: $(TOP)/progs/util/extfuncs.h + cp $< . readtex.c: $(TOP)/progs/util/readtex.c cp $< . @@ -61,159 +92,9 @@ readtex.c: $(TOP)/progs/util/readtex.c readtex.h: $(TOP)/progs/util/readtex.h cp $< . -readtex.o: readtex.c readtex.h - $(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 - $(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 $@ - - -fragcoord.o: fragcoord.c extfuncs.h shaderutil.h - $(CC) -c -I$(INCDIR) $(CFLAGS) fragcoord.c - -fragcoord: fragcoord.o shaderutil.o - $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) fragcoord.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 $@ - - -samplers.o: samplers.c readtex.h extfuncs.h shaderutil.h - $(CC) -c -I$(INCDIR) $(CFLAGS) samplers.c - -samplers: samplers.o readtex.o shaderutil.o - $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) samplers.o readtex.o shaderutil.o $(LIBS) -o $@ - - -skinning.o: skinning.c readtex.h extfuncs.h shaderutil.h - $(CC) -c -I$(INCDIR) $(CFLAGS) skinning.c - -skinning: skinning.o readtex.o shaderutil.o - $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) skinning.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 $@ - - -trirast.o: trirast.c extfuncs.h shaderutil.h - $(CC) -c -I$(INCDIR) $(CFLAGS) trirast.c - -trirast: trirast.o shaderutil.o - $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) trirast.o shaderutil.o $(LIBS) -o $@ - - -vert-or-frag-only.o: vert-or-frag-only.c extfuncs.h shaderutil.h - $(CC) -c -I$(INCDIR) $(CFLAGS) vert-or-frag-only.c - -vert-or-frag-only: vert-or-frag-only.o shaderutil.o - $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-or-frag-only.o shaderutil.o $(LIBS) -o $@ - - - -vert-tex.o: vert-tex.c extfuncs.h shaderutil.h - $(CC) -c -I$(INCDIR) $(CFLAGS) vert-tex.c - -vert-tex: vert-tex.o shaderutil.o - $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-tex.o shaderutil.o $(LIBS) -o $@ - - - - -clean: - -rm -f $(PROGS) - -rm -f *.o *~ - -rm -f extfuncs.h - -rm -f shaderutil.* |