specify app lib dependencies in Makefiles (patch 1/3)
[mesa.git] / progs / glsl / Makefile
1 # progs/demos/Makefile
2
3 TOP = ../..
4 include $(TOP)/configs/current
5
6 INCDIR = $(TOP)/include
7
8 LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
9
10 LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
11
12 PROGS = \
13 bitmap \
14 brick \
15 bump \
16 deriv \
17 mandelbrot \
18 noise \
19 points \
20 texdemo1 \
21 toyball \
22 trirast
23
24
25 ##### RULES #####
26
27 .SUFFIXES:
28 .SUFFIXES: .c
29
30
31 # make executable from .c file:
32 .c: $(LIB_DEP)
33 $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
34
35
36 ##### TARGETS #####
37
38 default: $(PROGS)
39
40
41
42 ##### Extra dependencies
43
44 extfuncs.h: $(TOP)/progs/util/extfuncs.h
45 cp $< .
46
47 readtex.c: $(TOP)/progs/util/readtex.c
48 cp $< .
49
50 readtex.h: $(TOP)/progs/util/readtex.h
51 cp $< .
52
53 readtex.o: readtex.c readtex.h
54 $(CC) -c -I$(INCDIR) $(CFLAGS) readtex.c
55
56 bitmap.c: extfuncs.h
57
58 brick.c: extfuncs.h
59
60 bump.c: extfuncs.h
61
62 mandelbrot.c: extfuncs.h
63
64 points.c: extfuncs.h
65
66 toyball.c: extfuncs.h
67
68 texdemo1: texdemo1.o readtex.o
69 $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) texdemo1.o readtex.o $(LIBS) -o $@
70
71 texdemo1.o: texdemo1.c readtex.h extfuncs.h
72 $(CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c
73
74
75 clean:
76 -rm -f $(PROGS)
77 -rm -f *.o *~
78 -rm -f extfuncs.h