test1.c

#include <stdio.h>

main(){
printf("test1\n") ;
test2() ;
return 0 ;
}


test2.c

#include <stdio.h>

void test2(){
printf("test2\n") ;
}


Makeflie

test1: test1.o test2.o
gcc -o test1 test1.o test2.o -lm