main.c
#include "stdio.h"
#include "function.h"
#include "function1.h"
void main()
{
printhello();
printhello1();
}
hello.c
#include "stdio.h"
#include "function.h"
#include "function1.h"
void main()
{
printhello();
printhello1();
}
hello1.c
#include "stdio.h"
#include "function1.h"
void printhello1()
{
printf("***************\n");
printf("Hello World second\n");
}
function.h
void printhello();
function1.h
void printhello1();
Makefile
CC=gcc
CDEBUG=-g
OBJ=hello.o hello1.o main.o
SRC=./inc
INC=./src
my_project : $(OBJ)
$(CC) $(OBJ) -o my_project
main.o : function.h function1.h
$(CC) -c main.c
hello.o : function.h hello.c
$(CC) -c hello.c
hello1.o : function1.h hello1.c
$(CC) -c hello1.c
.PHONY clean:
clean :
rm -rf *.o
folder:Work/src/main.c,hello.c,hello1.c
folder:work/inc/function.h,function1.h
iam getting error like make: *** No rule to make target `function.h', needed by `hello.o'. Stop....can anyone help me reason for this????
[edit]Code block added, "Treat my content as plain text..." option disabled - OriginalGriff[/edit]