SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
GCC(GNU Compiler Collection)
         Tool Kit



         Linux Users Group, JMI

An overview of GNU Compiler Collection and
         its use for compiling C, C++

           By: Saleem A. Ansari
The Free Software Compiler
          An Introduction to GCC
   Virtually all other open software is based on it at
    some level or another. Even other languages,
    such as Perl and Python, are written in C, which
    is compiled by the GNU compiler.
   This piece of software is more fundamental to
    the entire free software movement than any
    other. In fact, without it or something like it,
    there would be no free software movement. Lin-
    ux is possible because of GCC.
GCC is a product of the GNU
                  Project.
   The fundamental language of GCC is C. The en-
    tire compiler system began as a C compiler and,
    over time, the other languages were added to it.
   C++ Was the First Addition. Now can compile
    C++, Objective-C, Java, Ada, Fortran ...
   The GCC set of compilers runs on many plat-
    forms. We can do multi-platform compilation us-
    ing the same machine. (Alpha, HPPA, Intel x86,
    MIPS, PowerPC, Sparc)
GCC Components
   cc1: The actual C compiler.
   cc : A version of gcc that sets the default lan-
    guage to C and automatically includes the
    standard C libraries when linking.
   cc1plus : The actual C++ compiler.
   g++ / c++ : A version of gcc that sets the default
    language to C++.
   jc1: The actual Java compiler.
   gcj The driver program used to compile Java.
   gcc: The driver program.
GCC Components contd.
   as : The GNU assembler. It is really a family of
    assemblers because it can be compiled to work
    with one of several different platforms. This pro-
    gram is part of the binutils package.
   gdb : The GNU debugger, which can be used to
    examine the values and actions inside a pro-
    gram while it is running.
   Other tools : gprof (profiler), ld(linker),
    ar(archive), make, nm, objcopy, objdump, ranlib,
    strip ...
Developing Software using GCC

   You need a text editor: gedit, kedit, vi
    emacs, joe, nedit etc.
   You need to learn atleast one of the lan-
    guages supported by GCC: C, C++, Java,
    Fortran etc.
   You need the GCC Toolkit Installed on the
    system itself
   get-set-go...
The famous C program
/*hello.c*/
#include<stdio.h>
int main()
{
     printf(“Hello GCCn”);
     return 0;
}

Compilation:
cc ­c hello.c
cc ­o hello hello.o
./hello
The famous program in C++
/*hello.cpp*/
#include<iostream>
using namespace std;
int main(void)
{
      cout << “Hello GCC” << endl;
      return 0;
}

Compilation:
c++ ­c hello.cpp
c++ ­o hello hello.o
./hello
Command Line Options
   -c compile and produce object
    code
   -o name of translated code file
   -l specify library
   -I specify include directory
   -Wall show all errors
   -std=__ assume the specified
    standard
   -v give verbose output
   -s, -S result in assembly code
    production
   -O1, O2, -O3 Optimization Levels
Yet another simple example. Illegal
         memory access!!
 #include<stdio.h>
 int main()
 {
 char *str=”abc”;
 str[0]=’d’;
 str[1]=’e’;
 str[2]=’f’;
 puts(str);
 return 0;
 }
Here comes the debugger

   Use the GCC command line switch -g or
    -ggdb to incorporate debugging information
    into the object code
   Invoke the gdb and fire!!
Multiple Files: A simple example

/*mystring.c*/
#include<string.h>               /*mystring.h*/
int palindrome(char s[])         int palindrome(char s[]);
{
      int l=strlen(s)-1;
      int i=0;
      while(i<l)
            if(s[i++]!=s[l--])
                   return 0;
      return 1;
}
/*mystringtest.c*/
                        continued...
#include<stdio.h>
#include "mystring.h"
int main()
{
      char str[50];
      puts("Enter a string:");
      gets(str);
      if(palindrome(str))
             printf("Its a palindrome");
      else
             printf("Its not a palindrome");
      return 0;
}
MAKE indeed is a boon
MAKEFILE
--------------------------------------------------------------------------
CC=gcc
CFLAGS=-Wall -g
all: mystring.a test
test: mystring.a
        $(CC) $(CFLAGS) -c mystringtest.c
        $(CC) $(CFLAGS) -o test mystringtest.o mystring.a
clean:
        rm -f test mystringtest.o mystring.o mystring.a
mystring.a: mystring.o
        ar cvr mystring.a mystring.o
        ranlib mystring.a
mystring.o:
        $(CC) $(CFLAGS) -c mystring.c
Compiling a complete software




 MPlayer as an example demonstration
For further information

   Manpages of gcc, make, gdb, nm, obj-
    dump, objcopy...
   Info pages of binutils
Thats all for now!




      Thanx

Weitere ähnliche Inhalte

Was ist angesagt?

GEM - GNU C Compiler Extensions Framework
GEM - GNU C Compiler Extensions FrameworkGEM - GNU C Compiler Extensions Framework
GEM - GNU C Compiler Extensions Framework
Alexey Smirnov
 
Debugging With GNU Debugger GDB
Debugging With GNU Debugger GDBDebugging With GNU Debugger GDB
Debugging With GNU Debugger GDB
kyaw thiha
 
Разработка кросс-платформенного кода между iPhone &lt; -> Windows с помощью o...
Разработка кросс-платформенного кода между iPhone &lt; -> Windows с помощью o...Разработка кросс-платформенного кода между iPhone &lt; -> Windows с помощью o...
Разработка кросс-платформенного кода между iPhone &lt; -> Windows с помощью o...
Yandex
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
Alpana Gupta
 
Claire protorpc
Claire protorpcClaire protorpc
Claire protorpc
Fan Robbin
 
Turbo C Compiler Reports
Turbo C Compiler Reports Turbo C Compiler Reports
Turbo C Compiler Reports
Sunil Kumar R
 
Gdb tutorial-handout
Gdb tutorial-handoutGdb tutorial-handout
Gdb tutorial-handout
Suraj Kumar
 

Was ist angesagt? (20)

GCC compiler
GCC compilerGCC compiler
GCC compiler
 
How it's made: C++ compilers (GCC)
How it's made: C++ compilers (GCC)How it's made: C++ compilers (GCC)
How it's made: C++ compilers (GCC)
 
introduction of c langauge(I unit)
introduction of c langauge(I unit)introduction of c langauge(I unit)
introduction of c langauge(I unit)
 
C compilation process
C compilation processC compilation process
C compilation process
 
GEM - GNU C Compiler Extensions Framework
GEM - GNU C Compiler Extensions FrameworkGEM - GNU C Compiler Extensions Framework
GEM - GNU C Compiler Extensions Framework
 
Debugging Applications with GNU Debugger
Debugging Applications with GNU DebuggerDebugging Applications with GNU Debugger
Debugging Applications with GNU Debugger
 
Debugging With GNU Debugger GDB
Debugging With GNU Debugger GDBDebugging With GNU Debugger GDB
Debugging With GNU Debugger GDB
 
C++ compilation process
C++ compilation processC++ compilation process
C++ compilation process
 
Fp201 unit2 1
Fp201 unit2 1Fp201 unit2 1
Fp201 unit2 1
 
Разработка кросс-платформенного кода между iPhone &lt; -> Windows с помощью o...
Разработка кросс-платформенного кода между iPhone &lt; -> Windows с помощью o...Разработка кросс-платформенного кода между iPhone &lt; -> Windows с помощью o...
Разработка кросс-платформенного кода между iPhone &lt; -> Windows с помощью o...
 
Gnu debugger
Gnu debuggerGnu debugger
Gnu debugger
 
GCC RTL and Machine Description
GCC RTL and Machine DescriptionGCC RTL and Machine Description
GCC RTL and Machine Description
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Advanced Debugging with GDB
Advanced Debugging with GDBAdvanced Debugging with GDB
Advanced Debugging with GDB
 
LLVM Compiler - Link Time Optimization
LLVM Compiler - Link Time OptimizationLLVM Compiler - Link Time Optimization
LLVM Compiler - Link Time Optimization
 
Claire protorpc
Claire protorpcClaire protorpc
Claire protorpc
 
Turbo C Compiler Reports
Turbo C Compiler Reports Turbo C Compiler Reports
Turbo C Compiler Reports
 
IDE as a Front-end and Fast time-to-market language support in Eclipse IDE re...
IDE as a Front-end and Fast time-to-market language support in Eclipse IDE re...IDE as a Front-end and Fast time-to-market language support in Eclipse IDE re...
IDE as a Front-end and Fast time-to-market language support in Eclipse IDE re...
 
Gdb tutorial-handout
Gdb tutorial-handoutGdb tutorial-handout
Gdb tutorial-handout
 
Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c language
 

