From 4cfd5b43dab83d5e99b0ce50a69c4d60cd0be388 Mon Sep 17 00:00:00 2001 From: Kai Krakow Date: Tue, 16 Jan 2018 00:06:06 +0100 Subject: [PATCH] Makefile: generalize .so target We can generalize the .so target by moving its depends into rules without build instructions. Signed-off-by: Kai Krakow --- lib/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index aedcdc9..9ac78bc 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -1,6 +1,7 @@ TAG := $(shell git describe --always --dirty || echo UNKNOWN) default: libcrucible.so +%.so: Makefile OBJS = \ chatter.o \ @@ -19,6 +20,8 @@ OBJS = \ uuid.o \ .version.o \ +libcrucible.so: $(OBJS) + include ../makeflags depends.mk: *.cc @@ -34,5 +37,5 @@ include depends.mk %.o: %.cc ../makeflags $(CXX) $(CXXFLAGS) -fPIC -o $@ -c $< -libcrucible.so: $(OBJS) Makefile - $(CXX) $(LDFLAGS) -fPIC -o $@ $(OBJS) -shared -Wl,-soname,$@ -luuid +%.so: + $(CXX) $(LDFLAGS) -fPIC -o $@ $^ -shared -Wl,-soname,$@ -luuid