From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,RDNS_NONE, SPOOFED_FREEMAIL_NO_RDNS autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 25103 invoked from network); 28 Aug 2021 13:44:40 -0000 Received: from unknown (HELO 4ess.inri.net) (216.126.196.42) by inbox.vuxu.org with ESMTPUTF8; 28 Aug 2021 13:44:40 -0000 Received: from mail-io1-f53.google.com ([209.85.166.53]) by 4ess; Sat Aug 28 09:29:02 -0400 2021 Received: by mail-io1-f53.google.com with SMTP id y18so12895812ioc.1 for <9front@9front.org>; Sat, 28 Aug 2021 06:28:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:organization :mime-version; bh=E9lUd519wfgDw6fPuHGsh4sJiv4un7/+QugPuUv0QR8=; b=Kb6JDLxRquQQl4r7XuZV5gQCVMYedQtq8lOz1+xpxHjbaShZIhsBFJGQI1dMedgVzH 6clzQGH6PhYpx9uifpynClDckT8FXw06Z04LTwrJIM+a9CwGC1T2jgvimc1VUm2lImo4 /Hx+e4ll6G1EKX9g6SzTykTSR5uN5Akzj8IY2Okb/tWimbS/XKK+m+qE+MPXZltG+3Ms EcJz6MiTJtWrGyr2LyB+0qEe47oJXdQm7mJOy3dT3mJ5hHbIYVXwMctmxftatrBJGZ1z icZjXiMnzlPGlqftUysNFwvRMRiAmHP18q1sE7RvLvoWv5mhFCisf3Uf/feIptGUSozQ KyJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:organization:mime-version; bh=E9lUd519wfgDw6fPuHGsh4sJiv4un7/+QugPuUv0QR8=; b=FajT625wY6YRKpP4fxwgS3Yi5uvzXEW1bYh14bWQhuRlRbjPcB9gnurhrZx4qv9g+0 qWrYZHnWvVLQuXjdgtykFRpxkkKFqydcoOcz3VmZhH2oRsbuiaSipTzIQT+Y7ZXmQ5vP B4511YAwmQl9/H/f8uurZLMOGqK6k6jGQOvvrga1//9tZlP0F4P/AKklXBbJT71Ky3T/ bUE58g4xUYeubNd+cbCkDfSjn0xReXpBZ/j/zq5GDPbRxAFHhX+XG67pNp5isIYtP4zJ vCikmUpp4IhG0/h84Xjh1DIrGgNfIaH3Z2q5Zi27DEjWhpqeDqNGEzO+Ls06Dlz0prqD KnZg== X-Gm-Message-State: AOAM5337WKZ7DMn0G1oAyJYXb36og3oSd4jhQV4g1tWihCkIIjtVhHyH yB/XvV61VaQQ4bHZVeVB7IjEXfE2l2Q= X-Google-Smtp-Source: ABdhPJzhbKwsc1s/4luLsZ+m+uTLC1IRDah7KrJUMQJgZ6gRAqOSFLFt6GZHqwxhIfOZCpW8eVfGbQ== X-Received: by 2002:a05:6602:130c:: with SMTP id h12mr9108163iov.132.1630157333621; Sat, 28 Aug 2021 06:28:53 -0700 (PDT) Return-Path: Received: from spruce.localdomain ([2601:246:4e03:dc20::b5e8]) by smtp.gmail.com with ESMTPSA id b16sm5063882ila.1.2021.08.28.06.28.53 for <9front@9front.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Aug 2021 06:28:53 -0700 (PDT) Date: Sat, 28 Aug 2021 08:28:38 -0500 From: Amavect To: 9front@9front.org Message-ID: <20210828082838.1c8ef277@spruce.localdomain> In-Reply-To: <4BE859C83546EA13A46F9ACEF135720D@eigenstate.org> References: <20210824174745.48c6aa87@spruce.localdomain> <4BE859C83546EA13A46F9ACEF135720D@eigenstate.org> Organization: Amavect Industries X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/Tqj1WZbxnHl8w+D.AREQnif" List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: content-addressed virtual app service singleton-oriented locator Subject: Re: [9front] [PATCH] cmd/mkfile: major cleanup Reply-To: 9front@9front.org Precedence: bulk --MP_/Tqj1WZbxnHl8w+D.AREQnif Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tue, 24 Aug 2021 19:01:33 -0400 ori@eigenstate.org wrote: > Thanks for the ping -- it looks fine with a quick skim, > and I'll try to look closer in the next few days. Chatted with ori yesterday. He had some good ideas with simplifying $NOMK and $DIRS generation. TODO: init.c doesn't really belong in cmd/ and should probably be moved to /sys/src/boot/ since it complicates cmd/mkfile. That will be a separate patch. Thanks, Amavect From: Amavect Date: Sat, 28 Aug 2021 13:15:02 +0000 Subject: [PATCH] cmd/mkfile: major cleanup Target generation is revised, split into $YTARG and $TARG. $PROGS is inlined to the cmd target. %.cpus is added to allow chaining: mk all.cpus $POWERLESS is added, since dtracy doesn't build yet on ppc. $DIRS regexp is simplified, simplifing $NOMK. $cpuobjtype is replaced with cp's recipe for copying itself on $cputype. $APEDIRS is removed. The none target is renamed to usage, since it prints out usage. The ape target is removed. The dirs target is replaced by all.dirs %.directories is replaced by %.dirs The all target serializes directories after cmds to match the install target recipe. All regexp rules are replaced with nonregexp versions for clarity. The &:n: rule is removed. Just build the $O.$cmd file. .y files now build .c files, not .tab.c files, and remove (bc|units|mpc|pc).c:R: All safeinstall rules are removed. The cleanfiles rule is renamed to cleancmds and simplified. %.clean is removed. Just use mk cleancmds. The install rule serializes cp and yacc before building anything else, avoiding races. The installall recipe is simplified with the install.cpus prereq. %.installall is removed. Just use mk $cmd.install.cpus The $O.cj, %.update, and compilers rules are removed. --- diff 61f37abf576a02c7f1e3561cfaba3c0457f55c9d 5fb0b83b0ca45b5830227f0c82af3a7696ad1acc --- a/sys/src/cmd/mkfile Fri Aug 27 09:13:11 2021 +++ b/sys/src/cmd/mkfile Sat Aug 28 08:15:02 2021 @@ -1,137 +1,74 @@ $target -$BIN/%: $O.% $cpuobjtype._cp - ./$cpuobjtype._cp $O.$stem $BIN/$stem +%.cpus:V: + for(objtype in $CPUS) mk $MKFLAGS $stem -%.directories:V: +%.dirs:V: for(i in $DIRS) @{ cd $i echo mk $i mk $MKFLAGS $stem } -clean:V: cleanfiles clean.directories - -nuke:V: cleanfiles nuke.directories - -directories:V: install.directories +cmds:V: $O.cp $O.yacc ${TARG:%=$O.%} -cleanfiles:V: - rm -f [$OS].out *.[$OS] y.tab.? y.debug y.output [$OS].$TARG [$OS].units.tab $TARG bc.c bc.tab.h units.tab.h units.c mpc.c mpc.tab.h [$OS]._cp +all:V: cmds + mk $MKFLAGS all.dirs -%.clean:V: - rm -f [$OS].$stem $stem.[$OS] +%.install:V: $BIN/% -install:V: - test -e $cpuobjtype._cp || cp /bin/cp $cpuobjtype._cp +install:V: cp.install + mk $MKFLAGS yacc.install mk $MKFLAGS $TARG.install - mk $MKFLAGS directories - -installall:V: - for(objtype in $CPUS) - mk $MKFLAGS install - -%.installall: %.c - test -e $cpuobjtype._cp || cp /bin/cp $cpuobjtype._cp - for (objtype in $CPUS) { - rfork e - mk $stem.install & - } - wait - rm -f $stem.[$OS] y.tab.? $stem.tab.? y.debug y.output [$OS].$stem bc.c bc.tab.h units.c mpc.c - -%.acid: %.$O $HFILES - $CC $CFLAGS -a $stem.c >$target + mk $MKFLAGS install.dirs -(bc|units|mpc|pc).c:R: \1.tab.c - mv $stem1.tab.c $stem1.c +installall:V: install.cpus -$BIN/init: $O.init - cp $prereq /$objtype/init +cleancmds:V: + rm -f *.[$OS] [$OS].* y.tab.? y.debug y.output $YTARG.c *.tab.h -$O.cj: cj.$O - $LD $LDFLAGS -o $O.cj cj.$O /$objtype/lib/libjpg.a +clean:V: cleancmds clean.dirs -%.update:V: - update $stem.c /386/bin/$stem - -compilers:V: - for(i in ?c) - if(! ~ $i cc rc) @{ - cd $i - mk clean - objtype=$cputype mk install - mk clean - } - for(i in ?c) - if(! ~ $i cc rc) @{ - cd $i - mk clean - mk installall - mk clean - } +nuke:V: cleancmds nuke.dirs + rm -f *.acid --MP_/Tqj1WZbxnHl8w+D.AREQnif Content-Type: multipart/mixed; boundary="upas-pzgvgmuejgeirfdttpjppfntuc" Content-Disposition: inline This is a multi-part message in MIME format. --upas-pzgvgmuejgeirfdttpjppfntuc Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit from postmaster@4ess: The following attachment had content that we can't prove to be harmless. To avoid possible automatic execution, we changed the content headers. The original header was: Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=cmdmkfile2.diff --upas-pzgvgmuejgeirfdttpjppfntuc Content-Type: application/octet-stream Content-Disposition: attachment; filename="cmdmkfile2.diff.suspect" From: Amavect Date: Sat, 28 Aug 2021 13:15:02 +0000 Subject: [PATCH] cmd/mkfile: major cleanup Target generation is revised, split into $YTARG and $TARG. $PROGS is inlined to the cmd target. %.cpus is added to allow chaining: mk all.cpus $POWERLESS is added, since dtracy doesn't build yet on ppc. $DIRS regexp is simplified, simplifing $NOMK. $cpuobjtype is replaced with cp's recipe for copying itself on $cputype. $APEDIRS is removed. The none target is renamed to usage, since it prints out usage. The ape target is removed. The dirs target is replaced by all.dirs %.directories is replaced by %.dirs The all target serializes directories after cmds to match the install target recipe. All regexp rules are replaced with nonregexp versions for clarity. The &:n: rule is removed. Just build the $O.$cmd file. .y files now build .c files, not .tab.c files, and remove (bc|units|mpc|pc).c:R: All safeinstall rules are removed. The cleanfiles rule is renamed to cleancmds and simplified. %.clean is removed. Just use mk cleancmds. The install rule serializes cp and yacc before building anything else, avoiding races. The installall recipe is simplified with the install.cpus prereq. %.installall is removed. Just use mk $cmd.install.cpus The $O.cj, %.update, and compilers rules are removed. --- diff 61f37abf576a02c7f1e3561cfaba3c0457f55c9d 5fb0b83b0ca45b5830227f0c82af3a7696ad1acc --- a/sys/src/cmd/mkfile Fri Aug 27 09:13:11 2021 +++ b/sys/src/cmd/mkfile Sat Aug 28 08:15:02 2021 @@ -1,137 +1,74 @@ $target -$BIN/%: $O.% $cpuobjtype._cp - ./$cpuobjtype._cp $O.$stem $BIN/$stem +%.cpus:V: + for(objtype in $CPUS) mk $MKFLAGS $stem -%.directories:V: +%.dirs:V: for(i in $DIRS) @{ cd $i echo mk $i mk $MKFLAGS $stem } -clean:V: cleanfiles clean.directories - -nuke:V: cleanfiles nuke.directories - -directories:V: install.directories +cmds:V: $O.cp $O.yacc ${TARG:%=$O.%} -cleanfiles:V: - rm -f [$OS].out *.[$OS] y.tab.? y.debug y.output [$OS].$TARG [$OS].units.tab $TARG bc.c bc.tab.h units.tab.h units.c mpc.c mpc.tab.h [$OS]._cp +all:V: cmds + mk $MKFLAGS all.dirs -%.clean:V: - rm -f [$OS].$stem $stem.[$OS] +%.install:V: $BIN/% -install:V: - test -e $cpuobjtype._cp || cp /bin/cp $cpuobjtype._cp +install:V: cp.install + mk $MKFLAGS yacc.install mk $MKFLAGS $TARG.install - mk $MKFLAGS directories - -installall:V: - for(objtype in $CPUS) - mk $MKFLAGS install - -%.installall: %.c - test -e $cpuobjtype._cp || cp /bin/cp $cpuobjtype._cp - for (objtype in $CPUS) { - rfork e - mk $stem.install & - } - wait - rm -f $stem.[$OS] y.tab.? $stem.tab.? y.debug y.output [$OS].$stem bc.c bc.tab.h units.c mpc.c - -%.acid: %.$O $HFILES - $CC $CFLAGS -a $stem.c >$target + mk $MKFLAGS install.dirs -(bc|units|mpc|pc).c:R: \1.tab.c - mv $stem1.tab.c $stem1.c +installall:V: install.cpus -$BIN/init: $O.init - cp $prereq /$objtype/init +cleancmds:V: + rm -f *.[$OS] [$OS].* y.tab.? y.debug y.output $YTARG.c *.tab.h -$O.cj: cj.$O - $LD $LDFLAGS -o $O.cj cj.$O /$objtype/lib/libjpg.a +clean:V: cleancmds clean.dirs -%.update:V: - update $stem.c /386/bin/$stem - -compilers:V: - for(i in ?c) - if(! ~ $i cc rc) @{ - cd $i - mk clean - objtype=$cputype mk install - mk clean - } - for(i in ?c) - if(! ~ $i cc rc) @{ - cd $i - mk clean - mk installall - mk clean - } +nuke:V: cleancmds nuke.dirs + rm -f *.acid --upas-pzgvgmuejgeirfdttpjppfntuc-- --MP_/Tqj1WZbxnHl8w+D.AREQnif--