Keith Whitwell | b451752 | 2006-06-22 16:32:19 +0000 | [diff] [blame] | 1 | # progs/tests/Makefile |
| 2 | |
| 3 | |
| 4 | # These programs aren't intended to be included with the normal distro. |
| 5 | # They're not too interesting but they're good for testing. |
| 6 | |
| 7 | TOP = ../.. |
| 8 | include $(TOP)/configs/current |
| 9 | |
| 10 | |
Dan Nicholson | c05aa5e | 2007-10-29 09:03:01 -0600 | [diff] [blame] | 11 | LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) |
Keith Whitwell | b451752 | 2006-06-22 16:32:19 +0000 | [diff] [blame] | 12 | |
| 13 | SOURCES = \ |
| 14 | clear.c \ |
| 15 | line-clip.c \ |
| 16 | line-cull.c \ |
| 17 | line-userclip-clip.c \ |
| 18 | line-userclip-nop-clip.c \ |
| 19 | line-userclip-nop.c \ |
| 20 | line-userclip.c \ |
| 21 | line.c \ |
| 22 | lineloop-clip.c \ |
| 23 | lineloop.c \ |
| 24 | point.c \ |
| 25 | point-clip.c \ |
| 26 | point-param.c \ |
| 27 | point-wide.c \ |
| 28 | poly-flat.c \ |
| 29 | poly-unfilled.c \ |
| 30 | poly.c \ |
| 31 | quad-clip.c \ |
| 32 | quad-clip-all-vertices.c \ |
| 33 | quad-clip-nearplane.c \ |
| 34 | quad-degenerate.c \ |
| 35 | quad-flat.c \ |
| 36 | quad-offset-factor.c \ |
| 37 | quad-offset-units.c \ |
| 38 | quad-offset-unfilled.c \ |
| 39 | quad-unfilled.c \ |
| 40 | quad-tex-2d.c \ |
Alan Hourihane | 6d104cb | 2006-11-02 12:02:13 +0000 | [diff] [blame] | 41 | quad-tex-pbo.c \ |
Keith Whitwell | b451752 | 2006-06-22 16:32:19 +0000 | [diff] [blame] | 42 | quad-tex-3d.c \ |
Keith Whitwell | b451752 | 2006-06-22 16:32:19 +0000 | [diff] [blame] | 43 | quad.c \ |
| 44 | quads.c \ |
| 45 | quadstrip.c \ |
| 46 | quadstrip-flat.c \ |
Keith Whitwell | c53df49 | 2007-01-16 13:29:01 +0000 | [diff] [blame] | 47 | dlist-edgeflag.c \ |
| 48 | dlist-dangling.c \ |
| 49 | dlist-edgeflag-dangling.c \ |
Keith Whitwell | a30d2c5 | 2008-09-15 13:47:12 +0100 | [diff] [blame] | 50 | dlist-degenerate.c \ |
Keith Whitwell | 48c638b | 2007-01-30 19:19:51 +0000 | [diff] [blame] | 51 | drawrange.c \ |
| 52 | drawelements.c \ |
| 53 | drawarrays.c \ |
Keith Whitwell | b451752 | 2006-06-22 16:32:19 +0000 | [diff] [blame] | 54 | tri-blend.c \ |
| 55 | tri-tex-3d.c \ |
| 56 | tri-clip.c \ |
| 57 | tri-cull.c \ |
| 58 | tri-edgeflag.c \ |
| 59 | tri-flat-clip.c \ |
| 60 | tri-flat.c \ |
| 61 | tri-unfilled-clip.c \ |
| 62 | tri-unfilled-smooth.c \ |
| 63 | tri-unfilled-userclip.c \ |
| 64 | tri-unfilled.c \ |
| 65 | tri-userclip.c \ |
| 66 | tri-dlist.c \ |
| 67 | tri.c \ |
| 68 | tristrip-clip.c \ |
| 69 | tristrip.c \ |
Keith Whitwell | 48c638b | 2007-01-30 19:19:51 +0000 | [diff] [blame] | 70 | vbo-drawrange.c \ |
| 71 | vbo-drawelements.c \ |
| 72 | vbo-drawarrays.c \ |
Keith Whitwell | b451752 | 2006-06-22 16:32:19 +0000 | [diff] [blame] | 73 | vp-clip.c \ |
| 74 | vp-tri.c \ |
| 75 | vp-line-clip.c \ |
| 76 | vp-unfilled.c \ |
| 77 | vp-array.c |
| 78 | |
| 79 | PROGS = $(SOURCES:%.c=%) |
| 80 | |
| 81 | INCLUDES = -I. -I$(TOP)/include -I../samples |
| 82 | |
| 83 | UTIL_FILES = readtex.h readtex.c |
| 84 | |
| 85 | |
| 86 | ##### RULES ##### |
| 87 | |
| 88 | .SUFFIXES: |
| 89 | .SUFFIXES: .c |
| 90 | |
| 91 | .c: |
Dan Nicholson | 2a3e338 | 2007-09-28 18:42:21 -0600 | [diff] [blame] | 92 | $(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@ |
Keith Whitwell | b451752 | 2006-06-22 16:32:19 +0000 | [diff] [blame] | 93 | |
| 94 | .c.o: |
| 95 | $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ |
| 96 | |
| 97 | .S.o: |
| 98 | $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ |
| 99 | |
| 100 | |
| 101 | ##### TARGETS ##### |
| 102 | |
| 103 | default: $(UTIL_FILES) $(PROGS) |
| 104 | |
| 105 | clean: |
Dan Nicholson | a6464b3 | 2008-05-07 11:35:23 -0700 | [diff] [blame] | 106 | -rm -f $(PROGS) |
| 107 | -rm -f *.o |
| 108 | -rm -f getproclist.h |
Keith Whitwell | b451752 | 2006-06-22 16:32:19 +0000 | [diff] [blame] | 109 | |
| 110 | |
| 111 | # auto code generation |
| 112 | getprocaddress: getprocaddress.c getproclist.h |
| 113 | |
| 114 | getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.py |
| 115 | python getprocaddress.py > getproclist.h |
| 116 | |
| 117 | |
| 118 | texrect: texrect.o readtex.o |
Guillaume Melquiond | 3e8e292 | 2008-07-30 07:56:42 -0700 | [diff] [blame] | 119 | $(CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@ |
Keith Whitwell | b451752 | 2006-06-22 16:32:19 +0000 | [diff] [blame] | 120 | |
| 121 | texrect.o: texrect.c readtex.h |
| 122 | $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ |
| 123 | |
| 124 | invert: invert.o readtex.o |
Guillaume Melquiond | 3e8e292 | 2008-07-30 07:56:42 -0700 | [diff] [blame] | 125 | $(CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@ |
Keith Whitwell | b451752 | 2006-06-22 16:32:19 +0000 | [diff] [blame] | 126 | |
| 127 | invert.o: invert.c readtex.h |
| 128 | $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ |
| 129 | |
| 130 | readtex.o: readtex.c |
| 131 | $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ |
| 132 | |
| 133 | |
| 134 | readtex.h: $(TOP)/progs/util/readtex.h |
| 135 | ln -s $(TOP)/progs/util/readtex.h . |
| 136 | |
| 137 | readtex.c: $(TOP)/progs/util/readtex.c |
| 138 | ln -s $(TOP)/progs/util/readtex.c . |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | # Emacs tags |
| 144 | tags: |
| 145 | etags `find . -name \*.[ch]` `find ../include` |