diff --git a/8.7/Makefile b/8.7/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..30537e19f910ff2493240b358bcfc03fe8e2025c --- /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 0000000000000000000000000000000000000000..55298186c3488cb55781145378edcd6459c6f414 --- /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 0000000000000000000000000000000000000000..0bba62a2481b2c2124b34fb32735a3b3341df9f8 --- /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 0000000000000000000000000000000000000000..e354f7db5134af0c5cfdb3b2b01eef578f868592 --- /dev/null +++ b/8.7/main.c @@ -0,0 +1,6 @@ +#include "func.h" + +int main() +{ + func_name_or_id(); +}