![Ori Bernstein](/assets/img/avatar_default.png)
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.
35 lines
437 B
Makefile
35 lines
437 B
Makefile
</$objtype/mkfile
|
|
|
|
SCRIPTS=\
|
|
changes\
|
|
pull\
|
|
push\
|
|
scan\
|
|
setupdirs\
|
|
|
|
TARG=\
|
|
applychanges\
|
|
applylog\
|
|
compactdb\
|
|
updatedb\
|
|
|
|
OFILES=\
|
|
db.$O\
|
|
util.$O\
|
|
|
|
HFILES=all.h
|
|
|
|
BIN=/$objtype/bin/replica
|
|
</sys/src/cmd/mkmany
|
|
|
|
$O.applychanges: revproto.$O
|
|
|
|
${SCRIPTS:%=$BIN/%}:
|
|
for(i in $target){
|
|
echo '#!/bin/rc'
|
|
echo 'exec /rc/bin/replica/'^`{basename $i}^' $*'
|
|
} >$i
|
|
chmod +x $target
|
|
|
|
install:V: ${TARG:%=$BIN/%} ${SCRIPTS:%=$BIN/%}
|