Permalink
Browse files

Initial commit

  • Loading branch information...
tiehuis committed Jul 17, 2017
0 parents commit 572d12a60187799cacb649c44b0e2a8eb7be33c7
Showing with 42 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +14 −0 Makefile
  3. +6 −0 compute.c
  4. +1 −0 compute.h
  5. +4 −0 compute_helper.c
  6. +1 −0 compute_helper.h
  7. +6 −0 display.c
  8. +1 −0 display.h
  9. +7 −0 main.c
@@ -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.