From 76f4fd40242dbe9f8b3b0ef691dca1db33d52999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=9E=A5=EC=9B=90?= <wkddnjs3268@ajou.ac.kr> Date: Sat, 8 Aug 2020 19:37:27 +0900 Subject: [PATCH] 8.7 --- 8.7/Makefile | 20 ++++++++++++++++++++ 8.7/func.c | 13 +++++++++++++ 8.7/func.h | 3 +++ 8.7/main.c | 6 ++++++ 4 files changed, 42 insertions(+) create mode 100644 8.7/Makefile create mode 100644 8.7/func.c create mode 100644 8.7/func.h create mode 100644 8.7/main.c diff --git a/8.7/Makefile b/8.7/Makefile new file mode 100644 index 0000000..30537e1 --- /dev/null +++ b/8.7/Makefile @@ -0,0 +1,20 @@ +CC=gcc +OBJS=main.o func.o + +test: $(OBJS) + $(CC) -o $@ $^ + +id: main.o id_func.o + $(CC) -o test $(OBJS) + +main.o: main.c + $(CC) -c main.c + +func.o: func.c + $(CC) -c func.c + +id_func.o: func.c + $(CC) -DPRINT_ID -c func.c + +clean: + rm $(OBJS) test diff --git a/8.7/func.c b/8.7/func.c new file mode 100644 index 0000000..5529818 --- /dev/null +++ b/8.7/func.c @@ -0,0 +1,13 @@ +#include <stdio.h> +#include "func.h" + +int func_name_or_id() +{ +#ifdef PRINT_ID + printf("201920756\n"); + return 0; +#else + printf("Jangwon Lee\n"); + return 1; +#endif +} diff --git a/8.7/func.h b/8.7/func.h new file mode 100644 index 0000000..0bba62a --- /dev/null +++ b/8.7/func.h @@ -0,0 +1,3 @@ +#pragma once + +extern int func_name_or_id(); diff --git a/8.7/main.c b/8.7/main.c new file mode 100644 index 0000000..e354f7d --- /dev/null +++ b/8.7/main.c @@ -0,0 +1,6 @@ +#include "func.h" + +int main() +{ + func_name_or_id(); +} -- GitLab