0 make (1/3) : Short Description + Example + Syntax Short Description The purpose of the make utility is to determine automatically which pieces of a large.

Slides:



Advertisements
Similar presentations
The make Utility Programming Tools and Environments Winter 2006.
Advertisements

Separate compilation Large programs are generally separated into multiple files, e.g. tuples.h, ray.h, ray.c, tuples.c main.c With several files, we can.
The Makefile utility ABC – Chapter 11, Motivation Small programs single file “Not so small” programs : –Many lines of code –Multiple components.
David Notkin Autumn 2009 CSE303 Lecture 20 static make.
Understanding Makefiles COMP 2400, Fall 2008 Prof. Chris GauthierDickey.
1 CSE 390 Lecture 8 Large Program Management: Make; Ant slides created by Marty Stepp, modified by Josh Goodwin
1 The Makefile Utility ABC – Chapter 11,
CS 211 Recitation 1 TA: Ishani Chakraborty. Admin stuff Office hours: 5:00-6:00 pm, Tuesdays at Core.
The Makefile Utility ABC – Chapter 11, Motivation Small programs single file “Not so small” programs : –Many lines of code –Multiple components.
1 CSSE 332 Standard Library, Storage classes, and Make.
1 CS 201 Makefile Debzani Deb. 2 Remember this? 3 What is a Makefile? A Makefile is a collection of instructions that is used to compile your program.
0 4.2 Functions Returning Non-integers The return statement is the mechanism for returning a value : return expression; Remark : The expression will be.
26-Jun-15 Rake. rake and make A program can consist of many source code files This is always true in Rails! The files may need to be compiled in a certain.
Introduction to Make Updated by Prasad Spring 2000.
CS465 - Unix C Programming (cc/make and configuration control)
The Makefile Utility ABC – Chapter 11, Motivation Small programs single file “Not so small” programs : –Many lines of code –Multiple components.
Lecture 8  make. Overview: Development process  Creation of source files (.c,.h,.cpp)  Compilation (e.g. *.c  *.o) and linking  Running and testing.
Xin Liu Sep 16, Introduction Xin (Shane) Liu PhD Candidate in Computer Science Research Area: Computer Graphics Tutorial Page: pages.cpsc.ucalgary.ca/~liuxin/CPSC453.
1 4.1 Basics of Functions + Control Flow Diagram of a Function Call 4.2 Functions Returning Non-integers + Prototype Function 4.3 External Variables 4.4.
Chapter Ten g++ and make1 System Programming Software Development: g++ and make.
System Programming - LAB 1 Programming Environments.
Makefile M.A Doman. Compiling multiple objects Card.cpp -> Card.o Deck.cpp -> Deck.o main.cpp -> main.o main.o Deck.o Card.o -> Dealer.exe.
1 CSE 390 Lecture 8 Large Program Management: Make; Ant slides created by Marty Stepp, modified by Jessica Miller and Ruth Anderson
The Make utility. Motivation Small programs all in single cpp file “Not so small” programs : Many lines of code Multiple components More than one programmer.
Week 2-3 Control flow (review) Conditional statements If, else, else if, switch-case, break Loop constructs for, while, do-while, break, continue, label--go;
0 4.1 Basics of Functions + Execution Diagram + make 4.2 Functions Returning Non-integers + Prototype Function 4.3 External Variables 4.4 Scope Rules 4.5.
Tools – Ant-MakeEtc 1 CSCE 747 Fall 2013 CSCE 747 Software Testing and Quality Assurance Tools 12 – Hamcrest 10/02/
Discussion Week 1 TA: Kyle Dewey. Project 0 Walkthrough.
Makefiles CARYL RAHN. Separate compilation Large programs are generally separated into multiple files, e.g. main.c addmoney.c removemoney.c money.h With.
Prof: Dr. Shu-Ching Chen TA: Samira Pouyanfar Spring 2015 Makefile Tutorial CIS5027.
Lecture 8  make. Using make for compilation  With medium to large software projects containing many files, it’s difficult to: Type commands to compile.
Problem Solving With C++ Recitation – make February 2016.
Multiple File Compilation and linking By Bhumik Sapara.
Chapter Ten Developing UNIX Applications In C and C++
Brandon Packard. Why make? So far, you have probably worked on relatively small projects Coding projects can become huge My research consists of 1600.
0 4.1 Basics of Functions + Function Call Diagram + make 4.2 Functions Returning Non-integers + Prototype Function 4.3 External Variables 4.4 Scope Rules.
UNIX Development: g++ and make CS 2204 Class meeting 8 Created by Doug Bowman, 2001 Modified by Mir Farooq Ali, 2002.
Revisiting building. Preprocessing + Compiling 2 Creates an object file for each code file (.c ->.o) Each.o file contains code of the functions and structs.
Makefiles Manolis Koubarakis Data Structures and Programming Techniques 1.
1 Ritu Chaturvedi Program Building - Code Organization - Program Distribution Methods 2 Ritu Chaturvedi
Multiple file project management & Makefile
The make utility (original presentation courtesy of Alark Joshi)
Large Program Management: Make; Ant
Automating Builds with Makefiles
CSE 303 Lecture 17 Makefiles reading: Programming in C Ch. 15
Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha Fall 2015
Compilation and Debugging
Compilation and Debugging
Large Program Management: Make; Ant
Makefiles Caryl Rahn.
Makefile Tutorial CIS5027 Prof: Dr. Shu-Ching Chen
Prof: Dr. Shu-Ching Chen TA: Yimin Yang
Prof: Dr. Shu-Ching Chen TA: Samira Pouyanfar Hector Cen Fall 2017
Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha
Large Program Management: Make; Ant
Large Program Management: Make; Ant
Large Program Management: Make; Ant
Rake 4-Dec-18.
Data Structures and Programming Techniques
CSE 390 Lecture 8 Large Program Management: Make; Ant
Large Program Management: Make; Ant
Large Program Management: Make; Ant
Large Program Management: Make; Ant
Large Program Management: Make; Ant
Large Program Management: Make; Ant
EN Software Carpentry Python – A Crash Course Esoteric Sections Compiled Languages.
CSE 390 Lecture 8 Large Program Management: Make; Ant
Large Program Management: Make; Ant
The make utility (original presentation courtesy of Alark Joshi)
Large Program Management: Make, Ant
Presentation transcript:

