Skip to content

Instantly share code, notes, and snippets.

@Y-KURI
Last active August 9, 2018 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Y-KURI/2b85770c470a10d1f9052e70c12b5145 to your computer and use it in GitHub Desktop.
Save Y-KURI/2b85770c470a10d1f9052e70c12b5145 to your computer and use it in GitHub Desktop.
c_compile by rake
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"CC = \"gcc\"\n",
"\n",
"task :default => \"hello\"\n",
"\n",
"file \"hello\" => \"hello.o\" do\n",
" sh \"#{CC} -o hello hello.o\"\n",
"end\n",
"\n",
"file \"hello.o\" => \"hello.c\" do\n",
" sh \"#{CC} -c hello.c\"\n",
"end"
]
}
],
"source": [
"cat Rakefile"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"#include <stdio.h>\n",
"\n",
"int main(int argc, const char * argv[]) {\n",
"\n",
" printf(\"mesage!\\n\");\n",
" return 0;\n",
"}"
]
}
],
"source": [
"cat hello.c"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Rakefile\thello.c\n"
]
}
],
"source": [
"ls"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"gcc -c hello.c\n",
"gcc -o hello hello.o\n"
]
}
],
"source": [
"rake"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Rakefile\thello\t\thello.c\t\thello.o\n"
]
}
],
"source": [
"ls"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Bash",
"language": "bash",
"name": "bash"
},
"language_info": {
"codemirror_mode": "shell",
"file_extension": ".sh",
"mimetype": "text/x-sh",
"name": "bash"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment