Skip to content
Permalink
Browse files
Initial commit
  • Loading branch information
tiehuis committed Jul 17, 2017
0 parents commit 572d12a60187799cacb649c44b0e2a8eb7be33c7
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 0 deletions.
@@ -0,0 +1,2 @@
main
build/
@@ -0,0 +1,14 @@
SRCS := compute.c compute_helper.c display.c main.c
OBJS := $(SRCS:%.c=build/%.o)

main: $(OBJS)
gcc -o main $(OBJS)

$(OBJS): build/%.o: %.c | mkdirs
gcc -std=c99 -c $< -o $@

mkdirs:
@mkdir -p build

clean:
rm -rf build main
@@ -0,0 +1,6 @@
#include "compute_helper.h"

char compute(char a)
{
return compute_helper(a) + 5;
}
@@ -0,0 +1 @@
char compute(char a);
@@ -0,0 +1,4 @@
char compute_helper(char a)
{
return a + 1;
}
@@ -0,0 +1 @@
char compute_helper(char a);
@@ -0,0 +1,6 @@
#include <stdio.h>

void display_char(char c)
{
printf("%c\n", c);
}
@@ -0,0 +1 @@
void display_char(char c);
7 main.c
@@ -0,0 +1,7 @@
#include "display.h"
#include "compute.h"

int main(void)
{
display_char(compute('A'));
}

0 comments on commit 572d12a

Please sign in to comment.