aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClark Williams <williams@redhat.com>2020-09-10 15:06:55 -0500
committerClark Williams <williams@redhat.com>2020-09-10 15:06:55 -0500
commit1a00487ea7176edba48134d4f98fcb7c94a1ae53 (patch)
tree4ab206dbffc2e0e5567be7850de03645cfdaadde
parentd1eb0e101104844f785980be11b3b4d73a5b695d (diff)
downloadstalld-1a00487ea7176edba48134d4f98fcb7c94a1ae53.tar.gz
Makefile: add 'static' target to link stalld statically
This will link the stalld program statically which will reduce dependency issues on container platforms for things like libpthread and librt. Note that the glibc-static package is required on Fedora/RHEL. Signed-off-by: Clark Williams <williams@redhat.com>
-rw-r--r--Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 51b8d9e..0be4a1c 100644
--- a/Makefile
+++ b/Makefile
@@ -20,6 +20,9 @@ LICDIR := $(DATADIR)/licenses
all: src/stalld.o
$(CC) -o stalld $(LDFLAGS) src/stalld.o $(LIBS)
+static: src/stalld.o
+ $(CC) -o stalld-static $(LDFLAGS) --static src/stalld.o $(LIBS)
+
.PHONY: install
install:
$(INSTALL) -m 755 -d $(DESTDIR)$(BINDIR) $(DESTDIR)$(DOCDIR)
@@ -33,6 +36,7 @@ install:
.PHONY: clean tarball redhat push
clean:
@test ! -f stalld || rm stalld
+ @test ! -f stalld-static || rm stalld-static
@test ! -f src/stalld.o || rm src/stalld.o
@test ! -f $(TARBALL) || rm -f $(TARBALL)
@make -C redhat clean