Skip to content

Commit

Permalink
Add trivial makefile to build c programs
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Martinsson committed Sep 22, 2014
1 parent 6a4550a commit 81def09
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CFLAGS=-std=c99

all: stderr stdout bigger graph i numnorm numsum randarg
13 changes: 13 additions & 0 deletions stderr.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <stdio.h>

int main(int argc, char **argv) {
for (int i = 1; i < argc; i++) {
fprintf(stderr, "%s", argv[i]);

if (i + 1 < argc) {
fprintf(stderr, " ");
}
}
fprintf(stderr, "\n");
return 0;
}
13 changes: 13 additions & 0 deletions stdout.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <stdio.h>

int main(int argc, char **argv) {
for (int i = 1; i < argc; i++) {
fprintf(stdout, "%s", argv[i]);

if (i + 1 < argc) {
fprintf(stdout, " ");
}
}
fprintf(stdout, "\n");
return 0;
}

0 comments on commit 81def09

Please sign in to comment.