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.

cluster_linux Linux cluster_linux_basics Linux Basics cluster_linux_basics_intro Introduction: Concepts and Terminology cluster_linux_basics_shell The Shell (Bash - “Bourne Again Shell”) cluster_linux_toolchain Toolchain, And Cross Development cluster_linux_toolchain_exercises Exercises: Toolchain linux_basics_intro_process Processes, Scheduling, Address Spaces linux_basics_intro_overview Overview linux_basics_intro_process->linux_basics_intro_overview linux_basics_shell_paths Absolute and Relative Paths linux_basics_shell_commandline Commandline linux_basics_shell_paths->linux_basics_shell_commandline linux_basics_shell_file_dir_create_rm Creating And Removing Files and Directories linux_basics_shell_file_dir_create_rm->linux_basics_shell_paths linux_basics_shell_cwd Current Working Directory linux_basics_shell_file_dir_create_rm->linux_basics_shell_cwd linux_basics_shell_cwd->linux_basics_intro_process linux_basics_shell_cwd->linux_basics_shell_paths linux_basics_shell_cwd->linux_basics_shell_commandline linux_basics_shell_commandline->linux_basics_intro_overview linux_toolchain_basics Toolchain: Basics linux_toolchain_basics->linux_basics_shell_file_dir_create_rm linux_toolchain_static_library Object Code Archives/Static Libraries linux_toolchain_separate_compilation Zooming In: Separate Compilation, and Linking Statically linux_toolchain_static_library->linux_toolchain_separate_compilation linux_toolchain_separate_compilation->linux_toolchain_basics linux_toolchain_exercises_native_build Exercise: Build Software Package (Native) linux_toolchain_exercises_native_build->linux_toolchain_static_library