Makefile 5.5 KB
Newer Older
Brian Paul's avatar
Brian Paul committed
1 2 3 4
# Top-level Mesa makefile

TOP = .

5
SUBDIRS = src
Brian Paul's avatar
Brian Paul committed
6 7


8 9
# The git command below generates an empty string when we're not
# building in a GIT tree (i.e., building from a release tarball).
Brian Paul's avatar
Brian Paul committed
10
default: $(TOP)/configs/current
11
	@$(TOP)/bin/extract_git_sha1
Brian Paul's avatar
Brian Paul committed
12
	@for dir in $(SUBDIRS) ; do \
13 14 15
		if [ -d $$dir ] ; then \
			(cd $$dir && $(MAKE)) || exit 1 ; \
		fi \
Brian Paul's avatar
Brian Paul committed
16 17
	done

18 19
all: default

Brian Paul's avatar
Brian Paul committed
20

21
doxygen:
22
	cd doxygen && $(MAKE)
23

24 25
check:
	cd src/glsl/tests/ && ./optimization-test
26
	make -C tests check
27

Brian Paul's avatar
Brian Paul committed
28
clean:
Dan Nicholson's avatar
Dan Nicholson committed
29 30
	-@touch $(TOP)/configs/current
	-@for dir in $(SUBDIRS) ; do \
31 32 33
		if [ -d $$dir ] ; then \
			(cd $$dir && $(MAKE) clean) ; \
		fi \
Brian Paul's avatar
Brian Paul committed
34
	done
Dan Nicholson's avatar
Dan Nicholson committed
35
	-@test -s $(TOP)/configs/current || rm -f $(TOP)/configs/current
Brian Paul's avatar
Brian Paul committed
36 37


Dan Nicholson's avatar
Dan Nicholson committed
38
realclean: clean
Brian Paul's avatar
Brian Paul committed
39 40
	-rm -rf lib*
	-rm -f $(TOP)/configs/current
41 42
	-rm -f $(TOP)/configs/autoconf
	-rm -rf autom4te.cache
43 44
	-find . '(' -name '*.o' -o -name '*.a' -o -name '*.so' -o \
	  -name depend -o -name depend.bak ')' -exec rm -f '{}' ';'
45

Brian Paul's avatar
Brian Paul committed
46

47 48 49
distclean: realclean


Brian Paul's avatar
Brian Paul committed
50
install:
51
	@for dir in $(SUBDIRS) ; do \
52 53 54
		if [ -d $$dir ] ; then \
			(cd $$dir && $(MAKE) install) || exit 1 ; \
		fi \
55
	done
56

57

58
.PHONY: default doxygen clean realclean distclean install check
59

Brian Paul's avatar
Brian Paul committed
60 61 62 63 64
# If there's no current configuration file
$(TOP)/configs/current:
	@echo
	@echo
	@echo "Please choose a configuration from the following list:"
65
	@ls -1 $(TOP)/configs | grep -v "current\|default\|CVS\|autoconf.*"
Brian Paul's avatar
Brian Paul committed
66 67
	@echo
	@echo "Then type 'make <config>' (ex: 'make linux-x86')"
68 69 70 71
	@echo
	@echo "Or, run './configure' then 'make'"
	@echo "See './configure --help' for details"
	@echo
Brian Paul's avatar
Brian Paul committed
72 73 74 75 76 77
	@echo "(ignore the following error message)"
	@exit 1


