• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2013-2020 The Khronos Group Inc.
2# SPDX-License-Identifier: Apache-2.0
3
4# Generator scripts and options
5# GENOPTS can be e.g. '-noprotect'
6
7PYFILES = genheaders.py reg.py
8GENOPTS =
9GENHEADERS = ./genheaders.py $(GENOPTS)
10
11# Generate all headers for GL / GLES / WGL / GLX
12# Different headers depend on different XML registry files
13# The $(GENHEADERS) script has targets for the additional headers
14#   $(API)/GL/gl.h
15#   $(API)/GL/glx.h
16#   $(API)/GL/wgl.h
17# but these are experimental and not supported by Khronos. OpenGL
18# drivers and SDKs provided by OS vendors and IHVs include their own
19# platform-specific versions of these headers, where appropriate.
20
21API	   = ../api
22GLHEADERS  = $(API)/GL/glext.h \
23	     $(API)/GL/glcorearb.h \
24	     $(API)/GLES/gl.h \
25	     $(API)/GLES/glext.h \
26	     $(API)/GLES2/gl2.h \
27	     $(API)/GLES2/gl2ext.h \
28	     $(API)/GLES3/gl3.h
29GLXHEADERS = $(API)/GL/glxext.h
30WGLHEADERS = $(API)/GL/wglext.h \
31	     $(API)/GL/wgl.h
32ALLHEADERS = $(GLHEADERS) $(GLXHEADERS) $(WGLHEADERS)
33
34# Generated files to clean up
35TEXDIRT = readme.aux readme.idx readme.ilg readme.ind readme.log readme.toc readme.out
36PYDIRT	= diag.txt dumpReg.txt errwarn.txt reg.pyc
37
38default: $(ALLHEADERS)
39
40$(GLHEADERS): gl.xml $(PYFILES)
41	$(GENHEADERS) $@
42
43$(GLXHEADERS): glx.xml $(PYFILES)
44	$(GENHEADERS) $@ -registry glx.xml
45
46$(WGLHEADERS): wgl.xml $(PYFILES)
47	$(GENHEADERS) $@ -registry wgl.xml
48
49# Generate Relax NG XML schema from Compact schema
50
51registry.rng: registry.rnc
52	trang registry.rnc registry.rng
53
54# Verify all registry XML files against the schema
55
56validate:
57	jing -c registry.rnc gl.xml
58	jing -c registry.rnc glx.xml
59	jing -c registry.rnc wgl.xml
60
61# Documentation target
62
63readme.pdf: readme.tex
64	touch readme.ind
65	pdflatex readme.tex
66	pdflatex readme.tex
67	makeindex readme.idx
68	pdflatex readme.tex
69
70clean:
71	-rm -f $(PYDIRT) $(TEXDIRT)
72