SlideShare a Scribd company logo
LUG -4:
BUILDING BLOCKS
Building Software on Linux systems
Build?
• The software meaning of ‘building’ is pretty much the same as the
everyday meaning - to take raw materials and create something useful out
of them.
int c;
int d;
max();
Subl
Jmpl
Addl
Jmp
Popl
Addl
import
java.lang.*
Source files
(The Work Stuff)
int a;
int b;
sum();
import
java.util.*
BUILD PROCESS
Executable File
(The fun stuff)
Why use a Build System
• It makes your workflow reproducible.
• It makes life easier for end-users.
• It helps you document the full software
installation process.
Make
• Classic, original build system released in 1977 for
UNIX.
• Uses a formatted set of instructions, stored in a file
called a Makefile.
Source
Code
targetfile:
source
com
mand
abc.zip: curl
counties.zipMakefile
RESULT
Makefiles
• A makefile consists of sequential rules.
• A rule consists of a target, required components, and commands.
• If the prerequisites are satisfied, the command is performed when the
specific target is called..
target : prerequisites ; command(s)
An Example
CC = gcc
CFLAGS = -c -Wall
all: main
main: main.o randrange.o
$(CC) main.o randrange.o -o password-pronounce
main.o: src/main.c
$(CC) $(CFLAGS) src/main.c
randrange.o: src/randrange.c
$(CC) $(CFLAGS) src/randrange.c
clean:
rm -rf *o password-pronounce
install:
cp password-pronounce /usr/bin/
uninstall:
all is called first, and checks for the
dependency main.
Since main has not been built yet, the
system looks for a rule to build it.
Control flows recursively down the file, until
the first target is built. The rest of the build
then completes upwards
What’s Missing?
• System prerequisites, such as compilers,
linkers and assemblers.
• Even if these are installed, make may not
know the right place to look for them.
• That’s where configure comes in.
Configure
• Configure is an executable shell script that
matches components on the computer to
those required by the Makefile
• Automates system portability, by making
sure that everything is in the right place
Version Control
• Version control is a system that records changes to a file or set of files
over time so that you can recall specific versions later
• A VCS allows you to revert files back to a previous state, revert the entire
project back to a previous state, review changes made over time, see who
last modified something that might be causing a problem, who introduced
an issue and when, and more
• Using a VCS also means that if you screw things up or lose files, you can
generally recover easily
The Git VCS
Git Basics
• Git uses a Git directory, a working directory, and a staging area.
• The Git directory is where everything is actually stored. It’s where Git
keeps your project’s database.
• The working directory is the directory you’re currently working in. It’s one
version of your project.
• The staging area is a file that Git uses to keep track of the changes you’ve
made in the working directory.
Git Basics
The git workflow is as follows:
• You modify files in your working directory.
• You stage the files, adding snapshots of them to your staging area.
• You do a commit, which takes the files as they are in the staging area and
stores that snapshot permanently to your Git directory.
Any given file in a git repository can be only be in one of those three states.
Try out what you learnt!
• We’ve prepared a (small) complete project that includes a configure script,
a makefile, and is stored as a git repository.
• To get it, type this in your git or bash terminal:
git clone https://github.com/puranjay/password-pronounce
• Use the readme file to get it up and running on a Linux machine.

More Related Content

PDF
Git 101: Git and GitHub for Beginners
PPTX
Git and Github
PDF
Learning git
PPTX
Introduction to git & GitHub
PDF
Intro to Git and GitHub
PDF
Intro to Git, GitHub, and Devpost
PPT
Introduction to Git and Github
PDF
Git Tutorial
Git 101: Git and GitHub for Beginners
Git and Github
Learning git
Introduction to git & GitHub
Intro to Git and GitHub
Intro to Git, GitHub, and Devpost
Introduction to Git and Github
Git Tutorial

What's hot (19)

PPTX
Github
PPTX
Git theory
PPTX
Introduction to git hub
PDF
Git tutorial II
PPT
Introduction to git
PDF
PyWPS-4.0.0
PPTX
Continuos Integration @Knetminer
PDF
Git basics
PPTX
An introduction to Atlassian Bitbucket Pipelines
PDF
Magento infrastructure by OpsWay
PPTX
Git Presentation
PPTX
PPTX
Getting Started with Git: A Primer for SVN and TFS Users
PPT
Introduction to Git
PPTX
Puppet / DevOps - EDGE Lviv
PPTX
Version controll.pptx
PPTX
Introduction git
KEY
Git with bitbucket (draft)
PDF
Intro to Git: a hands-on workshop
Github
Git theory
Introduction to git hub
Git tutorial II
Introduction to git
PyWPS-4.0.0
Continuos Integration @Knetminer
Git basics
An introduction to Atlassian Bitbucket Pipelines
Magento infrastructure by OpsWay
Git Presentation
Getting Started with Git: A Primer for SVN and TFS Users
Introduction to Git
Puppet / DevOps - EDGE Lviv
Version controll.pptx
Introduction git
Git with bitbucket (draft)
Intro to Git: a hands-on workshop
Ad

