102f4aeb0Sopenharmony_ci# Copyright 2013-2020 The Khronos Group Inc.
202f4aeb0Sopenharmony_ci# SPDX-License-Identifier: Apache-2.0
302f4aeb0Sopenharmony_ci
402f4aeb0Sopenharmony_ci# Generated headers
502f4aeb0Sopenharmony_ciEGLHEADERS = EGL/egl.h EGL/eglext.h
602f4aeb0Sopenharmony_ci
702f4aeb0Sopenharmony_ci# Generation tools
802f4aeb0Sopenharmony_ciPYTHON = python3
902f4aeb0Sopenharmony_ciPYFILES = genheaders.py reg.py
1002f4aeb0Sopenharmony_ciREGISTRY = egl.xml
1102f4aeb0Sopenharmony_ciGENOPTS =
1202f4aeb0Sopenharmony_ciGENHEADERS = $(PYTHON) -B genheaders.py $(GENOPTS) -registry $(REGISTRY)
1302f4aeb0Sopenharmony_ci
1402f4aeb0Sopenharmony_ciall: $(EGLHEADERS)
1502f4aeb0Sopenharmony_ci
1602f4aeb0Sopenharmony_ciEGL/egl.h: egl.xml $(PYFILES)
1702f4aeb0Sopenharmony_ci	$(GENHEADERS) EGL/egl.h
1802f4aeb0Sopenharmony_ci
1902f4aeb0Sopenharmony_ciEGL/eglext.h: egl.xml $(PYFILES)
2002f4aeb0Sopenharmony_ci	$(GENHEADERS) EGL/eglext.h
2102f4aeb0Sopenharmony_ci
2202f4aeb0Sopenharmony_ci# Simple test to make sure generated headers compile
2302f4aeb0Sopenharmony_ciKHR   = .
2402f4aeb0Sopenharmony_ciTESTS = Tests
2502f4aeb0Sopenharmony_ci
2602f4aeb0Sopenharmony_citests: egltest.c $(EGLHEADERS)
2702f4aeb0Sopenharmony_ci	$(CC) -c -I$(KHR) egltest.c
2802f4aeb0Sopenharmony_ci	$(CXX) -c -I$(KHR) egltest.c
2902f4aeb0Sopenharmony_ci	-rm egltest.o
3002f4aeb0Sopenharmony_ci
3102f4aeb0Sopenharmony_ci# Verify registries against the schema
3202f4aeb0Sopenharmony_ci
3302f4aeb0Sopenharmony_civalidate:
3402f4aeb0Sopenharmony_ci	jing -c registry.rnc egl.xml
3502f4aeb0Sopenharmony_ci
3602f4aeb0Sopenharmony_ci################################################
3702f4aeb0Sopenharmony_ci
3802f4aeb0Sopenharmony_ci# Remove intermediate targets from 'make tests'
3902f4aeb0Sopenharmony_ciclean:
4002f4aeb0Sopenharmony_ci	rm -f *.[io] Tests/*.[io] diag.txt dumpReg.txt errwarn.txt
4102f4aeb0Sopenharmony_ci
4202f4aeb0Sopenharmony_ciclobber: clean
4302f4aeb0Sopenharmony_ci	rm -f $(EGLHEADERS)
44