Skip to content

Makefile: add STATIC and DYNAMIC build variables#9

Open
hmenke wants to merge 1 commit intoaltlinux:masterfrom
hmenke:static
Open

Makefile: add STATIC and DYNAMIC build variables#9
hmenke wants to merge 1 commit intoaltlinux:masterfrom
hmenke:static

Conversation

@hmenke
Copy link
Copy Markdown

@hmenke hmenke commented Apr 9, 2026

This change adds two new Makefile variables, STATIC and DYNAMIC, which provide control over whether the static and shared libraries are built and installed.

The STATIC variable defaults to 0 and, when set to 1, builds and installs the static library libutempter.a. The DYNAMIC variable defaults to 1 and, when set to 1, builds and installs the shared library libutempter.so. Setting either variable to 0 skips building and installing the corresponding library.

When neither variable is touched on the command line, the old behavior is preserved: the shared library is built and installed as before, while the static library is not built or installed.

Users can now selectively build either library or both. For example, running make STATIC=1 builds both libraries, while make DYNAMIC=0 STATIC=1 builds only the static library. Similarly, the install target respects these variables, so make install STATIC=1 installs both libraries and make install DYNAMIC=0 STATIC=1 installs only the static library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant