Skip to content
Snippets Groups Projects
Commit cb4fe3ad authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Support for explicit include files

Instead of using links to other source directories
we now use explicit include files. The approach is more
robust.

Closes #69
parent 3c1e3493
No related branches found
No related tags found
No related merge requests found
#! /bin/bash
for file in *
do
test -d $file && test -e $file/.tmpdir && rm -fr $file/
test -L $file && rm -fr $file
done
# this echo is to avoid triggering errors when last test fails
echo links removed
......@@ -33,7 +33,7 @@ all:
links: Makefile
@echo Create links to modules used in $(CURDIR) to simplify header inclusion:
@for dir in $(USE) ; do test -L $$dir || ln -fs ../$$dir . && echo " " $$dir ; done
@for dir in $(USE) ; do ../maketools/makelinks.sh $$dir ; done
@echo Touching a file used to track links update
touch links
@echo Acting recursively
......@@ -62,7 +62,7 @@ endif
.PHONY: clean
clean:
-for file in * ; do test -L $$file && rm -f $$file ; done
../maketools/cleanlinks.sh
rm -fr deps links
rm -f $(CLEANLIST)
......
#! /bin/bash
dir=$1
# this is old style behavior, i.e. generate symbolic links
# rm -fr $dir
# ln -s ../$dir $dir
# exit
# the new implementation follows
# remove links (possibly remaining from compilation with old makefiles):
test -L $dir && rm $dir
mkdir -p $dir
echo "This file indicates this is a temporary directory" > $dir/.tmpdir
for file in ../$dir/*.h
do
name="${file##*/}"
text="#include \"../../$dir/$name\""
# files are replaces only if changed
cmp -s <(echo "$text") $dir/$name > /dev/null 2> /dev/null || echo "$text" > $dir/$name
done
# then erase not existent files
for file in $dir/*.h
do
name="${file##*/}"
test -f "../$dir/$name" || rm $file
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment