Update symbolic links to sources during make.
authorIan Abbott <abbotti@mev.co.uk>
Thu, 8 Mar 2012 15:11:02 +0000 (15:11 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Thu, 8 Mar 2012 15:11:02 +0000 (15:11 +0000)
When building outside the source directory, recreate any symbolic links
to the sources if they are broken or pointing to the wrong files.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
comedi/Makefile.am

index 7fe641efde90b396f6ba20dab1b6f84fce5c7202..426768da59dcd2054240bb073bc738dafd62caaa 100644 (file)
@@ -14,7 +14,7 @@ all-local:
                for dir in . drivers kcomedilib drivers/addi-data; do \
                        for file in `ls @abs_srcdir@/$$dir/*\.[ch] @abs_srcdir@/$$dir/Kbuild | $(EGREP) -v \.mod\.c`; do \
                                LINK_NAME=$$dir/`basename "$$file"`; \
-                               if test ! -e $$LINK_NAME; then ln -vs $$file $$LINK_NAME; fi; \
+                               if test ! "$$file" -ef "$$LINK_NAME"; then ln -vsnf "$$file" "$$LINK_NAME"; fi; \
                        done; \
                done; \
        fi