diff --git a/src/Makefile b/src/Makefile index 4b221e6546b..fbe1e5768e8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -534,6 +534,7 @@ genclean: find . -name '*.o' |xargs rm -f -rm -rf objects -rm -f $(TARGETS) + -rm -f ../lib/*.so.[0-9]* -rm -f $(GENERATED_MANPAGES) -rm -f ../rtlib/*.$(MODULE_EXT) -rm -f hal/components/conv_*.comp diff --git a/src/emc/ini/Submakefile b/src/emc/ini/Submakefile index 250d2075c49..e619a430569 100644 --- a/src/emc/ini/Submakefile +++ b/src/emc/ini/Submakefile @@ -19,9 +19,16 @@ $(patsubst ./emc/ini/%,../include/%,$(LIBLCNCINICXINCS)): ../include/%.hh: ./emc ../lib/liblinuxcncini.so.1: $(call TOOBJS,$(LIBLCNCINISRCS)) $(ECHO) Creating shared library $(notdir $@) @mkdir -p ../lib - @rm -f $@ + @rm -f $(basename $@).[0-9]* $(Q)$(CXX) $(LDFLAGS) -Wl,-soname,$(notdir $@) -shared -o $@ $^ -lfmt +# Explicit symlink rule: the generic ../lib/%.so pattern rules in src/Makefile +# match both %.so.0 and %.so.1, and the %.so.0 rule wins when a stale .so.0 is +# left over from before this library's soname bump. Bind the dev symlink to the +# current soname explicitly so it always repoints in a single build pass. +../lib/liblinuxcncini.so: ../lib/liblinuxcncini.so.1 + ln -sf $(notdir $<) $@ + # Command-line utility for reading ini-files INIVALUESRCS := emc/ini/inivalue.cc USERSRCS += $(INIVALUESRCS)