summaryrefslogtreecommitdiff
path: root/progs/osdemos
diff options
context:
space:
mode:
Diffstat (limited to 'progs/osdemos')
-rw-r--r--progs/osdemos/Makefile24
-rw-r--r--progs/osdemos/ostest1.c7
2 files changed, 21 insertions, 10 deletions
diff --git a/progs/osdemos/Makefile b/progs/osdemos/Makefile
index f8cba9ee99..023ea02ae2 100644
--- a/progs/osdemos/Makefile
+++ b/progs/osdemos/Makefile
@@ -5,13 +5,19 @@ include $(TOP)/configs/current
INCDIR = $(TOP)/include
-OSMESA_LIBS = -L$(TOP)/$(LIB_DIR) -lOSMesa $(APP_LIB_DEPS)
+OSMESA_LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(OSMESA_LIB) $(APP_LIB_DEPS)
-OSMESA16_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa16 -lGLU -lGL $(APP_LIB_DEPS)
+OSMESA16_LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -lOSMesa16 -l$(GLU_LIB) \
+ -l$(GL_LIB) $(APP_LIB_DEPS)
-OSMESA32_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa32 -lGLU -lGL $(APP_LIB_DEPS)
+OSMESA32_LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -lOSMesa32 -l$(GLU_LIB) \
+ -l$(GL_LIB) $(APP_LIB_DEPS)
-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 = \
osdemo \
@@ -26,7 +32,7 @@ PROGS = \
# make executable from .c file:
.c: $(LIB_DEP) readtex.o
- $(CC) -I$(INCDIR) $(CFLAGS) $< readtex.o $(APP_LIB_DEPS) -o $@
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< readtex.o $(LIBS) -o $@
##### TARGETS #####
@@ -56,19 +62,19 @@ showbuffer.o: showbuffer.c showbuffer.h
# special case: need the -lOSMesa library:
osdemo: osdemo.c
- $(CC) -I$(INCDIR) $(CFLAGS) osdemo.c $(OSMESA_LIBS) -o $@
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) osdemo.c $(OSMESA_LIBS) -o $@
# special case: need the -lOSMesa library:
ostest1: ostest1.c
- $(CC) -I$(INCDIR) $(CFLAGS) ostest1.c $(OSMESA_LIBS) -o $@
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) ostest1.c $(OSMESA_LIBS) -o $@
# another special case: need the -lOSMesa16 library:
osdemo16: osdemo16.c
- $(CC) -I$(INCDIR) $(CFLAGS) osdemo16.c $(OSMESA16_LIBS) -o $@
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) osdemo16.c $(OSMESA16_LIBS) -o $@
# another special case: need the -lOSMesa32 library:
osdemo32: osdemo32.c
- $(CC) -I$(INCDIR) $(CFLAGS) osdemo32.c $(OSMESA32_LIBS) -o $@
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) osdemo32.c $(OSMESA32_LIBS) -o $@
diff --git a/progs/osdemos/ostest1.c b/progs/osdemos/ostest1.c
index 2c7adfc353..000b8c4a78 100644
--- a/progs/osdemos/ostest1.c
+++ b/progs/osdemos/ostest1.c
@@ -407,7 +407,10 @@ test(GLenum type, GLint bits, const char *filename)
glGetIntegerv(GL_ALPHA_BITS, &cBits);
assert(cBits == bits);
- printf("Rendering %d bit/channel image: %s\n", bits, filename);
+ if (WriteFiles)
+ printf("Rendering %d bit/channel image: %s\n", bits, filename);
+ else
+ printf("Rendering %d bit/channel image\n", bits);
OSMesaColorClamp(GL_TRUE);
@@ -458,6 +461,8 @@ main( int argc, char *argv[] )
{
int i;
+ printf("Use -f to write image files\n");
+
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-f") == 0)
WriteFiles = GL_TRUE;