Skip to content

Instantly share code, notes, and snippets.

@takopom
Created May 6, 2019 01:06
Show Gist options
  • Save takopom/5ab739787477b1c95c2e26b071043f12 to your computer and use it in GitHub Desktop.
Save takopom/5ab739787477b1c95c2e26b071043f12 to your computer and use it in GitHub Desktop.
Rakefileの練習
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void) {
srand((unsigned)time(NULL));
char message[5][16] = {"Marvelous!","Awesome!","Excellent!","Great!","Nice!"};
int index = rand() % 5;
printf("%s\n", message[index]);
return 0;
}
CC = "gcc"
task :default => "fortune"
desc "Make fortune"
file "fortune" => "fortune.o" do |t|
sh "#{CC} -o #{t.name} #{t.prerequisites.join(' ')}"
end
desc "Make fortune.o"
file "fortune.o" => "fortune.c" do |t|
sh "#{CC} -c #{t.prerequisites[0]}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment