mirror of
https://github.com/ioacademy-jikim/debugging
synced 2026-08-22 05:42:58 +00:00
first commit
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
sflsjflsjf s
|
||||
sdlkfjslkfjs
|
||||
'f
|
||||
@@ -0,0 +1,8 @@
|
||||
// foo.c
|
||||
#include <stdio.h>
|
||||
#include <foo.h>
|
||||
|
||||
void foo()
|
||||
{
|
||||
printf("foo : %d\n", FOO);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// foo.h
|
||||
|
||||
#define FOO 100
|
||||
|
||||
void foo();
|
||||
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
// goo.c
|
||||
#include <stdio.h>
|
||||
#include <goo.h>
|
||||
|
||||
void goo()
|
||||
{
|
||||
printf("goo : %d\n", GOO);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// goo.h
|
||||
|
||||
#define GOO 200
|
||||
|
||||
void goo();
|
||||
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
// main.c
|
||||
#include <stdio.h>
|
||||
#include <foo.h>
|
||||
#include <goo.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
foo();
|
||||
goo();
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
# makefile 1
|
||||
|
||||
# make 로 실행하면 아무것도 안됨을 설명
|
||||
# make foo 로 실행할것
|
||||
|
||||
# for each xxxxx.o target there must be a xxxxx.c dependency to build.
|
||||
|
||||
.c.o:
|
||||
cc -c $< -I.
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# makefile2
|
||||
|
||||
# .c.o 뿐 아니라 모든 파일 확장자가 가능함을 설명
|
||||
|
||||
#.SUFFIXES: .txt .log
|
||||
|
||||
.txt.log:
|
||||
@echo "Converting " $< " to " $*.log
|
||||
mv $< $*.log
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# makefile3
|
||||
|
||||
# 아래 코드를 사용해 보고
|
||||
# 문제점은 각 헤더에 dependecy 임을 이야기 하고
|
||||
# makefile4를 수업.
|
||||
|
||||
.c.o:
|
||||
@echo "Compiling" $< "..."
|
||||
cc -c $< -I.
|
||||
|
||||
app: main.o foo.o goo.o
|
||||
@echo "Building target" $@ "..."
|
||||
cc -o app main.o foo.o goo.o
|
||||
|
||||
#problem dependency
|
||||
@@ -0,0 +1,13 @@
|
||||
# makefile4
|
||||
|
||||
.c.o:
|
||||
@echo "Compiling" $< "..."
|
||||
cc -c $< -I.
|
||||
|
||||
app: main.o foo.o goo.o
|
||||
@echo "Building target" $@ "..."
|
||||
cc -o app main.o foo.o goo.o
|
||||
|
||||
main.o:foo.h goo.h
|
||||
foo.o:foo.h
|
||||
foo.o:goo.h
|
||||
Reference in New Issue
Block a user