# Rules to set/install a specific build configuration
aix \
Karl Schultz's avatar
Karl Schultz committed
78
aix-64 \
Brian Paul's avatar
Brian Paul committed
79
aix-64-static \
Brian Paul's avatar
Brian Paul committed
80
aix-gcc \
81
aix-static \
82
autoconf \
Brian's avatar
Brian committed
83
bluegene-osmesa \
Brian's avatar
Brian committed
84
bluegene-xlc-osmesa \
85
catamount-osmesa-pgi \
Brian Paul's avatar
Brian Paul committed
86
darwin \
87 88
darwin-fat-32bit \
darwin-fat-all \
Brian Paul's avatar
Brian Paul committed
89
freebsd \
90
freebsd-dri \
91
freebsd-dri-amd64 \
92
freebsd-dri-x86 \
Brian Paul's avatar
Brian Paul committed
93 94
hpux10 \
hpux10-gcc \
Brian Paul's avatar
Brian Paul committed
95
hpux10-static \
Karl Schultz's avatar
Karl Schultz committed
96
hpux11-32 \
Brian Paul's avatar
Brian Paul committed
97 98
hpux11-32-static \
hpux11-32-static-nothreads \
Karl Schultz's avatar
Karl Schultz committed
99
hpux11-64 \
Brian Paul's avatar
Brian Paul committed
100
hpux11-64-static \
Brian Paul's avatar
Brian Paul committed
101 102
hpux11-ia64 \
hpux11-ia64-static \
Brian Paul's avatar
Brian Paul committed
103 104 105 106 107 108 109 110 111
hpux9 \
hpux9-gcc \
irix6-64 \
irix6-64-static \
irix6-n32 \
irix6-n32-static \
irix6-o32 \
irix6-o32-static \
linux \
112
linux-i965 \
Brian Paul's avatar
Brian Paul committed
113 114 115
linux-alpha \
linux-alpha-static \
linux-debug \
116
linux-dri \
Brian's avatar
Brian committed
117
linux-dri-debug \
Dave Airlie's avatar
Dave Airlie committed
118
linux-dri-x86 \
119
linux-dri-x86-64 \
120
linux-dri-ppc \
121
linux-dri-xcb \
122
linux-egl \
123
linux-indirect \
Keith Whitwell's avatar
Keith Whitwell committed
124
linux-fbdev \
Brian Paul's avatar
Brian Paul committed
125 126
linux-ia64-icc \
linux-ia64-icc-static \
Brian Paul's avatar
Brian Paul committed
127 128
linux-icc \
linux-icc-static \
129
linux-llvm \
130
linux-llvm-debug \
Chia-I Wu's avatar
Chia-I Wu committed
131
linux-opengl-es \
Brian Paul's avatar
Brian Paul committed
132
linux-osmesa \
133
linux-osmesa-static \
Brian Paul's avatar
Brian Paul committed
134 135 136 137 138
linux-osmesa16 \
linux-osmesa16-static \
linux-osmesa32 \
linux-ppc \
linux-ppc-static \
José Fonseca's avatar
José Fonseca committed
139
linux-profile \
Brian Paul's avatar
Brian Paul committed
140 141 142 143
linux-sparc \
linux-sparc5 \
linux-static \
linux-ultrasparc \
144
linux-tcc \
Brian Paul's avatar
Brian Paul committed
145
linux-x86 \
146
linux-x86-debug \
147
linux-x86-32 \
Brian Paul's avatar
Brian Paul committed
148
linux-x86-64 \
149
linux-x86-64-debug \
150
linux-x86-64-profile \
Brian Paul's avatar
Brian Paul committed
151
linux-x86-64-static \
152
linux-x86-profile \
Brian Paul's avatar
Brian Paul committed
153 154 155 156
linux-x86-static \
netbsd \
openbsd \
osf1 \
Brian Paul's avatar
Brian Paul committed
157
osf1-static \
Brian Paul's avatar
Brian Paul committed
158 159
solaris-x86 \
solaris-x86-gcc \
Brian Paul's avatar
Brian Paul committed
160
solaris-x86-gcc-static \
Brian Paul's avatar
Brian Paul committed
161 162 163 164 165
sunos4 \
sunos4-gcc \
sunos4-static \
sunos5 \
sunos5-gcc \
Brian Paul's avatar
Brian Paul committed
166
sunos5-64-gcc \
Brian Paul's avatar
Brian Paul committed
167
sunos5-smp \
Brian Paul's avatar
Brian Paul committed
168 169 170 171
sunos5-v8 \
sunos5-v8-static \
sunos5-v9 \
sunos5-v9-static \
Brian's avatar
Brian committed
172
sunos5-v9-cc-g++ \
Brian Paul's avatar
Brian Paul committed
173
ultrix-gcc:
174 175 176 177 178 179 180
	@ if test -f configs/current -o -L configs/current; then \
		if ! cmp configs/$@ configs/current > /dev/null; then \
			echo "Please run 'make realclean' before changing configs" ; \
			exit 1 ; \
		fi ; \
	else \
		cd configs && rm -f current && ln -s $@ current ; \
