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
Makefilethat builds the software in a way thatAll
*.cfiles are compiled into corresponding*.ofiles ⟶ no linking step!greet.ogoes into a library,libgreet.a(it does not contain amain()function)A program
greet-parameterizedis built by linkinggreet-parameterized.o(containingmain()) againstlibgreet.a.Likewise,
greet-simpleis built by linkinggreet-simple.oagainst the library.
Test the outcome by running the two programs.