Similar to Makefile+VersionControl (20)

ODP
Git: be social
PPTX
Version Control with Git
PDF
Git introduction
PDF
Git SVN Migrate Reasons
PPTX
Git session 1
PDF
Rc094 010d-git 2 - desconocido
PPTX
Git 101
PDF
Programming in Linux Environment
KEY
Helios in Action: Git at Eclipse
PDF
Git para novatos
ODP
Software Build processes and Git
PDF
Git 入门与实践
PDF
PPT
CSE 390 Lecture 9 - Version Control with GIT
PDF
Git 入门 与 实践
PPTX
Introducing to git
PPTX
Git.From thorns to the stars
PPTX
GIT INTRODUCTION
PDF
Git basics
PDF
Version Control System - Git
Git: be social
Version Control with Git
Git introduction
Git SVN Migrate Reasons
Git session 1
Rc094 010d-git 2 - desconocido
Git 101
Programming in Linux Environment
Helios in Action: Git at Eclipse
Git para novatos
Software Build processes and Git
Git 入门与实践
CSE 390 Lecture 9 - Version Control with GIT
Git 入门 与 实践
Introducing to git
Git.From thorns to the stars
GIT INTRODUCTION
Git basics
Version Control System - Git
Ad

Recently uploaded (20)

PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Modernizing your data center with Dell and AMD
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
KodekX | Application Modernization Development
PDF
cuic standard and advanced reporting.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPT
Teaching material agriculture food technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
NewMind AI Weekly Chronicles - August'25 Week I
The AUB Centre for AI in Media Proposal.docx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Modernizing your data center with Dell and AMD
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Encapsulation theory and applications.pdf
Spectral efficient network and resource selection model in 5G networks
Diabetes mellitus diagnosis method based random forest with bat algorithm
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Review of recent advances in non-invasive hemoglobin estimation
KodekX | Application Modernization Development
cuic standard and advanced reporting.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Teaching material agriculture food technology

Makefile+VersionControl

  • 1. LUG -4: BUILDING BLOCKS Building Software on Linux systems
  • 2. Build? • The software meaning of ‘building’ is pretty much the same as the everyday meaning - to take raw materials and create something useful out of them. int c; int d; max(); Subl Jmpl Addl Jmp Popl Addl import java.lang.* Source files (The Work Stuff) int a; int b; sum(); import java.util.* BUILD PROCESS Executable File (The fun stuff)
  • 3. Why use a Build System • It makes your workflow reproducible. • It makes life easier for end-users. • It helps you document the full software installation process.
  • 4. Make • Classic, original build system released in 1977 for UNIX. • Uses a formatted set of instructions, stored in a file called a Makefile. Source Code targetfile: source com mand abc.zip: curl counties.zipMakefile RESULT
  • 5. Makefiles • A makefile consists of sequential rules. • A rule consists of a target, required components, and commands. • If the prerequisites are satisfied, the command is performed when the specific target is called.. target : prerequisites ; command(s)
  • 6. An Example CC = gcc CFLAGS = -c -Wall all: main main: main.o randrange.o $(CC) main.o randrange.o -o password-pronounce main.o: src/main.c $(CC) $(CFLAGS) src/main.c randrange.o: src/randrange.c $(CC) $(CFLAGS) src/randrange.c clean: rm -rf *o password-pronounce install: cp password-pronounce /usr/bin/ uninstall: all is called first, and checks for the dependency main. Since main has not been built yet, the system looks for a rule to build it. Control flows recursively down the file, until the first target is built. The rest of the build then completes upwards
  • 7. What’s Missing? • System prerequisites, such as compilers, linkers and assemblers. • Even if these are installed, make may not know the right place to look for them. • That’s where configure comes in.
  • 8. Configure • Configure is an executable shell script that matches components on the computer to those required by the Makefile • Automates system portability, by making sure that everything is in the right place
  • 9. Version Control • Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later • A VCS allows you to revert files back to a previous state, revert the entire project back to a previous state, review changes made over time, see who last modified something that might be causing a problem, who introduced an issue and when, and more • Using a VCS also means that if you screw things up or lose files, you can generally recover easily
  • 11. Git Basics • Git uses a Git directory, a working directory, and a staging area. • The Git directory is where everything is actually stored. It’s where Git keeps your project’s database. • The working directory is the directory you’re currently working in. It’s one version of your project. • The staging area is a file that Git uses to keep track of the changes you’ve made in the working directory.
  • 12. Git Basics The git workflow is as follows: • You modify files in your working directory. • You stage the files, adding snapshots of them to your staging area. • You do a commit, which takes the files as they are in the staging area and stores that snapshot permanently to your Git directory. Any given file in a git repository can be only be in one of those three states.
  • 13. Try out what you learnt! • We’ve prepared a (small) complete project that includes a configure script, a makefile, and is stored as a git repository. • To get it, type this in your git or bash terminal: git clone https://github.com/puranjay/password-pronounce • Use the readme file to get it up and running on a Linux machine.