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..
Code:
.
├── include
│ ├── def.h
│ └── h_TmrSbc.h
├── lib
├── obj
└── src
├── f_TmrSbc.c
├── Makefile
└── m_TmrSbc.c
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..
Here are my current makefile source code:
Code:
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
I also try to modified the
part to but got the compiler error state the location of header cannot be found to create the object files...
I also try to change the location of INCL...
Please help...