Mail Archives: djgpp/1998/09/25/10:46:44
George Foot wrote:
>
> On 25 Sep 98 at 11:01, Rylan wrote:
> > gal.exe: $(OBJ); \
> > $(CC) -o gal.exe $(OBJ) -lalleg -lseal -m486 -s -Wall -Werror
. . .
> You misunderstood what Make did. Calling gcc to compile .c
> files into .o files was done automatically -- nothing to do
> with the rule you posted above.
In case that needs to be a little clearer, the source of
the confusion is that gcc is used as both the compiler and
the linker (actually gcc is a control program that invokes
the compiler and linker).
The rule above, is using gcc as a linker to combine all the
.o files (and some libraries) into an exe file. As such, its
list of .o files must include both the ones that came from .c
files and the ones that came from .asm files.
> I don't know how to call NASM, but supposing it takes `-i' to
> specify the input file and `-o' to specify the output file, and
> `-switches' are the switches to use, e.g.:
>
> nasm -i input.asm -o output.o -switches
>
> You could put:
>
> %.o: %.asm
> nasm -i $< -o $@ -switches
The input file is given bare (without a switch, just
like .c files for gcc). "-fcoff" is required to tell it that
the output format is a djgpp compatible .o file. Other
switches might be helpful depending on what you are doing.
nasm $< -o $@ -fcoff $(NASMFLAGS)
--
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/
- Raw text -