SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
broadlinux
7.2016by quyenlv
Broadlinux | Linux of Things 2
Chapter 1
Broadlinux | Linux of Things
Everything was born for a reason
A primitive notion
3
Broadlinux | Linux of Things
Motivation
ïŹ So small programs → single and short file
ïŹ “Not so small” programs :
ïŹ Many lines of code → long file, harder to manage
ïŹ Many programmers → can’t modify the same file simultaneously
ïŹ Every change requires long compilation
ïŹ Solution: divide large programs into smaller, more manageable
pieces with multiple files
ïŹ Pros:
ïŹ Good division to components
ïŹ Easy maintenance of project structure, dependencies and creation
4
Broadlinux | Linux of Things
Original management approach
ïŹ Manual with care, must think of everything
ïŹ Compiling and linking by hand becomes tedious
ïŹ Use shell scripts to comment out some steps to save processing time
ïŹ Early automation used simple make.sh and install.sh scripts
ïŹ Easily lose track of:
ïŹ which ïŹles depend on which others
ïŹ the exact sequence of operations needed to build program
ïŹ which ïŹles have been modiïŹed recently
ïŹ Recompiling everything in sight just to be safe is very wasteful
ïŹ Minimum compilation when something is changed
5
Repair manual
Repair the
Wheel need
to unplug
the whole car?
Broadlinux | Linux of Things
The morning of creation
A primitive notion
6
Broadlinux | Linux of Things 7
Steve Johnson Stuart Feldman
I wasted a
morning
debugging a
program,
file hadn't been
compiled, cc *.o
was therefore
unaffected
Bell Labs
Broadlinux | Linux of Things 8
I met the same
disaster on a project I
was working on
Need a
tool to
solve it!
♄Make♄
1977
Bell Labs
Broadlinux | Linux of Things
make philosophy
9
dependency
relationship
target
commandstimestamp
make
Sequence of execution commands
final target
1. Automate the software building
2. Take minimum of effort
Mission
Broadlinux | Linux of Things
ïŹ A file describes how to generate a particular target file
ïŹ Consists a number of rules
ïŹ If (target out-of-date with dependencies) then
Execute commands to make target up-to-date
ïŹ “Everything is a file”
Makefile
10
dependency
relationship
target
commands
target: dependencies
<tab>commands rule
Broadlinux | Linux of Things
Makefile in Life
11
clothes: shoes wallet mobile t-shirt
look in the mirror
shoes: socks, trousers
make shoes clean
put on shoes
socks:
wash your foot
put on socks
trousers: underpants
put on trousers
underpants:
put on underpants
look in the mirror
wallet, mobile: trousers
put in trouser pockets
t-shirt:
put on t-shirt
walletshoes
trousers
socks underpants
mobile shirt
clothes
<>
$ make clothes
wash your foot
put on socks
put on underpants
look in the mirror
put on trousers
make shoes clean
put on shoes
put wallet in trouser pockets
put mobile in trouser pockets
put on t-shirt
Broadlinux | Linux of Things
Learn from Yacc and Lex
12
Lexical analyzer
Syntax analyzer
Lex
Yacc
a = b + c * d
id1
=
+
*id2
id3 id4
patterns
grammar
Source code
id1 = id2 + id3 * id4Tokens
Syntax tree
Code generator
load id3
mul id4
add id2
store id1
Generated code
ïŹ The basic building blocks of a compiler
Broadlinux | Linux of Things
make architecture
13
sum (exe)
sum.omain.o
sum.h sum.cmain.c
Makefile
make analyzer
Dependency
Graph
$ make sum
$ gcc –c main.c
$ gcc –c sum.c
$ gcc –o sum main.o sum.o
Build command
Shell commands
# target prerequisite command
# ------------------------------------------------
sum main.o, sum.o gcc –o sum main.o sum.o
main.o main.c, main.h gcc –c main.c
sum.o sum.c, sum.h gcc –c sum.c
Semantic graph
make processor
Makefile
make
1
2
$ com1
$ com2 $ com3
Rule syntax
Broadlinux | Linux of Things
New cycle of program development
14
think — edit — make — test
Broadlinux | Linux of Things 15
You don’t get everything right at the first time
<tab>
Broadlinux | Linux of Things
The worst ever made
ïŹ What we see
ïŹ What it is
ïŹ The interpretation of a makefile can change drastically on the basis
of invisible differences in whitespace.
ïŹ “I had a user population of about a dozen, most of them friends, and
I didn’t want to screw up my embedded base. The rest, sadly, is
history.” -- Stuart Feldman --
16
Broadlinux | Linux of Things
The creativity in work
The lesson from make
17
Stuart Feldman
Google Vice President of Engineering
“
“
Bell Lab, 1977
Copyright© 2014 DASAN Networks, Inc.
”It became possible to go home in the evening while
leaving behind long runcoms executing overnight.”
LOUIS POUZIN
1931, France
Broadlinux | Linux of Things
Reference
ïŹ Make a program for maintaining computer programs
https://www.researchgate.net/publication/220280049_Make-
A_Program_for_Maintaining_Computer_Programs
ïŹ The Art of Unix Programming by Eric Steven Raymond
ïŹ What’s Wrong With GNU make? http://www.conifersystems.com/whitepapers/gnu-
make/
ïŹ Make for data scientists http://blog.kaggle.com/2012/10/15/make-for-data-scientists/
ïŹ Introduction to making Makefiles
http://www.jfranken.de/homepages/johannes/vortraege/make_inhalt.en.html
20
Broadlinux | Linux of Things 21
Thank you!