Andere mochten auch

Principles of compiler design
Principles of compiler designPrinciples of compiler design
Principles of compiler design
Janani Parthiban
 

Andere mochten auch (8)

HRM - PM in GCC
HRM - PM in GCCHRM - PM in GCC
HRM - PM in GCC
 
Introduction to Perl - Day 1
Introduction to Perl - Day 1Introduction to Perl - Day 1
Introduction to Perl - Day 1
 
Gcc opt
Gcc optGcc opt
Gcc opt
 
MinGw Compiler
MinGw CompilerMinGw Compiler
MinGw Compiler
 
Principles of compiler design
Principles of compiler designPrinciples of compiler design
Principles of compiler design
 
NetBeans para Java, C, C++
NetBeans para Java, C, C++NetBeans para Java, C, C++
NetBeans para Java, C, C++
 
Deep C
Deep CDeep C
Deep C
 
GCC
GCCGCC
GCC
 

Ähnlich wie GNU Compiler Collection - August 2005

20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
eugeniadean34240
 

Ähnlich wie GNU Compiler Collection - August 2005 (20)

C introduction by piyushkumar
C introduction by piyushkumarC introduction by piyushkumar
C introduction by piyushkumar
 
1 c introduction
1 c introduction1 c introduction
1 c introduction
 
gcc and friends
gcc and friendsgcc and friends
gcc and friends
 
ICT1002-W8-LEC-Introduction-to-C.pdf
ICT1002-W8-LEC-Introduction-to-C.pdfICT1002-W8-LEC-Introduction-to-C.pdf
ICT1002-W8-LEC-Introduction-to-C.pdf
 
C Programming Tutorial - www.infomtec.com
C Programming Tutorial - www.infomtec.comC Programming Tutorial - www.infomtec.com
C Programming Tutorial - www.infomtec.com
 
lab1-ppt.pdf
lab1-ppt.pdflab1-ppt.pdf
lab1-ppt.pdf
 
C programming first_session
C programming first_sessionC programming first_session
C programming first_session
 
C programming first_session
C programming first_sessionC programming first_session
C programming first_session
 
GCC
GCCGCC
GCC
 
Hidden Dragons of CGO
Hidden Dragons of CGOHidden Dragons of CGO
Hidden Dragons of CGO
 
Mender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and GolangMender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and Golang
 
C++Basics2022.pptx
C++Basics2022.pptxC++Basics2022.pptx
C++Basics2022.pptx
 
Csdfsadf
CsdfsadfCsdfsadf
Csdfsadf
 
C
CC
C
 
C
CC
C
 
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
 
Golang execution modes
Golang execution modesGolang execution modes
Golang execution modes
 
Advance Android Application Development
Advance Android Application DevelopmentAdvance Android Application Development
Advance Android Application Development
 
Introduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).docIntroduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).doc
 
Introduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxIntroduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptx
 

Mehr von Saleem Ansari (10)

Web Application Development
Web Application DevelopmentWeb Application Development
Web Application Development
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Lessons I learnt from Linux Asia 2006
Lessons I learnt from Linux Asia 2006Lessons I learnt from Linux Asia 2006
Lessons I learnt from Linux Asia 2006
 
Linx Asia 2006 Experience
Linx Asia 2006 ExperienceLinx Asia 2006 Experience
Linx Asia 2006 Experience
 
Introduction to Qt Designer
Introduction to Qt DesignerIntroduction to Qt Designer
Introduction to Qt Designer
 
Linux Asia 2006
Linux Asia 2006Linux Asia 2006
Linux Asia 2006
 
Introduction to Free and Open Source Software - August 2005
Introduction to Free and Open Source Software - August 2005Introduction to Free and Open Source Software - August 2005
Introduction to Free and Open Source Software - August 2005
 
JMILUG Introduction - 2007
JMILUG Introduction - 2007JMILUG Introduction - 2007
JMILUG Introduction - 2007
 
TorqueBox at GNUnify 2012
TorqueBox at GNUnify 2012TorqueBox at GNUnify 2012
TorqueBox at GNUnify 2012
 
Fedora Embedded at foss.in 2010
Fedora Embedded at foss.in 2010Fedora Embedded at foss.in 2010
Fedora Embedded at foss.in 2010
 

Kürzlich hochgeladen

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

