replica: fix mkfile script installation (thanks Amavect)

The $SCRIPTS were added to $TARG, which complicates the all rule, as
each script's object file must be suppressed.
Fix by removing $SCRIPTS from $TARG, removing the script object file
suppression rule, and overriding the install rule.

The script bin install rule assumes that only one script install is
called at a time. Valid calls like 'mk -a /$objtype/replica/changes
/$objtype/replica/pull' will fail.
Fix by adding a for loop.

Remove the unused $UPDATE variable.
This commit is contained in:
Ori Bernstein 2020-07-20 18:58:52 -07:00
parent 2d59d75e3a
commit ea98dafce5

View file

@ -12,7 +12,6 @@ TARG=\
applylog\
compactdb\
updatedb\
$SCRIPTS\
OFILES=\
db.$O\
@ -20,29 +19,16 @@ OFILES=\
HFILES=all.h
UPDATE=\
mkfile\
/sys/man/1/replica\
/sys/man/8/replica\
${OFILES:%.$O=%.c}\
revproto.c\
$HFILES\
applychanges.c\
updatedb.c\
${TARG:%=/386/bin/replica/%}\
${SCRIPTS:%=/rc/bin/replica/%}\
/rc/bin/replica/defs\
BIN=/$objtype/bin/replica
</sys/src/cmd/mkmany
$O.applychanges: revproto.$O
${SCRIPTS:%=$BIN/%}:
{ echo '#!/bin/rc'; echo 'exec /rc/bin/replica/'^`{basename $target}^' $*' } >$target
for(i in $target){
echo '#!/bin/rc'
echo 'exec /rc/bin/replica/'^`{basename $i}^' $*'
} >$i
chmod +x $target
${SCRIPTS:%=$O.%}:QV:
;
install:V: ${TARG:%=$BIN/%} ${SCRIPTS:%=$BIN/%}