Tip 2. º¹¼ö°³ÀÇ ÆÄÀÏ ÄÄÆÄÀÏÇϱâ
1. °£´ÜÇÏ°Ô ¸î °³ÀÇ ÆÄÀÏÀ» ÄÄÆÄÀÏÇϱâ
extern mult1();
#include <stdio.h>
main()
{
mult1();
printf("After
test Program\n");
}
#include <stdio.h>
mult1()
{
printf("This
program is test program \n");
}
2. Shell ¸í·É ÀÌ¿ëÇϱâ
gcc main.c test1.c test2.c test3.c -o test
3. make ÇÁ·Î±×·¥
test : main.o test1.o test2.o test3.o
gcc main.o test1.o test2.o
test3.o -o test (TabÅ° ÀÌ¿ëÇÏ¿© µÚ·Î ¹Ð°Í)
main.o : main.c
test1.o
: test1.c
test2.o : test2.c
test3.o : test3.c
¶Ç´Â
cc =gcc
obj =main.o
test1.o test2.o test3.o
test =$(obj)
$(cc)
-o test $(obj)
main.o : main.c `
<$(cc)
-c main.c // ÄÄÆÄÀÏ·¯¸¦ gcc·Î »ç¿ë>
test1.o
: test1.c
test2.o : test2.c
test3.o : test3.c