Created
October 31, 2010 22:41
-
-
Save tomas-stefano/657269 to your computer and use it in GitHub Desktop.
Rakefile from a C Library and Cgreen Tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Rakefile with a C Library with the following tree: | |
| #├── library | |
| #│ ├── something.c | |
| #│ └── something.h | |
| #├── specifications | |
| #│ ├── all_specifications.c | |
| #│ ├── all_specifications.o | |
| #│ ├── something_spec.c | |
| #│ └── something_spec.o | |
| # | |
| # | |
| require 'rake/clean' | |
| CLEAN.include('specifications/*.o', 'library/*.o') | |
| CLOBBER.include('specifications') | |
| SOURCE = FileList['library/*.c'] | |
| OBJECT_SOURCE = SOURCE.ext('o') | |
| TEST_SOURCE = FileList['specifications/*.c'] | |
| OBJECT_SOURCE_TEST = TEST_SOURCE.ext('o') | |
| file OBJECT_SOURCE_TEST => OBJECT_SOURCE do |t| | |
| sh "cc -Wall -I library -c -o #{t.name} #{t.source}" | |
| end | |
| desc 'Generate the binary Runner of Specifications' | |
| file 'specifications' => OBJECT_SOURCE_TEST do | |
| sh "cc -Wall -o specifications -lcgreen #{OBJECT_SOURCE_TEST}" | |
| end | |
| rule '.o' => '.c' do |t| | |
| sh "cc -Wall -I library -c -o #{t.name} #{t.source}" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment