I have six source files and I would like to link them using the .elf format. I have written a makefile that converts all the source code files to .obj files.
When I attempt to link these object files using the syntax I gave in the makefile, the following errors appear:
gcc -c rt_look.c
Linking ARM test_rom.elf
make[1]: o: Command not found
make[1]: [test_rom.elf] Error 127 (ignored)
make[1]: Leaving directory `/c/Imperas/Demo/main/isolated_model_ert_rtw
I am also pasting the makefile rules:
all:$(OBJ) test_rom.elf
ert_main.o: ert_main.c isolated_model.h rtwtypes.h
gcc -c ert_main.c
isolated_model.o: isolated_model.c isolated_model.h isolated_model_private.h
gcc -c isolated_model.c
isolated_model_date.o: isolated_model_data.c isolated_model.h isolated_model_data.h
gcc -c isolated_model_data.c
rt_look2d_normal.o: rt_look2d_normal.c rtlibsrc.h
gcc -c rt_look2d_normal.c
rt_nonfinite.o: rt_nonfinite.c rt_nonfinite.h
gcc -c rt_nonfinite.c
rt_look.o: rt_look.c rtlibsrc.h
gcc -c rt_look.c
syscalls.o: syscalls.c
gcc -c syscalls.c
test_rom.elf: $(OBJ)
$(V) echo "Linking $(CROSS) $@"
$(V) $(IMPERAS_LINK) -o $@ $^ $(IMPERAS_LDFLAGS) -lm
clean::
-rm -f test_rom.elf
-rm -f *.$(OBJ).o
endif
The
VandIMPERAS_LINKvariables are not set, or set to an empty value, so when buildingtest_rom.elf,makeruns the commandwhich attempts to run the
ocommand. Since the first character in the command is-,makeignores the error.Try replacing
"Linking $(CROSS)"with"Linking $(CROSS) with $(IMPERAS_LINK)"to see if this is the case.