From 1392e8c659e0b8de8ac07fcdbd27550748182b00 Mon Sep 17 00:00:00 2001 From: Attila Kovacs Date: Tue, 15 Oct 2024 14:06:42 -0400 Subject: [PATCH] Makefile: No order-only dependencies (part 2) --- build.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.mk b/build.mk index 562af0d..3f4251e 100644 --- a/build.mk +++ b/build.mk @@ -10,19 +10,19 @@ $(OBJ)/%.o: %.c dep/%.d $(OBJ) Makefile $(CC) -o $@ -c $(CPPFLAGS) $(CFLAGS) $< -# Share librarry recipe -$(LIB)/%.so.$(SO_VERSION) : | $(LIB) Makefile +# Share library recipe +$(LIB)/%.so.$(SO_VERSION) : + @if [ ! -e $(LIB) ] ; then make $(LIB); fi $(CC) -o $@ $(CPPFLAGS) $(CFLAGS) $^ -shared -fPIC -Wl,-soname,$(subst $(LIB)/,,$@) $(LDFLAGS) # Unversioned shared libs (for linking against) $(LIB)/lib%.so: - @if [ ! -e $(LIB) ] ; then mkdir $(LIB); fi @rm -f $@ ln -sr $< $@ # Static library: *.a $(LIB)/%.a: - @if [ ! -e $(LIB) ] ; then mkdir $(LIB); fi + @if [ ! -e $(LIB) ] ; then make $(LIB); fi ar -rc $@ $^ ranlib $@