122b8b
VERSION ?= 21.3.4
0e9fd6
SANITIZE ?= 1
0e9fd6
0e9fd6
DIRNAME = mesa-${VERSION}
0e9fd6
0e9fd6
all: archive
0e9fd6
0e9fd6
clean:
0e9fd6
	rm -rf $(DIRNAME)/
0e9fd6
	rm -f mesa-${VERSION}.tar.xz
0e9fd6
0e9fd6
clone: clean
213cda
	curl -O https://archive.mesa3d.org/mesa-${VERSION}.tar.xz
0e9fd6
	tar xf mesa-${VERSION}.tar.xz
0e9fd6
0e9fd6
sanitize: clone vl_mpeg12_decoder.c vl_decoder.c
0e9fd6
ifdef SANITIZE
0e9fd6
	cat < vl_mpeg12_decoder.c > $(DIRNAME)/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
0e9fd6
	cat < vl_decoder.c > $(DIRNAME)/src/gallium/auxiliary/vl/vl_decoder.c
0e9fd6
endif
0e9fd6
0e9fd6
archive: clone sanitize
0e9fd6
	tar caf ${DIRNAME}.tar.xz ${DIRNAME}