Exercise: Build Software Package (Native)

  • Download the tar file (Software.tar.xz)

  • Unpack it with the following command:

    $ tar -J -x -f Software.tar.xz
    
  • You’ll see a directory, Software/, a follows

    $ tree Software/
    Software/
    ├── greet.c
    ├── greet.h
    ├── greet-parameterized.c
    └── greet-simple.c
    
  • Write a Makefile that builds the software in a way that

    • All *.c files are compiled into corresponding *.o files ⟶ no linking step!

    • greet.o goes into a library, libgreet.a (it does not contain a main() function)

    • A program greet-parameterized is built by linking greet-parameterized.o (containing main()) against libgreet.a.

    • Likewise, greet-simple is built by linking greet-simple.o against the library.

  • Test the outcome by running the two programs.