Weitere Àhnliche Inhalte

Andere mochten auch

ComparaciĂłn entre skydrive, google drive, zoho docs y thinkfree
ComparaciĂłn entre skydrive, google drive, zoho docs y thinkfreeComparaciĂłn entre skydrive, google drive, zoho docs y thinkfree
ComparaciĂłn entre skydrive, google drive, zoho docs y thinkfreeSenovia_Sarango
 
Presentación Isabel Muñoz-Presidenta del Consejo de Defensa de la Competencia...
Presentación Isabel Muñoz-Presidenta del Consejo de Defensa de la Competencia...Presentación Isabel Muñoz-Presidenta del Consejo de Defensa de la Competencia...
Presentación Isabel Muñoz-Presidenta del Consejo de Defensa de la Competencia...CompetenciaAnd
 
SOLID Ruby SOLID Rails
SOLID Ruby SOLID RailsSOLID Ruby SOLID Rails
SOLID Ruby SOLID RailsMichael Mahlberg
 
UnME jeans:Branding in web 2
UnME jeans:Branding in web 2UnME jeans:Branding in web 2
UnME jeans:Branding in web 2Sameer Mathur
 
Campaña Vanilla Dee Lite | LUSH
Campaña Vanilla Dee Lite | LUSHCampaña Vanilla Dee Lite | LUSH
Campaña Vanilla Dee Lite | LUSHBenito Guerrero
 
Facebook Comparison Report of Top Casinos on the Las Vegas Strip
Facebook Comparison Report of Top Casinos on the Las Vegas StripFacebook Comparison Report of Top Casinos on the Las Vegas Strip
Facebook Comparison Report of Top Casinos on the Las Vegas StripUnmetric
 
ARQUITECTURA DEL COMPUTADOR (Plantilla fase 1)
ARQUITECTURA DEL COMPUTADOR (Plantilla fase 1)ARQUITECTURA DEL COMPUTADOR (Plantilla fase 1)
ARQUITECTURA DEL COMPUTADOR (Plantilla fase 1)DvdM1
 
Reporte sexualidad y familia
Reporte sexualidad y familiaReporte sexualidad y familia
Reporte sexualidad y familiadelacruzs
 
La imagen en la escuela Vs el texto
La imagen en la escuela Vs el textoLa imagen en la escuela Vs el texto
La imagen en la escuela Vs el textoMarisa Elena Conde
 
Pronouns (personal, possesive, demostrative, reflexive)
Pronouns (personal, possesive, demostrative, reflexive)Pronouns (personal, possesive, demostrative, reflexive)
Pronouns (personal, possesive, demostrative, reflexive)Patty Silis
 
Lax Vox (MĂštode Rehabilitador Vocal)
Lax Vox (MĂštode Rehabilitador Vocal)Lax Vox (MĂštode Rehabilitador Vocal)
Lax Vox (MĂštode Rehabilitador Vocal)FoniatriaBonet
 

Andere mochten auch (18)

Fundamentos de mercadeo
Fundamentos de mercadeoFundamentos de mercadeo
Fundamentos de mercadeo
 
La viejecita dichosa
La viejecita dichosaLa viejecita dichosa
La viejecita dichosa
 
medikamente-per-klick.de
medikamente-per-klick.demedikamente-per-klick.de
medikamente-per-klick.de
 
ComparaciĂłn entre skydrive, google drive, zoho docs y thinkfree
ComparaciĂłn entre skydrive, google drive, zoho docs y thinkfreeComparaciĂłn entre skydrive, google drive, zoho docs y thinkfree
ComparaciĂłn entre skydrive, google drive, zoho docs y thinkfree
 
Presentación Isabel Muñoz-Presidenta del Consejo de Defensa de la Competencia...
Presentación Isabel Muñoz-Presidenta del Consejo de Defensa de la Competencia...Presentación Isabel Muñoz-Presidenta del Consejo de Defensa de la Competencia...
Presentación Isabel Muñoz-Presidenta del Consejo de Defensa de la Competencia...
 
Rg 463
Rg 463Rg 463
Rg 463
 
MASAIGO
MASAIGOMASAIGO
MASAIGO
 
SOLID Ruby SOLID Rails
SOLID Ruby SOLID RailsSOLID Ruby SOLID Rails
SOLID Ruby SOLID Rails
 
UnME jeans:Branding in web 2
UnME jeans:Branding in web 2UnME jeans:Branding in web 2
UnME jeans:Branding in web 2
 
Campaña Vanilla Dee Lite | LUSH
Campaña Vanilla Dee Lite | LUSHCampaña Vanilla Dee Lite | LUSH
Campaña Vanilla Dee Lite | LUSH
 
Facebook Comparison Report of Top Casinos on the Las Vegas Strip
Facebook Comparison Report of Top Casinos on the Las Vegas StripFacebook Comparison Report of Top Casinos on the Las Vegas Strip
Facebook Comparison Report of Top Casinos on the Las Vegas Strip
 
ARQUITECTURA DEL COMPUTADOR (Plantilla fase 1)
ARQUITECTURA DEL COMPUTADOR (Plantilla fase 1)ARQUITECTURA DEL COMPUTADOR (Plantilla fase 1)
ARQUITECTURA DEL COMPUTADOR (Plantilla fase 1)
 
Reporte sexualidad y familia
Reporte sexualidad y familiaReporte sexualidad y familia
Reporte sexualidad y familia
 
La imagen en la escuela Vs el texto
La imagen en la escuela Vs el textoLa imagen en la escuela Vs el texto
La imagen en la escuela Vs el texto
 
Pronouns (personal, possesive, demostrative, reflexive)
Pronouns (personal, possesive, demostrative, reflexive)Pronouns (personal, possesive, demostrative, reflexive)
Pronouns (personal, possesive, demostrative, reflexive)
 
Catalogo de acabados
Catalogo de acabadosCatalogo de acabados
Catalogo de acabados
 
Vagrant
VagrantVagrant
Vagrant
 
Lax Vox (MĂštode Rehabilitador Vocal)
Lax Vox (MĂštode Rehabilitador Vocal)Lax Vox (MĂštode Rehabilitador Vocal)
Lax Vox (MĂštode Rehabilitador Vocal)
 

Ähnlich wie Makefile Martial Arts - Chapter 1. The morning of creation

Programming Sessions KU Leuven - Session 01
Programming Sessions KU Leuven - Session 01Programming Sessions KU Leuven - Session 01
Programming Sessions KU Leuven - Session 01Rafael Camacho Dejay
 
Makefile
MakefileMakefile
MakefileIonela
 
Shamsa altayer
Shamsa altayerShamsa altayer
Shamsa altayershamsaot
 
Pain Driven Development by Alexandr Sugak
Pain Driven Development by Alexandr SugakPain Driven Development by Alexandr Sugak
Pain Driven Development by Alexandr SugakSigma Software
 
Applying the Unix Philosophy to Django projects: a report from the real world
Applying the Unix Philosophy to Django projects: a report from the real worldApplying the Unix Philosophy to Django projects: a report from the real world
Applying the Unix Philosophy to Django projects: a report from the real worldFederico Capoano
 
Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"LogeekNightUkraine
 
Old Is the New New
Old Is the New NewOld Is the New New
Old Is the New NewKevlin Henney
 
Linux principles and philosophy
Linux principles and philosophyLinux principles and philosophy
Linux principles and philosophyaliabintouq
 
The UNIX philosophy
The UNIX philosophyThe UNIX philosophy
The UNIX philosophyKevin Maiyo
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Henry Schreiner
 
Pilot Tech Talk #10 — Practical automation by Kamil CholewiƄski
Pilot Tech Talk #10 — Practical automation by Kamil CholewiƄskiPilot Tech Talk #10 — Practical automation by Kamil CholewiƄski
Pilot Tech Talk #10 — Practical automation by Kamil CholewiƄskiPilot
 
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)Alexandre Gouaillard
 
J+s
J+sJ+s
J+shappyuk
 
