make/update-rules.sh

changeset 766
e59b76889f00
parent 755
255ee4abf2ec
     1.1 --- a/make/update-rules.sh	Mon Dec 18 18:54:17 2023 +0100
     1.2 +++ b/make/update-rules.sh	Wed Dec 20 16:46:14 2023 +0100
     1.3 @@ -1,12 +1,17 @@
     1.4  #!/bin/sh
     1.5  
     1.6  dir="$1"
     1.7 +target="$2"
     1.8  
     1.9  if [ -z "$dir" ]; then
    1.10    echo "Usage: $0 <src_dir>"
    1.11    exit 1
    1.12  fi
    1.13  
    1.14 +if [ -z "$target" ]; then
    1.15 +  target='$(build_dir)'
    1.16 +fi
    1.17 +
    1.18  if [ -d "$dir" ]; then
    1.19    :
    1.20  else
    1.21 @@ -41,7 +46,7 @@
    1.22  sed '/FORCE:/q' Makefile.old > Makefile
    1.23  echo >> Makefile
    1.24  for file in `ls *.c` ; do
    1.25 -  "$CC" -MT "\$(build_dir)/${file/.c/\$(OBJ_EXT)}" -MM $CFLAGS "$file"
    1.26 +  "$CC" -MT "$target/${file/.c/\$(OBJ_EXT)}" -MM $CFLAGS "$file"
    1.27    printf '\t@echo "Compiling $<"\n'
    1.28    printf '\t$(CC) -o $@ $(CFLAGS) -c $<\n\n'
    1.29  done  >> Makefile

mercurial