Skip to content

kext/rake-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rake-c

This is a small plugin for Rake, which helps you build your C projects.

Installation

Put this in your Gemfile

# This is still pre-release, so we better use that exact version.
gem 'rake-c', '0.0.1'

and do

$ bundle install

Or just install it manually with

$ gem install rake-c

Example

require 'rake/c'

# Set some compiler flags.
C.cflags = '-O3'

# Create a library which will be placed in ‘build/libsomelibrary.a’.
C.library 'somelibrary', [
  # It uses the files ‘src/somelibrary/bunch.c’, ‘src/somelibrary/of.c’ and
  # ‘src/somelibrary/files.c’.
  'bunch.c', 'of.c', 'files.c'
]

# Set some other compiler flags.
C.cflags = '-O3 -std=c99 -Wall -pedantic'

# Make ‘build/libtest.a’ from ‘src/test/test.c’.
C.library 'test', ['test.c']

# Create a program ‘build/test’.
C.program 'test', [
  # Use the file ‘src/test.c’, ...
  'test.c',
  # ... the two libraries above ...
  'libtest.a', 'libsomelibrary.a',
  # ... and the maths library.
  '-lm'
]

About

Build small C programs

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages