Mail Archives: djgpp/2001/04/19/19:15:14
drososa AT pat DOT forthnet DOT gr () wrote:
> Problem: In a project makefile there is a need to concatenate two binary
> files together, so the cat command is used. What is observed is that this
> command sometimes works and most often not. When it doesn't, the binary
> characters of the two files are dumped on screen.
>
> Environment: MS-DOS Prompt window in Windows 98 second edition.
>
> Here is a makefile sample that duplicates the problem. The files involved
> can be any binary files.
> -------------------------
> MAINEXE = image
> COPY = cat
>
>
> all: $(MAINEXE).elf
>
> $(MAINEXE).elf:
> $(COPY) signram.atm $(MAINEXE).bin > $(MAINEXE)_ram.bin
> -------------------------
The makefile you show should work fine. The target (image.elf) does not
match the output of the concatenation (image_ram.bin), but I assume this
is because you have simplified the makefile from something else.
Firstly, check you are invoking the correct make with the command `make
--version'.
I suggest to simplify the makefile further, and add a target to check the
correct `cat' is being called:
all:
cat signram.atm image.bin > image_ram.bin
cat_version:
cat --version > cat_vers.txt
Try that and cut and paste here the output of `make cat_version' and the
contents of cat_vers.txt.
> Trying the "copy /b" dos equivalent with the appropriate syntax change (i.e.
> copy /b file1+file2 file3), I get the error message
>
> make.exe: *** [image.elf] Error -1
This should work fine too, but you need to cut and paste the makefile
(and full errors) here, to say for sure.
> Trying to find the dos or windows executable copy.exe it appears that it
> does not exist. Perhaps it is included in some command.com file somewhere.
Yes, it is built in to command.com. There is an xcopy.exe though, with
its own options of course.
> If it matters, my path is
> PATH=
> C:\DJGPP\BIN;C:\DJGPP\JED\BIN;C:\BIN;C:\PYTHON20;C:\WINDOWS;C:\WINDOWS\COMMAND
What would also matter is if you have set the SHELL environment variable,
this is the only thing I can think is causing the misbehaviour you
report. Please post here the output of `make show_shell' if you add the
following lines to the makefile:
show_shell:
echo "$(SHELL)"
> I have also tried putting the C:\WINDOWS\COMMAND entry at the PATH beginning but
No. Don't do that. :)
> the behaviour is still the same. Have also tried playing with the window
> settings such as memory and environment with no success.
Are you running make from an MS-DOS prompt, or some other shell?
> Can anyone shed some light on this?
- Raw text -