181
	fi
182
	$(MAKE) default
Brian Paul's avatar
Brian Paul committed
183 184 185 186


# Rules for making release tarballs

187
PACKAGE_VERSION=8.0-devel
188 189 190 191 192 193
PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)

EXTRA_FILES = \
	aclocal.m4					\
	configure					\
194 195
	tests/Makefile.in				\
	tests/glx/Makefile.in				\
196 197 198 199 200 201 202 203 204 205 206 207
	src/glsl/glsl_parser.cpp			\
	src/glsl/glsl_parser.h				\
	src/glsl/glsl_lexer.cpp				\
	src/glsl/glcpp/glcpp-lex.c			\
	src/glsl/glcpp/glcpp-parse.c			\
	src/glsl/glcpp/glcpp-parse.h			\
	src/mesa/program/lex.yy.c			\
	src/mesa/program/program_parse.tab.c		\
	src/mesa/program/program_parse.tab.h

IGNORE_FILES = \
	-x autogen.sh
208

209

210 211 212 213
parsers: configure
	-@touch $(TOP)/configs/current
	$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
	$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
214
	$(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
215

216
# Everything for new a Mesa release:
217 218 219
ARCHIVES = $(PACKAGE_NAME).tar.gz \
	$(PACKAGE_NAME).tar.bz2 \
	$(PACKAGE_NAME).zip \
220

221
tarballs: md5
222
	rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
223

224 225 226 227 228
# Helper for autoconf builds
ACLOCAL = aclocal
ACLOCAL_FLAGS =
AUTOCONF = autoconf
AC_FLAGS =
229
aclocal.m4: configure.ac acinclude.m4
230
	$(ACLOCAL) $(ACLOCAL_FLAGS)
231
configure: configure.ac aclocal.m4 acinclude.m4
232 233
	$(AUTOCONF) $(AC_FLAGS)

234 235 236 237 238
manifest.txt: .git
	( \
		ls -1 $(EXTRA_FILES) ; \
		git ls-files $(IGNORE_FILES) \
	) | sed -e '/^\(.*\/\)\?\./d' -e "s@^@$(PACKAGE_DIR)/@" > $@
239

240 241
../$(PACKAGE_DIR):
	ln -s $(PWD) $@
Brian Paul's avatar
Brian Paul committed
242

243 244
$(PACKAGE_NAME).tar: parsers ../$(PACKAGE_DIR) manifest.txt
	cd .. ; tar -cf $(PACKAGE_DIR)/$(PACKAGE_NAME).tar -T $(PACKAGE_DIR)/manifest.txt
245

246 247
$(PACKAGE_NAME).tar.gz: $(PACKAGE_NAME).tar ../$(PACKAGE_DIR)
	gzip --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.gz
248

249 250
$(PACKAGE_NAME).tar.bz2: $(PACKAGE_NAME).tar
	bzip2 --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.bz2
251

252 253
$(PACKAGE_NAME).zip: parsers ../$(PACKAGE_DIR) manifest.txt
	rm -f $(PACKAGE_NAME).zip ; \
Brian Paul's avatar
Brian Paul committed
254
	cd .. ; \
255 256
	zip -q -@ $(PACKAGE_NAME).zip < $(PACKAGE_DIR)/manifest.txt ; \
	mv $(PACKAGE_NAME).zip $(PACKAGE_DIR)
257

258
md5: $(ARCHIVES)
259 260 261 262
	@-md5sum $(PACKAGE_NAME).tar.gz
	@-md5sum $(PACKAGE_NAME).tar.bz2
	@-md5sum $(PACKAGE_NAME).zip

263
.PHONY: tarballs md5