Code Monkey home page Code Monkey logo

libevdev's Introduction

libevdev

Building

The build system uses a Docker container to generate the Go files directly from the source checkouts of the kernel. This means that on any platform that support Docker, all the file can be generated at once, and generated files will not change based on what the person running the scripts has installed on their computer.

The OS specific files for the build system are located in the ${GOOS} directory, and the build is coordinated by the ${GOOS}/mkall.go program. When the kernel or system library updates, modify the Dockerfile at ${GOOS}/Dockerfile to checkout the new release of the source.

To build all the file, you must be on an amd/linux system and have your GOOS and GOARCH set accordingly. Running build.sh will then generate all of the files for all of the GOOS/GOARCH pairs.

Requirements:

  • bash
  • go
  • Docker

Component files

This section describes the various files used in the code generation process.

mkall.go

This program generate all zecodes, zinput for all linux architectures. Append the targets array within the file to add support for new architecture/OS

mkecodes.go

This program takes in a list of header files containing the ecodes number declarations and parses them to produce the corresponding list of Go numeric constants. See zecodes_${GOOS}_${GOARCH}.go for the generated constants.

types files

For each OS, there is a hand-written Go file at ${GOOS}/types.go. This file included standard C headers and create Go types alias to the corresponding C types. The file is then fed though godefs to generate the Go compatible definitions. Finally, the generated code is fed through mkpost.go to format the code and add any required import. The cleaned-up code is writtent to zinput_${GOOS}_${GOARCH}.go

To add a new type, add in the necessary include statement at the top of the file and add in a type alias line..

Generated files

zecodes_${GOOS}_${GOARCH}.go

A file containing all of the ecodes generated number.

zinput_${GOOS}_${GOARCH}.go

A file containing Go types for parsing into evdev event. Generated by godefs and the type files (see above).

libevdev's People

Contributors

tkan145 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.