fix using a tmp without asking for one
[mesa.git] / progs / osdemos / Makefile
1 # progs/demos/Makefile
2
3 TOP = ../..
4 include $(TOP)/configs/current
5
6 INCDIR = $(TOP)/include
7
8 OSMESA_LIBS = -L$(LIB_DIR) -lglut -lOSMesa -lGLU -lGL $(APP_LIB_DEPS)
9
10 OSMESA16_LIBS = -L$(LIB_DIR) -lglut -lOSMesa16 -lGLU -lGL $(APP_LIB_DEPS)
11
12 OSMESA32_LIBS = -L$(LIB_DIR) -lglut -lOSMesa32 -lGLU -lGL $(APP_LIB_DEPS)
13
14 LIB_DEP = $(LIB_DIR)/$(GL_LIB_NAME) $(LIB_DIR)/$(GLU_LIB_NAME) $(LIB_DIR)/$(GLUT_LIB_NAME)
15
16 PROGS = \
17 osdemo
18
19
20 ##### RULES #####
21
22 .SUFFIXES:
23 .SUFFIXES: .c
24
25
26 # make executable from .c file:
27 .c: $(LIB_DEP) readtex.o
28 $(CC) -I$(INCDIR) $(CFLAGS) $< readtex.o $(APP_LIB_DEPS) -o $@
29
30
31 ##### TARGETS #####
32
33 default: readtex.o $(PROGS)
34
35
36 readtex.c: $(TOP)/progs/util/readtex.c
37 cp $< .
38
39 readtex.h: $(TOP)/progs/util/readtex.h
40 cp $< .
41
42 readtex.o: readtex.c readtex.h
43 $(CC) -c -I$(INCDIR) $(CFLAGS) readtex.c
44
45
46 showbuffer.c: $(TOP)/progs/util/showbuffer.c
47 cp $< .
48
49 showbuffer.h: $(TOP)/progs/util/showbuffer.h
50 cp $< .
51
52 showbuffer.o: showbuffer.c showbuffer.h
53 $(CC) -c -I$(INCDIR) $(CFLAGS) showbuffer.c
54
55
56 # special case: need the -lOSMesa library:
57 osdemo: osdemo.c
58 $(CC) -I$(INCDIR) $(CFLAGS) osdemo.c $(OSMESA_LIBS) -o $@
59
60 # another special case: need the -lOSMesa16 library:
61 osdemo16: osdemo16.c
62 $(CC) -I$(INCDIR) $(CFLAGS) osdemo16.c $(OSMESA16_LIBS) -o $@
63
64 # another special case: need the -lOSMesa32 library:
65 osdemo32: osdemo32.c
66 $(CC) -I$(INCDIR) $(CFLAGS) osdemo32.c $(OSMESA32_LIBS) -o $@
67
68
69
70 clean:
71 -rm -f $(PROGS)
72 -rm -f *.o *~
73 -rm -f readtex.[ch] showbuffer.[ch]