【复习】makefile

发布于 27 天前  18 次阅读


之前总结过了,就不详细的写了
故简单写个例子
//c1.c
int Function(int n);
int main(void)
{
    int n;
    scanf("%d",&n);
    printf("%d",Function(n));
    return 0;
}
//c2.c
int Function(int n)
{
    int S;
    S=n*n;
    return S;
}
//c3.h
#include<stdio.h>
exe:c1.o c2.o
    gcc -o exe.out c1.o c2.o
c1.o:c1.c c3.h
    gcc -c c1.c c3.h
c2.o:c2.c   
    gcc -c c2.c
clean:
    rm -rf *.out *.o

file

file


擦肩而过的概率