So here is the way you do it, how ever the complete tutorial about it could be found at
http://www.gnu.org/software/make/manual/make.html
Here are a few simple sample files for make
/**
*main.c
*/
#include
int main()
{
printf("main");
two();
return 0;
}
/**
*two.c
*/
#include "stdio.h"
#include "header.h"
int two(){
printf("two %d", N);
return 0;
}
/**
*header.h
*/
#define N 100
#Makefile
objects = main.o\
two.o
edit : $(objects)
gcc -o edit $(objects)
two.o : header.h
.PHONY : clean
clean :
rm edit $(objects)
#end Makefile
how ever a better insight could be obtained by glancing through the URL though ;)
No comments:
Post a Comment