0 make (1/3) : Short Description + Example + Syntax Short Description The purpose of the make utility is to determine automatically which pieces of a large program need to be recompiled, and issue the commands to recompile them. Example of a Makefile (1) progr : main.o sec.o (2) gcc -o progr main.o sec.o (3) main.o : main.c (4) gcc -c main.c (5) sec.o : sec.c (6) gcc -c sec.c Syntax of a Makefile Rule : [ ] # Dependency line # Show how to build the target out of their prerequisites [ ] Common Usage % make progr main.osec.o main.csec.c © Béat Hirsbrunner, University of Fribourg, Switzerland, March 2003

1 make (2/3) : Execution Model Dependency checking Remark 1. 'make' echoes each command to the standard output before executing it. Remark 2. If is absent the associated command lines are executed. if (main.o don't exist) then else if ( t main.o // main.o is out-of-date else 1 3 progr main.osec.o 12 3 if (progr don't exist) then else if ((t progr // progr is out-of-date else Execution Tree 2 Similar to 1 (1) progr : main.o sec.o (2) gcc -o progr main.o sec.o (3) main.o : main.c (4) gcc -c main.c (5) sec.o : sec.c (6) gcc -c sec.c

2 make (3/3) : Header Files – Hello World revisited hello.c tellMe.c Dependency graph tellMe.h #include "tellMe.h" /* for tellMe() */ main() { tellMe("Hello World"); } hello.c : #include /* for printf() */ #include "tellMe.h" /* for tellMe() */ void tellMe(char s[]) { printf("\n tellMe> %s\r\n\n", s); } tellMe.c : void tellMe(char s[]) tellMe.h : Header file.h : specification Source file.c : implementation Makefile : hello : hello.o tellMe.o gcc -o hello hello.o tellMe.o hello.o : hello.c gcc -c hello.c tellMe.o : tellMe.c gcc -c tellMe.c hello hello.otellMe.o hello.ctellMe.c Dependency graph