Go programming language
Go programming languageGo programming language
Go programming languageAppstud
 
Rolling Your Own Embedded Linux Distribution
Rolling  Your  Own  Embedded  Linux  DistributionRolling  Your  Own  Embedded  Linux  Distribution
Rolling Your Own Embedded Linux DistributionEmanuele Bonanni
 
please use only these Part 1 Organize the code 85 Fo.pdf
please use only these   Part 1 Organize the code 85  Fo.pdfplease use only these   Part 1 Organize the code 85  Fo.pdf
please use only these Part 1 Organize the code 85 Fo.pdfableelectronics
 
Digital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meetingDigital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meetingHenry Schreiner
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make filesropsu
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned RightScale
 

Ähnlich wie Makefile Martial Arts - Chapter 1. The morning of creation (20)

Programming Sessions KU Leuven - Session 01
Programming Sessions KU Leuven - Session 01Programming Sessions KU Leuven - Session 01
Programming Sessions KU Leuven - Session 01
 
Makefile
MakefileMakefile
Makefile
 
Shamsa altayer
Shamsa altayerShamsa altayer
Shamsa altayer
 
Pain Driven Development by Alexandr Sugak
Pain Driven Development by Alexandr SugakPain Driven Development by Alexandr Sugak
Pain Driven Development by Alexandr Sugak
 
Applying the Unix Philosophy to Django projects: a report from the real world
Applying the Unix Philosophy to Django projects: a report from the real worldApplying the Unix Philosophy to Django projects: a report from the real world
Applying the Unix Philosophy to Django projects: a report from the real world
 
Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"
 
Old Is the New New
Old Is the New NewOld Is the New New
Old Is the New New
 
Linux principles and philosophy
Linux principles and philosophyLinux principles and philosophy
Linux principles and philosophy
 
The UNIX philosophy
The UNIX philosophyThe UNIX philosophy
The UNIX philosophy
 
Linux Day2
Linux Day2Linux Day2
Linux Day2
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024
 
Pilot Tech Talk #10 — Practical automation by Kamil CholewiƄski
Pilot Tech Talk #10 — Practical automation by Kamil CholewiƄskiPilot Tech Talk #10 — Practical automation by Kamil CholewiƄski
Pilot Tech Talk #10 — Practical automation by Kamil CholewiƄski
 
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)
IIT-RTC 2017 Qt WebRTC Tutorial (Qt Janus Client)
 
J+s
J+sJ+s
J+s
 
Go programming language
Go programming languageGo programming language
Go programming language
 
Rolling Your Own Embedded Linux Distribution
Rolling  Your  Own  Embedded  Linux  DistributionRolling  Your  Own  Embedded  Linux  Distribution
Rolling Your Own Embedded Linux Distribution
 
please use only these Part 1 Organize the code 85 Fo.pdf
please use only these   Part 1 Organize the code 85  Fo.pdfplease use only these   Part 1 Organize the code 85  Fo.pdf
please use only these Part 1 Organize the code 85 Fo.pdf
 
Digital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meetingDigital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meeting
 
Composer JSON kills make files
Composer JSON kills make filesComposer JSON kills make files
Composer JSON kills make files
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
 

KĂŒrzlich hochgeladen

%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp KrisztiĂĄn
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 

KĂŒrzlich hochgeladen (20)

