Lava Lava - 1 month ago 6
C Question

Why when I create a Makefile with Notepad its saved .txt

When I create Makefile with Notepad it's saved with .txt How can I get rid of it ? also when I try to run the program on cygwin it says *** No targets specified and no makefile found. Stop.

P.S I am new to Makefile and Linux environments.

Answer

Windows will 'helpfully' add the .txt to any file that you create with notepad. You have several options:

(1) just rename the file from makefile.txt to makefile and things should work

(2) use the -f command line argument with make, i.e make -f makefile.txt to get make to use the correct file.

(3) seeing that you have cygwin install use emacs, or vi, or gedit as your editor.

(4) consider using notepad++ (or something similar) if you must use windows.

(5) or (and this would be my default suggestion), ditch Windows and just install Linux.