Hi.. I am totally new here.. and totally new using the "makefile".. my problem is I try to "make" the makefile and create the obj files outside the /src folder (makefile is inside the src folder) istead of it create inside the /src folder... here is my tree level directory..
I already read the manual.. and it is really big and hard to understand for me.. I also have surfing all over the internet but unlucky.. hope you all can help and teach me this stuff..Code:. ├── include │ ├── def.h │ └── h_TmrSbc.h ├── lib ├── obj └── src ├── f_TmrSbc.c ├── Makefile └── m_TmrSbc.c
Here are my current makefile source code:
I also try to modified theCode:CC = gcc CFLAGS = -g -Wall INCL = -I../include EXEC = TmrSbc $(EXEC): m_$(EXEC).o f_$(EXEC).o $(CC) -o $@ $^ %.o: %.c $(CC) $(CFLAGS) -c $< $(INCL) .PHONY: clean clean: rm -f *.o *$(EXEC) core *~ rm -f timelog.txt
part toCode:%.o: %.cbut got the compiler error state the location of header cannot be found to create the object files...Code:obj/%.o:%.c
I also try to change the location of INCL...