I'm trying to start using the GNU make utility (http://www.gnu.org/software/make/make.html) to build my C167 projects (there is a Win32 executable already built and available for download on another site, and the doc's are great). I copied the assembler, compiler and linker strings right out of the project otpions on the KEIL IDE and pasted them into the appropriate places in my makefile. If I do a build all via the KEIL IDE, my project builds with zero errors and zero warnings, and I get a HEX file that I can load into my target and run. However, if I delete the object files and run the make utility, the ASM files assemble with zero errors and zero warnings, the C files compile with zero errors and zero warnings, however the linker aborts with this error: *** FATAL ERROR 220: INVALID INPUT MODULE MODULE: C:\KEIL\C166\LIB\C167HL.LIB <-----> FWIW, I am using the HLARGE memory model, so it looks like the compiler & assembler did get the model correctly from the text I copied from the control strings via the project options dialog box. The memory model is not mentioned in the linker control strings. I redirected the output of the make utility to a text file and then closely examined what was sent to the linker on the command line (via the make utility), and it looks exactly like the linker control string in the project options dialog box's linker control string window. Anybody have a clue as to why I might be getting this error message from the linker? Confused... Dave.
Just a thought... Presumably, you compile your assembly and C source files individually (i.e., one source file per compiler invocation). When you link, are you trying to specifiy all the object files on the command line? If so, you could be exceeding the allowable command line length. To get around the command line length restriction I have my makefiles generate a linker command input file, then invoke the linker using the '@' option. This is for the C51 tools, mind you, but it's probably similar for the other toolchains.
"I have my makefiles generate a linker command input file ... This is for the C51 tools, mind you" Also thinking C51, note that uVision creates a Linker Command file: it has the same name as the Project file, and a .lnp extension. This file could be used in a makefile (GNU or otherwise). The following Knowledgebase article suggests that this does also apply to C166: http://www.keil.com/support/docs/1774.htm
I found the .LNP file, made the .LIN file via the IDE, and they look almost the same (the .LIN file is missing the list of .OBJ files). I'll find out how to read that file in as part of the make process and let you know if that fixes the problem. Thanks (keeping my fingers crossed)... Dave.