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