Search code examples
clinuxmakefilecygwinnotepad

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.


Solution

  • 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.


    At the bottom of the save dialog box, select

    Save as type: All Files (*.*)
    

    from the drop-down menu instead of the default

    Save as type: Text Document (*.txt)
    

    Then, you could use any extension that you desire.