Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create project generator for C language binding #44

Closed
SanderMertens opened this issue Dec 11, 2014 · 2 comments
Closed

Create project generator for C language binding #44

SanderMertens opened this issue Dec 11, 2014 · 2 comments

Comments

@SanderMertens
Copy link
Member

When creating a new C component, the code generator generates interfaces, type definitions, load routines and type-specific object management routines. A user is then still left with creating:

  • A makefile
  • A file that provides the hyvemain entry procedure

Though small tasks, they are a bit tedious and could easily be automated. For a novice user they also steepen the learning curve. It would be desirable if the generator tool could automate these tasks as well.

Proposed a generator that will generate a makefile, and a new source file called Foo__main.c that will contain the following function:

int hyvemain(int argc, char* argv[]) {
    DB_UNUSED(argc);
    DB_UNUSED(argv);
    return Foo_load();
}
@SanderMertens
Copy link
Member Author

One thing that complicates makefile generation is to allow for future modifications. For example, a component may want to include additional include files or libraries.

An approach similar to allowing regeneration of source files could be employed here. A section could be introduced in the makefile where a user can insert his own code.

For example:

TARGET =    lang

INCLUDE =   include

# $begin
INCLUDE += ../public/c/include
LIBS    = rt dl m
# $end

include $(BUILD)/component.makefile

SanderMertens added a commit that referenced this issue Dec 11, 2014
Adds a new generator to the build that generates a makefile and
Hyve__main.c file that contains the entry point for a hyve library, and
loads the definitions into the object store.

TODO: allow makefiles to be user-edited and not overwritten when code
is re-generated.
SanderMertens added a commit that referenced this issue Dec 12, 2014
The c_project generator has been modified so that it will not generate
a makefile when one is already present. This allows a user to make
persistent modifications to the content of a makefile.
@SanderMertens
Copy link
Member Author

Closed with 655d90b

SanderMertens added a commit that referenced this issue Dec 13, 2014
Addresses bugs & cleans up generators
SanderMertens added a commit that referenced this issue Dec 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant