-1

My makefile will not run for some reason. This code comes from one of my instructors on how to run a makefile for java programs. It's called Makefile

all:
    javac cs286_p1/*.javac
    jar cmf manifest.mf cs286_p1.jar cs286_p1
    @echo "+ to run type: java -jar exampleProgram.jar"
    @echo "+ to run with command line arguments, simply append them to the line above"

I've run cat -e -t -v Makefile to see what the result was and it was this:

$ cat -e -t -v Makefile
all:^M$
^Ijavac cs286_p1/*.javac^M$
^Ijar cmf manifest.mf cs286_p1.jar cs286_p1^M$
^I@echo "+ to run type: java -jar exampleProgram.jar"^M$
^I@echo "+ to run with command line arguments, simply append them to the line above"^M$

Any help with this?

EDIT: It seems as as though dos2unix didn't work. I edited the file to take out the ~$. I'm editing and working on this in a linux environment that I'm currently connected to, I however started this on Notepad++ and made sure that ANSII was the encoding. Still not working, however, anything else that can be thought of?

Nallid
  • 1
  • 1
  • 2

1 Answers1

1

Looks like you have Microsoft line endings (Carriage Return + Linefeed, x0d0a instead of Linefeed alone, x0a). You edited this file in Windows, I suppose.

If you want to continue doing this, you should either get a Windows editor like notepad++ which can control the line endings (linux-like or windows-like) or else you apply dos2unix Makefile.

muclux
  • 5,324