I am working on a project with the following dir structure.
prog/
Makefile
src/
module1/
module2/
common/
util.c
util.h # include "common/info.h"
info.c
info.h
test/
perf/
Makefile
src/
test.c
I needed a use functions of prog/src/common/util.c
in prog/test/src/test.c
I copied all files from prog/src/common/*
in new folder prog/test/src/common/
Then I added the INC_DIR
in CFLAGS
of Makefile
prog/test/perf/Makefile
:
INC_DIR = src/common
DFLAGS = -MT $@ -MD -MP -MF $(O)/$*.d
CFLAGS = -Wall -Werror $(OPT) $(STD) -I$(INC_DIR)../
but i am still getting error when i make
src/common/util.h:4:24 fatal error common/info.h: No such file or directory
I checked that prog/test/src/common/info.h
does exist.
I am not so good at Makefile syntax. What am i doing wrong.