GNU Compiler Collection - August 2005

  • 1. GCC(GNU Compiler Collection) Tool Kit Linux Users Group, JMI An overview of GNU Compiler Collection and its use for compiling C, C++ By: Saleem A. Ansari
  • 2. The Free Software Compiler An Introduction to GCC  Virtually all other open software is based on it at some level or another. Even other languages, such as Perl and Python, are written in C, which is compiled by the GNU compiler.  This piece of software is more fundamental to the entire free software movement than any other. In fact, without it or something like it, there would be no free software movement. Lin- ux is possible because of GCC.
  • 3. GCC is a product of the GNU Project.  The fundamental language of GCC is C. The en- tire compiler system began as a C compiler and, over time, the other languages were added to it.  C++ Was the First Addition. Now can compile C++, Objective-C, Java, Ada, Fortran ...  The GCC set of compilers runs on many plat- forms. We can do multi-platform compilation us- ing the same machine. (Alpha, HPPA, Intel x86, MIPS, PowerPC, Sparc)
  • 4. GCC Components  cc1: The actual C compiler.  cc : A version of gcc that sets the default lan- guage to C and automatically includes the standard C libraries when linking.  cc1plus : The actual C++ compiler.  g++ / c++ : A version of gcc that sets the default language to C++.  jc1: The actual Java compiler.  gcj The driver program used to compile Java.  gcc: The driver program.
  • 5. GCC Components contd.  as : The GNU assembler. It is really a family of assemblers because it can be compiled to work with one of several different platforms. This pro- gram is part of the binutils package.  gdb : The GNU debugger, which can be used to examine the values and actions inside a pro- gram while it is running.  Other tools : gprof (profiler), ld(linker), ar(archive), make, nm, objcopy, objdump, ranlib, strip ...
  • 6. Developing Software using GCC  You need a text editor: gedit, kedit, vi emacs, joe, nedit etc.  You need to learn atleast one of the lan- guages supported by GCC: C, C++, Java, Fortran etc.  You need the GCC Toolkit Installed on the system itself  get-set-go...
  • 7. The famous C program /*hello.c*/ #include<stdio.h> int main() { printf(“Hello GCCn”); return 0; } Compilation: cc ­c hello.c cc ­o hello hello.o ./hello
  • 8. The famous program in C++ /*hello.cpp*/ #include<iostream> using namespace std; int main(void) { cout << “Hello GCC” << endl; return 0; } Compilation: c++ ­c hello.cpp c++ ­o hello hello.o ./hello
  • 9. Command Line Options  -c compile and produce object code  -o name of translated code file  -l specify library  -I specify include directory  -Wall show all errors  -std=__ assume the specified standard  -v give verbose output  -s, -S result in assembly code production  -O1, O2, -O3 Optimization Levels
  • 10. Yet another simple example. Illegal memory access!! #include<stdio.h> int main() { char *str=”abc”; str[0]=’d’; str[1]=’e’; str[2]=’f’; puts(str); return 0; }
  • 11. Here comes the debugger  Use the GCC command line switch -g or -ggdb to incorporate debugging information into the object code  Invoke the gdb and fire!!
  • 12. Multiple Files: A simple example /*mystring.c*/ #include<string.h> /*mystring.h*/ int palindrome(char s[]) int palindrome(char s[]); { int l=strlen(s)-1; int i=0; while(i<l) if(s[i++]!=s[l--]) return 0; return 1; }
  • 13. /*mystringtest.c*/ continued... #include<stdio.h> #include "mystring.h" int main() { char str[50]; puts("Enter a string:"); gets(str); if(palindrome(str)) printf("Its a palindrome"); else printf("Its not a palindrome"); return 0; }
  • 14. MAKE indeed is a boon MAKEFILE -------------------------------------------------------------------------- CC=gcc CFLAGS=-Wall -g all: mystring.a test test: mystring.a $(CC) $(CFLAGS) -c mystringtest.c $(CC) $(CFLAGS) -o test mystringtest.o mystring.a clean: rm -f test mystringtest.o mystring.o mystring.a mystring.a: mystring.o ar cvr mystring.a mystring.o ranlib mystring.a mystring.o: $(CC) $(CFLAGS) -c mystring.c
  • 15. Compiling a complete software MPlayer as an example demonstration
  • 16. For further information  Manpages of gcc, make, gdb, nm, obj- dump, objcopy...  Info pages of binutils
  • 17. Thats all for now! Thanx