c - In MAKE file : error showing no such file or directory -


i have simple makefile. when run make following error:

gcc  -i -o server server.o comfunc.o  gcc: error: comfunc.o: no such file or directory  make: *** [server] error 1 

my makefile:

 cc=gcc   cflags=-i  aim = server  heads = ../common/common.h  objs = comfunc.o  mobj = server.o  miscs = server.cfg  srcs = ${objs:.o=.c} ${mobj:.o=.c}  #targets all: $(aim)   server:server.o          $(cc) $(ldflags) $(cflags) -o server server.o $(objs) $(libs)  #dependency $(objs):../common/common.h  comfunc.o: ../common/common.h  #--end of makefile-- 

add $(objs) , $(mobj) dependency server make sure implicit makefile rules executed produces corresponding .os

refer makefile below

cc=gcc   cflags=-i  aim = server  heads = ../common/common.h  objs = comfunc.o  mobj = server.o  miscs = server.cfg  srcs = ${objs:.o=.c} ${mobj:.o=.c}  #targets all: $(aim)   server:server.o $(objs) $(mobj)          $(cc) $(ldflags) $(cflags) -o server server.o $(objs) $(libs)  #dependency $(objs):../common/common.h  comfunc.o: ../common/common.h 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -