I am getting syntax error: unexpected end of file
when I run make clean.
I was successful of getting rid of that error when I removed the brackets around the variable that was causing the error.
I want to know why does this happen.
I am using:
- Windows XP SP2 64 bit
- CYGWIN
- KSH R48
My variable is called TARGET
and is like this but way longer:
./ShowEnumContentsPrefAPI.o ./ShowEnumsPrefAPI.o
The line where the error happens was:
rm -f $(TARGET)
When I removed the brackets the error was gone and it worked:
rm -f $TARGET
Another line as well was:
if [ "$(TARGET)" != "" ]; then \
When I removed the brackets the error was gone and it worked:
if [ "$TARGET" != "" ]; then \
==============================================================
- What is happening here?
- How can I prevent this from happening without changing every line that is causing the error (I have more than 1000 line in this makefile)?
- How did this work on
mks 5.2 sh.exe
and will not work oncygwin ksh
?
==============================================================
UPDATE:
This is the actual code:
clean:
if [ "$TARGET" != "" ]; then \
rm -rf $(TARGET); \
fi
This is what produced the error syntax error: unexpected end of file
:
clean:
if [ "$(TARGET)" != "" ]; then \
rm -rf $(TARGET); \
fi
The only difference is the brackets around target.
Doing the
echo "T:$T"; \
echo "TARGET:$TARGET"; \
Produced
T:
TARGET:ARGET
echo "(TARGET):$(TARGET)";\
produced the syntax error: unexpected end of file
again.
Today I tried cutting off some of the TARGET variable. Making it shorter by hand intentionally and the rm -f $(TARGET)
worked fine. I suspect it's a problem with cygwin's rm
, [
exes. I will try upgrading to cygwin's latest version and see if the problem persists.