%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Abortion Pill Prices Tembisa [(+27832195400*)] đŸ„ Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] đŸ„ Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] đŸ„ Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] đŸ„ Women's Abortion Clinic in T...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
Abortion Pills In Pretoria ](+27832195400*)[ đŸ„ Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ đŸ„ Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ đŸ„ Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ đŸ„ Women's Abortion Clinic In Pre...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 

Makefile Martial Arts - Chapter 1. The morning of creation

  • 2. Broadlinux | Linux of Things 2 Chapter 1
  • 3. Broadlinux | Linux of Things Everything was born for a reason A primitive notion 3
  • 4. Broadlinux | Linux of Things Motivation ïŹ So small programs → single and short file ïŹ “Not so small” programs : ïŹ Many lines of code → long file, harder to manage ïŹ Many programmers → can’t modify the same file simultaneously ïŹ Every change requires long compilation ïŹ Solution: divide large programs into smaller, more manageable pieces with multiple files ïŹ Pros: ïŹ Good division to components ïŹ Easy maintenance of project structure, dependencies and creation 4
  • 5. Broadlinux | Linux of Things Original management approach ïŹ Manual with care, must think of everything ïŹ Compiling and linking by hand becomes tedious ïŹ Use shell scripts to comment out some steps to save processing time ïŹ Early automation used simple make.sh and install.sh scripts ïŹ Easily lose track of: ïŹ which ïŹles depend on which others ïŹ the exact sequence of operations needed to build program ïŹ which ïŹles have been modiïŹed recently ïŹ Recompiling everything in sight just to be safe is very wasteful ïŹ Minimum compilation when something is changed 5 Repair manual Repair the Wheel need to unplug the whole car?
  • 6. Broadlinux | Linux of Things The morning of creation A primitive notion 6
  • 7. Broadlinux | Linux of Things 7 Steve Johnson Stuart Feldman I wasted a morning debugging a program, file hadn't been compiled, cc *.o was therefore unaffected Bell Labs
  • 8. Broadlinux | Linux of Things 8 I met the same disaster on a project I was working on Need a tool to solve it! ♄Make♄ 1977 Bell Labs
  • 9. Broadlinux | Linux of Things make philosophy 9 dependency relationship target commandstimestamp make Sequence of execution commands final target 1. Automate the software building 2. Take minimum of effort Mission
  • 10. Broadlinux | Linux of Things ïŹ A file describes how to generate a particular target file ïŹ Consists a number of rules ïŹ If (target out-of-date with dependencies) then Execute commands to make target up-to-date ïŹ “Everything is a file” Makefile 10 dependency relationship target commands target: dependencies <tab>commands rule
  • 11. Broadlinux | Linux of Things Makefile in Life 11 clothes: shoes wallet mobile t-shirt look in the mirror shoes: socks, trousers make shoes clean put on shoes socks: wash your foot put on socks trousers: underpants put on trousers underpants: put on underpants look in the mirror wallet, mobile: trousers put in trouser pockets t-shirt: put on t-shirt walletshoes trousers socks underpants mobile shirt clothes <> $ make clothes wash your foot put on socks put on underpants look in the mirror put on trousers make shoes clean put on shoes put wallet in trouser pockets put mobile in trouser pockets put on t-shirt
  • 12. Broadlinux | Linux of Things Learn from Yacc and Lex 12 Lexical analyzer Syntax analyzer Lex Yacc a = b + c * d id1 = + *id2 id3 id4 patterns grammar Source code id1 = id2 + id3 * id4Tokens Syntax tree Code generator load id3 mul id4 add id2 store id1 Generated code ïŹ The basic building blocks of a compiler
  • 13. Broadlinux | Linux of Things make architecture 13 sum (exe) sum.omain.o sum.h sum.cmain.c Makefile make analyzer Dependency Graph $ make sum $ gcc –c main.c $ gcc –c sum.c $ gcc –o sum main.o sum.o Build command Shell commands # target prerequisite command # ------------------------------------------------ sum main.o, sum.o gcc –o sum main.o sum.o main.o main.c, main.h gcc –c main.c sum.o sum.c, sum.h gcc –c sum.c Semantic graph make processor Makefile make 1 2 $ com1 $ com2 $ com3 Rule syntax
  • 14. Broadlinux | Linux of Things New cycle of program development 14 think — edit — make — test
  • 15. Broadlinux | Linux of Things 15 You don’t get everything right at the first time <tab>
  • 16. Broadlinux | Linux of Things The worst ever made ïŹ What we see ïŹ What it is ïŹ The interpretation of a makefile can change drastically on the basis of invisible differences in whitespace. ïŹ “I had a user population of about a dozen, most of them friends, and I didn’t want to screw up my embedded base. The rest, sadly, is history.” -- Stuart Feldman -- 16
  • 17. Broadlinux | Linux of Things The creativity in work The lesson from make 17
  • 18. Stuart Feldman Google Vice President of Engineering “ “ Bell Lab, 1977
  • 19. Copyright© 2014 DASAN Networks, Inc. ”It became possible to go home in the evening while leaving behind long runcoms executing overnight.” LOUIS POUZIN 1931, France
  • 20. Broadlinux | Linux of Things Reference ïŹ Make a program for maintaining computer programs https://www.researchgate.net/publication/220280049_Make- A_Program_for_Maintaining_Computer_Programs ïŹ The Art of Unix Programming by Eric Steven Raymond ïŹ What’s Wrong With GNU make? http://www.conifersystems.com/whitepapers/gnu- make/ ïŹ Make for data scientists http://blog.kaggle.com/2012/10/15/make-for-data-scientists/ ïŹ Introduction to making Makefiles http://www.jfranken.de/homepages/johannes/vortraege/make_inhalt.en.html 20
  • 21. Broadlinux | Linux of Things 21 Thank you!