Reputation: 39
#! bin/bash
CC=gcc
CFLAGS=-I.
DEPS=p.h
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
hello:p1.o p2.o
gcc hello p1.o p2.o -I.
the error showing during the the make of makefile is shown below
gcc hello p1.o p2.o -I.
gcc: error: hello: No such file or directory
make: *** [hello] Error 1
executable is not created after makefile execution,but the obnject files are created
Upvotes: 0
Views: 42
Reputation: 6186
If your output is hello
, change to
hello:p1.o p2.o
gcc p1.o p2.o -I. -o $@
Upvotes: 1