Seminar 8 (CPP)

8


C/CPP build. Shared libraries. GNU Make.

Slides

Tasks

Use /usr/local! Otherwise, you may break package manager.

If you have non-debian OS, use fenrir task sems/bash && fenrir env up PROJECT_DIR.

Task 0

Use dep-v1 directory.

Create a Makefile, containing targets clean, all (must be executed when running make), which creates a dynamic library logger. It’s name must be liblogger.so.1.1.

Create a target install which installs the library on your system.

Use install command

Task 1

Use binary directory.

Create a Makefile, containing targets clean, all (must be executed when running make), which creates a binary screamer from main.cc.

It depends on the logger library

Create a target install which installs the binary on your system.

Task 2

Create a similar Makefile for dep-v2: it’s name must be liblogger.so.1.2. Install the library and rerun the binary. You must see changes.

Task 3

Merge dep-v1 and binary into a single C++ project. Create a unified Makefile. Add a target pack which builds a deb package from your project. It must have 1.0.0 version. Install it and check screamer works fine.

Task 4

Now replace dep-v1's code with dev-v2. Create a deb package with 2.0.0 version. Install the package and check screamer.