tree: c7c9b615bdc325d50ce3e93d46a8ff881bcc99ba [path history] [tgz]
  1. test/
  2. Android.bp
  3. AST.cpp
  4. AST.h
  5. c2hal_l.ll
  6. c2hal_y.yy
  7. CompositeDeclaration.cpp
  8. CompositeDeclaration.h
  9. Declaration.cpp
  10. Declaration.h
  11. Define.cpp
  12. Define.h
  13. EnumVarDeclaration.cpp
  14. EnumVarDeclaration.h
  15. Expression.cpp
  16. Expression.h
  17. FunctionDeclaration.cpp
  18. FunctionDeclaration.h
  19. Include.cpp
  20. Include.h
  21. main.cpp
  22. Note.cpp
  23. Note.h
  24. README.md
  25. Scope.h
  26. Type.cpp
  27. Type.h
  28. TypeDef.cpp
  29. TypeDef.h
  30. VarDeclaration.cpp
  31. VarDeclaration.h
c2hal/README.md

c2hal user-guide

1. Build

croot
make c2hal -j64

2. Run

c2hal [-g] [-o dir] -p package (-r interface-root)+ (header-filepath)+

-o output path: If missing, the second half of a relevant interface-root will be used.

-p package: For example android.hardware.baz@1.0. This will be used as the package in .hal files and will also be used to construct the correct directory structure.

-g: Enabling this flag changes the behavior of c2hal to parse opengl files.

-r package:path root: For example 'android.hardware:hardware/interfaces'.

Examples:

# Build the test.h header:
c2hal -r android.hardware:hardware/interfaces -p android.hardware.baz@1.0 system/tools/hidl/c2hal/test/test.h

# Build the simple.h header:
c2hal -r android.hardware:hardware/interfaces -p android.hardware.simple@1.0 system/tools/hidl/c2hal/test/simple.h

# Build a particular libhardware header:
c2hal -r android.hardware:hardware/interfaces -p android.hardware.nfc@1.0 hardware/libhardware/include/hardware/nfc.h

# Build all headers from libhardware:
python3 system/tools/hidl/c2hal/test/build_all.py ~/android/master/hardware/libhardware/include/hardware/

# Build various OpenGl versions:
python3 system/tools/hidl/c2hal/test/build_all.py -g ~/android/master/frameworks/native/opengl/include/EGL/
python3 system/tools/hidl/c2hal/test/build_all.py -g ~/android/master/frameworks/native/opengl/include/ETC1/
python3 system/tools/hidl/c2hal/test/build_all.py -g ~/android/master/frameworks/native/opengl/include/GLES/
python3 system/tools/hidl/c2hal/test/build_all.py -g ~/android/master/frameworks/native/opengl/include/GLES2/
python3 system/tools/hidl/c2hal/test/build_all.py -g ~/android/master/frameworks/native/opengl/include/GLES3/
python3 system/tools/hidl/c2hal/test/build_all.py -g ~/android/master/frameworks/native/opengl/include/KHR/