- Sun May 03, 2015 2:49 pm
#16392
Andrei Candale wrote:I did; the value of TARGET is not 'app'. It was a desperate move to change it to user_main.c. I did not know what else to do. The result is the same though.
Ok. The idea of this makefile is the following:
- you put it into root of your project;
- you put your sources into subdirectories of this root, and list these subdirectories in MODULES;
- when you run make it builds all c files in subdirectories listed in MODULES and puts them into an archive in the 'build' subdirectory called $(TARGET)_app.a. Then it links ELF file in the same directory called $(TARGET).out. Then it makes firmware binaries from that ELF.
So, I suggest you to change TARGET and MODULES in your Makefile as follows:
Code: Select all# name for the target project
TARGET = test
# which modules (subdirectories) of the project to include in compiling
MODULES = user
(assuming you don't have 'drivers' directory, otherwise add drivers to the MODULES line).
Then put your user_main.c into 'user' subdirectory and run make again.