ref: 1e3dd86128928c8b2c4a4bced4398139eadfa4f0
parent: 972f95aa637ed70a65e0e90d2e589b58a81d8a59
author: Ori Bernstein <[email protected]>
date: Tue Nov 17 13:37:38 EST 2020
upas/*: cleanup mkfiles (thanks amavect) Changeset 50ad211fb12f broke the libcommon rule in mkupas. Deleting the 'mk clean' in the recipe fixes this. Cleanup includes deleting UPDATE vars from all mkfiles, reorganization of vars in TARG,LIB,OFILE,HFILE order, and deletion of extra vars used for UPDATE.
--- a/sys/src/cmd/upas/Mail/mkfile
+++ b/sys/src/cmd/upas/Mail/mkfile
@@ -3,24 +3,18 @@
TARG=Mail
OFILES=\
- html.$O\
- mail.$O\
- mesg.$O\
- reply.$O\
- util.$O\
- win.$O
+ html.$O\
+ mail.$O\
+ mesg.$O\
+ reply.$O\
+ util.$O\
+ win.$O\
HFILES=dat.h
-LIB=
# BIN=/acme/bin/$objtype
BIN=$ABIN
-UPDATE=\
- mkfile\
- $HFILES\
- ${OFILES:%.$O=%.c}\
-
</sys/src/cmd/mkone
$O.out: $OFILES
@@ -29,4 +23,3 @@
syms:V:
$CC -a mail.c >syms
$CC -aa mesg.c reply.c util.c win.c >>syms
-
--- a/sys/src/cmd/upas/alias/mkfile
+++ b/sys/src/cmd/upas/alias/mkfile
@@ -2,19 +2,11 @@
<../mkupas
TARG=aliasmail
-
-OFILES=aliasmail.$O\
-
-LIB=../common/libcommon.a$O\
-
-HFILES=../common/common.h\
- ../common/sys.h\
-
-
-UPDATE=\
- mkfile\
- $HFILES\
- ${OFILES:%.$O=%.c}\
+LIB=../common/libcommon.a$O
+OFILES=aliasmail.$O
+HFILES=\
+ ../common/common.h\
+ ../common/sys.h\
</sys/src/cmd/mkone
CFLAGS=$CFLAGS -I../common
--- a/sys/src/cmd/upas/bayes/mkfile
+++ b/sys/src/cmd/upas/bayes/mkfile
@@ -1,11 +1,8 @@
</$objtype/mkfile
+<../mkupas
TARG=addhash bayes msgtok
-HFILES=
-OFILES=
-LIB=
-BIN=/$objtype/bin/upas
</sys/src/cmd/mkmany
# msg tokenizer
@@ -29,5 +26,3 @@
$O.addhash: hash.$O
$O.bayes: hash.$O
-
-
--- a/sys/src/cmd/upas/binscripts/mkfile
+++ b/sys/src/cmd/upas/binscripts/mkfile
@@ -1,7 +1,8 @@
</$objtype/mkfile
<../mkupas
-RCFILES=isspam\
+RCFILES=\
+ isspam\
msgcat\
spam\
tfmt\
@@ -24,11 +25,5 @@
nuke:V:
rm $BIN/^($RCFILES)
-UPDATE=$RCFILES
-
-update:V:
- update $UPDATEFLAGS $UPDATE
-
$BIN/%: %.rc
cp $stem.rc $BIN/$stem
-
--- a/sys/src/cmd/upas/binscripts/mkfile.rc
+++ b/sys/src/cmd/upas/binscripts/mkfile.rc
@@ -1,5 +1,5 @@
-RCFILES=mail.rc\
+RCFILES=mail.rc
all:Q:
;
@@ -20,19 +20,3 @@
;
nuke:V:
rm /rc/bin/mail
-
-UPDATE=\
- gone.fishing\
- gone.msg\
- mail.rc\
- mail.sh\
- makefile\
- mkfile\
- namefiles\
- omail.rc\
- qmail\
- remotemail\
- rewrite\
-
-update:V:
- update $UPDATEFLAGS $UPDATE
--- a/sys/src/cmd/upas/common/mkfile
+++ b/sys/src/cmd/upas/common/mkfile
@@ -11,13 +11,10 @@
libsys.$O\
process.$O\
-HFILES=common.h\
+HFILES=\
+ common.h\
sys.h\
-CLEANFILES=$LIB
+CLEANFILES=libcommon.a[$OS]
</sys/src/cmd/mklib
-
-nuke:V:
- mk clean
- rm -f libcommon.a[$OS]
--- a/sys/src/cmd/upas/filterkit/mkfile
+++ b/sys/src/cmd/upas/filterkit/mkfile
@@ -7,16 +7,8 @@
mbappend\
token\
-LIB=../common/libcommon.a$O\
-
+LIB=../common/libcommon.a$O
OFILES=readaddrs.$O
-UPDATE=\
- mkfile\
- ${TARG:%=%.c}\
- pipeto.sample\
- pipefrom.sample\
- pipeto.sample-hold\
</sys/src/cmd/mkmany
CFLAGS=$CFLAGS -I../common
-
--- a/sys/src/cmd/upas/fs/mkfile
+++ b/sys/src/cmd/upas/fs/mkfile
@@ -1,7 +1,8 @@
</$objtype/mkfile
+<../mkupas
TARG=fs
-
+LIB=../common/libcommon.a$O
OFILES=\
cache.$O\
fs.$O\
@@ -18,21 +19,12 @@
strtotm.$O\
tls.$O\
-LIB=../common/libcommon.a$O\
+HFILES=\
+ ../common/common.h\
+ dat.h\
-HFILES= ../common/common.h\
- dat.h
-
-UPDATE=\
- mkfile\
- $HFILES\
- ${TARG:%=%.c}\
- ${OFILES:%.$O=%.c}\
-
</sys/src/cmd/mkone
CFLAGS=$CFLAGS -I../common
-
-<../mkupas
acid:V:
$CC -a $CFLAGS fs.c>a$O
--- a/sys/src/cmd/upas/imap4d/mkfile
+++ b/sys/src/cmd/upas/imap4d/mkfile
@@ -1,5 +1,8 @@
</$objtype/mkfile
+<../mkupas
+TARG=imap4d
+
OFILES=\
auth.$O\
copy.$O\
@@ -23,16 +26,8 @@
store.$O\
utils.$O\
-HFILES=imap4d.h\
+HFILES=\
+ imap4d.h\
fns.h\
-TARG=imap4d
-
-UPDATE=\
- mkfile\
- $HFILES\
- ${OFILES:%.$O=%.c}\
-
</sys/src/cmd/mkone
-
-<../mkupas
--- a/sys/src/cmd/upas/marshal/mkfile
+++ b/sys/src/cmd/upas/marshal/mkfile
@@ -2,18 +2,10 @@
<../mkupas
TARG=marshal
+LIB=../common/libcommon.a$O
+OFILES=marshal.$O
+HFILES=../common/common.h
-LIB=../common/libcommon.a$O\
-
-HFILES= ../common/common.h\
-
-OFILES= marshal.$O
-
-UPDATE=\
- mkfile\
- $HFILES\
- ${OFILES:%.$O=%.c}\
-
</sys/src/cmd/mkone
CFLAGS=$CFLAGS -I../common
--- a/sys/src/cmd/upas/mkfile
+++ b/sys/src/cmd/upas/mkfile
@@ -24,48 +24,12 @@
#libs must be made first
DIRS=$LIBS $PROGS
-UPDATE=\
- mkfile\
- /sys/man/1/mail\
-
-all:V:
+all install installall clean nuke:V:
for (i in $DIRS) @{
cd $i
- mk all
+ mk $target
}
-clean:V:
- for (i in $DIRS) @{
- cd $i
- mk clean
- }
-
-nuke:V:
- for (i in $LIBS) @{
- cd $i
- mk nuke
- }
- for (i in $PROGS) @{
- cd $i
- mk clean
- }
-
-install:V:
- for (i in $DIRS) @{
- cd $i
- mk install
- }
-
-installall:V:
- for (i in $DIRS) @{
- cd $i
- mk installall
- }
- for (i in $DIRS) @{
- cd $i
- mk clean
- }
-
safeinstallall:V:
for (i in $LIBS) @{
cd $i
@@ -74,16 +38,4 @@
for (i in $PROGS) @{
cd $i
mk safeinstallall
- }
- for (i in $DIRS) @{
- cd $i
- mk clean
- }
-
-update:V:
- update $UPDATEFLAGS $UPDATE
- for (i in $DIRS) @{
- cd $i
- echo '>>>>>>>>>>' `{pwd} '<<<<<<<<<<<'
- mk $MKFLAGS 'UPDATEFLAGS='$"UPDATEFLAGS update
}
--- a/sys/src/cmd/upas/mkupas
+++ b/sys/src/cmd/upas/mkupas
@@ -2,4 +2,4 @@
ABIN=/acme/bin/$objtype
../common/libcommon.a$O:
- cd ../common; mk; mk clean
+ cd ../common; mk
--- a/sys/src/cmd/upas/ml/dat.h
+++ b/sys/src/cmd/upas/ml/dat.h
@@ -1,6 +1,6 @@
#include "../smtp/smtp.h"
-#include "../smtp/y.tab.h"
+#include "../smtp/rfc822.tab.h"
typedef struct Addr Addr;
struct Addr
--- a/sys/src/cmd/upas/ml/mkfile
+++ b/sys/src/cmd/upas/ml/mkfile
@@ -1,31 +1,21 @@
</$objtype/mkfile
<../mkupas
-TARG=ml\
+TARG=\
+ ml\
mlowner\
mlmgr\
-OFILES=\
- common.$O\
+LIB=../common/libcommon.a$O
-LIB=../common/libcommon.a$O\
+OFILES=common.$O
-UHFILES= ../common/common.h\
+HFILES=\
+ ../common/common.h\
../common/sys.h\
dat.h\
+ ../smtp/rfc822.tab.h\
-HFILES=$UHFILES\
- ../smtp/y.tab.h\
-
-LIB=../common/libcommon.a$O\
-
-UPDATE=\
- mkfile\
- $UHFILES\
- ${TARG:%=%.c}\
- ${OFILES:%.$O=%.c}\
- ../smtp/rfc822.y\
-
</sys/src/cmd/mkmany
CFLAGS=$CFLAGS -I../common
@@ -32,5 +22,5 @@
$O.ml: ../smtp/rfc822.tab.$O
$O.mlowner: ../smtp/rfc822.tab.$O
-../smtp/y.tab.h ../smtp/rfc822.tab.$O:
+../smtp/rfc822.tab.h ../smtp/rfc822.tab.$O: ../smtp/rfc822.y
cd ../smtp && mk rfc822.tab.$O
--- a/sys/src/cmd/upas/ned/mkfile
+++ b/sys/src/cmd/upas/ned/mkfile
@@ -1,19 +1,10 @@
</$objtype/mkfile
+<../mkupas
TARG=nedmail
-
-LIB=../common/libcommon.a$O\
-
-HFILES= ../common/common.h\
-
+LIB=../common/libcommon.a$O
OFILES=nedmail.$O
+HFILES=../common/common.h
-UPDATE=\
- mkfile\
- ${OFILES:%.$O=%.c}\
- $HFILES\
-
</sys/src/cmd/mkone
CFLAGS=$CFLAGS -I../common
-
-<../mkupas
--- a/sys/src/cmd/upas/pop3/mkfile
+++ b/sys/src/cmd/upas/pop3/mkfile
@@ -2,15 +2,8 @@
<../mkupas
TARG=pop3
-
+LIB=../common/libcommon.a$O
OFILES=pop3.$O
-LIB=../common/libcommon.a$O
-
-UPDATE=\
- mkfile\
- ${OFILES:%.$O=%.c}\
-
</sys/src/cmd/mkone
-
CFLAGS=$CFLAGS -I../common
--- a/sys/src/cmd/upas/q/mkfile
+++ b/sys/src/cmd/upas/q/mkfile
@@ -1,21 +1,15 @@
</$objtype/mkfile
<../mkupas
-TARG = qer\
+TARG=\
+ qer\
runq\
+LIB=../common/libcommon.a$O
OFILES=
-
-HFILES=../common/common.h\
+HFILES=\
+ ../common/common.h\
../common/sys.h\
-
-LIB=../common/libcommon.a$O\
-
-UPDATE=\
- mkfile\
- $HFILES\
- ${OFILES:%.$O=%.c}\
- ${TARG:%=%.c}\
</sys/src/cmd/mkmany
CFLAGS=$CFLAGS -I../common
--- a/sys/src/cmd/upas/qfrom/mkfile
+++ b/sys/src/cmd/upas/qfrom/mkfile
@@ -1,13 +1,7 @@
</$objtype/mkfile
+<../mkupas
TARG=qfrom
-OFILES=qfrom.$O\
-
-BIN=/$objtype/bin/upas
-
-UPDATE=\
- mkfile\
- $HFILES\
- ${OFILES:%.$O=%.c}\
+OFILES=qfrom.$O
</sys/src/cmd/mkone
--- a/sys/src/cmd/upas/scanmail/mkfile
+++ b/sys/src/cmd/upas/scanmail/mkfile
@@ -1,25 +1,20 @@
</$objtype/mkfile
+<../mkupas
-TARG=scanmail\
+TARG=\
+ scanmail\
testscan
-OFILES= common.$O
+LIB=../common/libcommon.a$O
-HFILES= spam.h\
+OFILES=common.$O
+
+HFILES=\
+ spam.h\
../common/sys.h\
-LIB= ../common/libcommon.a$O\
-
-UPDATE=\
- mkfile\
- $HFILES\
- ${OFILES:%.$O=%.c}\
- ${TARG:%=%.c}\
-
</sys/src/cmd/mkmany
CFLAGS=$CFLAGS -I../common
-<../mkupas
-
-scanmail.$O: scanmail.c
+scanmail.$O: scanmail.c
$CC $CFLAGS scanmail.c
--- a/sys/src/cmd/upas/send/message.c
+++ b/sys/src/cmd/upas/send/message.c
@@ -2,7 +2,7 @@
#include "send.h"
#include <regexp.h>
#include "../smtp/smtp.h"
-#include "../smtp/y.tab.h"
+#include "../smtp/rfc822.tab.h"
enum{
VMLIMIT = 64*1024,
--- a/sys/src/cmd/upas/send/mkfile
+++ b/sys/src/cmd/upas/send/mkfile
@@ -1,16 +1,17 @@
</$objtype/mkfile
<../mkupas
-TARG=send\
- filter
+TARG=\
+ send\
+ filter\
-UOFILES=message.$O\
+LIB=../common/libcommon.a$O
+
+OFILES=\
+ message.$O\
dest.$O\
log.$O\
skipequiv.$O\
-
-OFILES=\
- $UOFILES\
../smtp/rfc822.tab.$O\
SOBJ=\
@@ -23,23 +24,13 @@
rewrite.$O\
translate.$O\
-FOBJ=\
- cat_mail.$O\
+FOBJ=cat_mail.$O
-
-HFILES=send.h\
+HFILES=\
+ send.h\
../common/common.h\
../common/sys.h\
-LIB=../common/libcommon.a$O\
-
-UPDATE=\
- mkfile\
- $HFILES\
- ${UOFILES:%.$O=%.c}\
- ${SOBJ:%.$O=%.c}\
- ${TARG:%=%.c}\
-
</sys/src/cmd/mkmany
CFLAGS=$CFLAGS -I../common
@@ -48,7 +39,7 @@
$O.filter: $FOBJ
-message.$O: ../smtp/y.tab.h
+message.$O: ../smtp/rfc822.tab.h
-../smtp/y.tab.h ../smtp/rfc822.tab.$O: ../smtp/rfc822.y
+../smtp/rfc822.tab.h ../smtp/rfc822.tab.$O: ../smtp/rfc822.y
cd ../smtp && mk rfc822.tab.$O
--- a/sys/src/cmd/upas/smtp/mkfile
+++ b/sys/src/cmd/upas/smtp/mkfile
@@ -1,31 +1,23 @@
</$objtype/mkfile
+<../mkupas
-TARG = smtpd\
+TARG=\
+ smtpd\
smtp\
-TEST=\
- parsetest
-
+LIB=../common/libcommon.a$O
OFILES=
-
-LIB=../common/libcommon.a$O\
-
-HFILES=../common/common.h\
+HFILES=\
+ ../common/common.h\
../common/sys.h\
smtpd.h\
smtp.h\
+ rfc822.tab.h\
-UPDATE=\
- greylist.c\
- mkfile\
- mxdial.c\
- rfc822.y\
- smtpd.y\
- spam.c\
- $HFILES\
- ${OFILES:%.$O=%.c}\
- ${TARG:%=%.c}\
+TEST=parsetest
+CLEANFILES=*.tab.?
+
</sys/src/cmd/mkmany
CFLAGS=$CFLAGS -I../common
@@ -35,7 +27,7 @@
rfc822.tab.$O\
greylist.$O\
-$O.smtp: rfc822.tab.$O mxdial.$O
+$O.smtp: rfc822.tab.$O mxdial.$O
smtpd.tab.c: smtpd.y
yacc -o xxx smtpd.y
@@ -42,17 +34,9 @@
sed 's/yy/zz/g' < xxx > $target
rm xxx
-rfc822.tab.c: rfc822.y
- yacc -d -o $target rfc822.y
+rfc822.tab.c rfc822.tab.h:D: rfc822.y
+ yacc -d -s rfc822 rfc822.y
$O.parsetest: rfc822.tab.$O
parsetest.$O: rfc822.tab.$O
-
-clean:V:
- rm -f *.[$OS] [$OS].^($TARG $TEST) smtpd.tab.c rfc822.tab.c y.tab.? y.debug $TARG
-
-../common/libcommon.a$O:
- cd ../common && mk
-
-<../mkupas
--- a/sys/src/cmd/upas/smtp/smtpd.c
+++ b/sys/src/cmd/upas/smtp/smtpd.c
@@ -7,7 +7,7 @@
#include <mp.h>
#include <libsec.h>
#include <auth.h>
-#include "../smtp/y.tab.h"
+#include "rfc822.tab.h"
char *me;
char *him="";
--- a/sys/src/cmd/upas/unesc/mkfile
+++ b/sys/src/cmd/upas/unesc/mkfile
@@ -2,11 +2,6 @@
<../mkupas
TARG=unesc
-OFILES=unesc.$O\
-
-UPDATE=\
- mkfile\
- $HFILES\
- ${OFILES:%.$O=%.c}\
+OFILES=unesc.$O
</sys/src/cmd/mkone
--- a/sys/src/cmd/upas/vf/mkfile
+++ b/sys/src/cmd/upas/vf/mkfile
@@ -2,18 +2,11 @@
<../mkupas
TARG=vf
-
-OFILES=vf.$O\
-
-LIB=../common/libcommon.a$O\
-
-HFILES=../common/common.h\
- ../common/sys.h\
-
-UPDATE=\
- mkfile\
- $HFILES\
- ${OFILES:%.$O=%.c}\
+LIB=../common/libcommon.a$O
+OFILES=vf.$O
+HFILES=\
+ ../common/common.h\
+ ../common/sys.h\
</sys/src/cmd/mkone
CFLAGS=$CFLAGS -I../common