Makefile 5.41 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

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


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

Brian Paul's avatar
Brian Paul committed
42

43 44 45
distclean: realclean


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

53

54
.PHONY: default doxygen clean realclean distclean install
55

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


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


# Rules for making release tarballs

186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
PACKAGE_VERSION=7.12-devel
PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)

EXTRA_FILES = \
	aclocal.m4					\
	configure					\
	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
205

206

207 208 209 210
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
211
	$(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
212

213
# Everything for new a Mesa release:
214 215 216
ARCHIVES = $(PACKAGE_NAME).tar.gz \
	$(PACKAGE_NAME).tar.bz2 \
	$(PACKAGE_NAME).zip \
217

218
tarballs: md5
219
	rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
220

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

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

237 238
../$(PACKAGE_DIR):
	ln -s $(PWD) $@
Brian Paul's avatar
Brian Paul committed
239

240 241
$(PACKAGE_NAME).tar: parsers ../$(PACKAGE_DIR) manifest.txt
	cd .. ; tar -cf $(PACKAGE_DIR)/$(PACKAGE_NAME).tar -T $(PACKAGE_DIR)/manifest.txt
242

243 244
$(PACKAGE_NAME).tar.gz: $(PACKAGE_NAME).tar ../$(PACKAGE_DIR)
	gzip --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.gz
245

246 247
$(PACKAGE_NAME).tar.bz2: $(PACKAGE_NAME).tar
	bzip2 --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.bz2
248

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

255
md5: $(ARCHIVES)
256 257 258 259
	@-md5sum $(PACKAGE_NAME).tar.gz
	@-md5sum $(PACKAGE_NAME).tar.bz2
	@-md5sum $(PACKAGE_NAME).zip

260
.PHONY: tarballs md5