Hi, I have always been afraid of makefiles and I was given a generic makefile to use and have been using that. Now I dont like it much since it doesnt cover everything I would like it to.
I am trying to make a generic makefile, in an effort to understand the makefile itself.
#This is where you put the name of the library you are creating
OUT_LIB= libdbaccess.a #This is the directory where the library will be put OUT_LIB_DIR= $(TOPDIR)/LIB-OUT
This seems to work just fine for source file changes. But I cant seem to figure out how to add header file dependencies to it? The reason I didnt put the OBJ file rule in the makefile is because I dont want the .o files, I create an .a file out of all the .o's so I delete the .o's. So I skipped that step, thats y compiling and archiving are in one step.
Now if I add $(INCLUDES) in the OUT_LIB target then if I change the header file, it tries to compile it, and I can see y it does that. I want when the header file is changed it should remake all the $(SRCS) files or a subset of those that depend on it.