1 / 11

makefile

makefile. M.A Doman. What is the make utility?. make is a standard linux command to automatically determine when parts of a large project require recompilation Governed by a set of rules built in a makefile # indicates comment line target: prerequisite list

Download Presentation

makefile

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. makefile M.A Doman

  2. What is the make utility? • make is a standard linux command to automatically determine when parts of a large project require recompilation • Governed by a set of rules built in a makefile • # indicates comment line target: prerequisite list [TAB] construction command

  3. make clean target • Used to clean up the directory • In makefile: Clean: rmlist the object files you want removed. \ continue on next line.

  4. make: using variables and comments You can also use variables when writing makefiles. # Comment that will say I’m creating a variable for compiler CC = g++ # Comment for a set of option flags used for compilation CFLAGS = -c # Link final program final: main.odeck.obox.o $(CC) –o final main.odeck.obox.o #compile main main.o: main.cpp $(CC) $(CFLAGS) main.cpp

  5. make: using variables and comments You can also use variables when writing makefiles. # Comments that help me remember what I’m doing #clean directory # -f ignores nonexistent files without prompt # -r removes directories and contents recursively clean: rm–fr *.o final

  6. Makefile lab • Continue now with makefile lab

  7. UNIX Tutorial The following comes from the site: UNIX Tutorial for Beginners By the University of Surrey

  8. Files and Processes • Everything in UNIX is either a file or a process. • A process is an executing program identified by a unique PID (process identifier). • A file is a collection of data. They are created by users using text editors, running compilers etc.

  9. Redirection

  10. Wildcards

  11. Process

More Related