How Do You Save a Makefile in Windows?

Asked By 10 points N/A Posted on -
qa-featured

I am having problems testing my makefile which I created in Windows operating system. When I created the file, I saved it as a word document. When I tried running the file, I got an error message. I went back and then saved it as a txt file but that did not work either. So how do I actually save a makefile when I finish creating it?

SHARE
Answered By 590495 points N/A #190691

How Do You Save a Makefile in Windows?

qa-featured

A makefile is a special file that contains shell commands that you created and named makefile. It is used using the UNIX make utility to find out which parts of a program you need to compile or to compile. It is normally a script that directs the make utility to select the correct program files that needs to be compiled.

Also, the make utility monitors when files were last updated so that it will only update the ones that contains changes. Here is a sample makefile.

edit : main.o kbd.o command.o display.o
       insert.o search.o files.o utils.o
        cc -o edit main.o kbd.o command.o display.o
                   insert.o search.o files.o utils.o

main.o : main.c defs.h
        cc -c main.c
kbd.o : kbd.c defs.h command.h
        cc -c kbd.c
command.o : command.c defs.h command.h
        cc -c command.c
display.o : display.c defs.h buffer.h
        cc -c display.c
insert.o : insert.c defs.h buffer.h
        cc -c insert.c
search.o : search.c defs.h buffer.h
        cc -c search.c
files.o : files.c defs.h buffer.h command.h
        cc -c files.c
utils.o : utils.c defs.h
        cc -c utils.c
clean :
        rm edit main.o kbd.o command.o display.o
           insert.o search.o files.o utils.o

Related Questions