diff options
| author | Michael Forney <mforney@mforney.org> | 2016-11-19 18:11:12 -0800 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2016-11-20 16:14:20 -0800 |
| commit | de4e4c63378c6fd0dc2504ddce5a13ee1e62504a (patch) | |
| tree | 996c7ca19cea166be6b0f1cb2fa364c4e96d3e69 /core | |
| parent | cd820c03fc5b00354fa5a444216726fc46a22a5d (diff) | |
Drop phony/ prefix from phony targets
There is little chance of collision between phony target names and actual
sources checked in $dir. Additionally, it was a bit magical when processing
phony sources because paths starting with $ or phony/ were left alone, while
others were prepended with $outdir/.
Also, where appropriate, use phony targets for dependencies instead of
specifying all of them for every compile action. This makes the resulting ninja
files easier to read, and might be more efficient too.
Diffstat (limited to 'core')
| -rw-r--r-- | core/curl/gen.rc | 7 | ||||
| -rw-r--r-- | core/e2fsprogs/gen.rc | 20 | ||||
| -rw-r--r-- | core/file/gen.rc | 8 | ||||
| -rw-r--r-- | core/git/gen.rc | 17 | ||||
| -rw-r--r-- | core/libressl/gen.rc | 2 | ||||
| -rw-r--r-- | core/mdocml/gen.rc | 2 | ||||
| -rw-r--r-- | core/openbsd/gen.rc | 2 | ||||
| -rw-r--r-- | core/openssh/gen.rc | 4 | ||||
| -rw-r--r-- | core/perp/gen.rc | 4 | ||||
| -rw-r--r-- | core/pigz/gen.rc | 2 | ||||
| -rw-r--r-- | core/util-linux/gen.rc | 4 | ||||
| -rw-r--r-- | core/zlib/gen.rc | 2 |
12 files changed, 36 insertions, 38 deletions
diff --git a/core/curl/gen.rc b/core/curl/gen.rc index 65683a3c..854fa76b 100644 --- a/core/curl/gen.rc +++ b/core/curl/gen.rc @@ -12,11 +12,12 @@ cflags\ hdrs=include/curl/^(curl.h curlrules.h curlver.h easy.h mprintf.h multi.h stdcheaders.h typecheck-gcc.h) for(hdr in $hdrs) build '$outdir'/$hdr copy '$srcdir'/$hdr build '$outdir'/include/curl/curlbuild.h copy '$srcdir'/include/curl/curlbuild.h.dist -phony headers $hdrs '$outdir'/include/curl/curlbuild.h +phony headers '$outdir'/^($hdrs include/curl/curlbuild.h) + +phony deps core/^(libressl zlib)^/headers # src/lib/Makefile.inc:/^CSOURCES -deps=phony/core/^(libressl zlib)^/headers -lib libcurl.a -d $"deps lib/^(\ +lib libcurl.a -d '$dir'/deps lib/^(\ file.c timeval.c base64.c hostip.c progress.c formdata.c\ cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c\ ldap.c version.c getenv.c escape.c mprintf.c telnet.c netrc.c\ diff --git a/core/e2fsprogs/gen.rc b/core/e2fsprogs/gen.rc index a82a4a70..21b56b42 100644 --- a/core/e2fsprogs/gen.rc +++ b/core/e2fsprogs/gen.rc @@ -55,25 +55,23 @@ phony headers '$outdir'/include/^(\ ext2fs/^(ext2_err.h ext2_types.h)\ uuid/uuid.h\ ) -phony internal '$outdir'/internal/^(\ +phony deps '$dir'/headers '$outdir'/internal/^(\ blkid/blkid_types.h support/prof_err.h crc32c_table.h\ ) -deps=phony/'$dir'/^(headers internal) - -lib libcomm_err.a -d $"deps\ +lib libcomm_err.a -d '$dir'/deps\ lib/et/^(error_message.c et_name.c init_et.c com_err.c com_right.c) -lib libblkid.a -d $"deps lib/blkid/^(\ +lib libblkid.a -d '$dir'/deps lib/blkid/^(\ cache.c dev.c devname.c devno.c getsize.c llseek.c probe.c\ read.c resolve.c save.c tag.c version.c\ ) -lib libe2p.a -d $"deps lib/e2p/^(\ +lib libe2p.a -d '$dir'/deps lib/e2p/^(\ feature.c fgetflags.c fsetflags.c fgetversion.c fsetversion.c\ getflags.c getversion.c hashstr.c iod.c ls.c mntopts.c\ parse_num.c pe.c pf.c ps.c setflags.c setversion.c uuid.c\ ostype.c percent.c crypto_mode.c fgetproject.c fsetproject.c\ ) -lib libext2fs.a -d $"deps '$outdir'/ext2_err.c lib/ext2fs/^(\ +lib libext2fs.a -d '$dir'/deps '$outdir'/ext2_err.c lib/ext2fs/^(\ alloc.c\ alloc_sb.c\ alloc_stats.c\ @@ -150,7 +148,7 @@ lib libext2fs.a -d $"deps '$outdir'/ext2_err.c lib/ext2fs/^(\ \ dupfs.c\ ) -lib libsupport.a -d $"deps '$outdir'/prof_err.c lib/support/^(\ +lib libsupport.a -d '$dir'/deps '$outdir'/prof_err.c lib/support/^(\ mkquota.c\ plausible.c\ profile.c\ @@ -161,7 +159,7 @@ lib libsupport.a -d $"deps '$outdir'/prof_err.c lib/support/^(\ quotaio_tree.c\ dict.c\ ) -lib libuuid.a -d $"deps lib/uuid/^(\ +lib libuuid.a -d '$dir'/deps lib/uuid/^(\ clear.c\ compare.c\ copy.c\ @@ -176,7 +174,7 @@ lib libuuid.a -d $"deps lib/uuid/^(\ libs=(libext2fs.a libe2p.a libblkid.a libuuid.a libcomm_err.a libsupport.a) -exe bin/e2fsck -d 'phony/$dir/headers' e2fsck/^(\ +exe bin/e2fsck -d '$dir'/headers e2fsck/^(\ unix.c e2fsck.c super.c pass1.c pass1b.c pass2.c\ pass3.c pass4.c pass5.c journal.c badblocks.c util.c dirinfo.c\ dx_dirinfo.c ehandler.c problem.c message.c quota.c recovery.c\ @@ -188,7 +186,7 @@ file bin/e2fsck '$outdir'/bin/e2fsck 755 man e2fsck/e2fsck.8.in man e2fsck/e2fsck.conf.5.in -exe bin/resize2fs -d 'phony/$dir/headers' resize/^(\ +exe bin/resize2fs -d '$dir'/headers resize/^(\ extent.c resize2fs.c main.c online.c resource_track.c\ sim_progress.c\ ) $libs diff --git a/core/file/gen.rc b/core/file/gen.rc index ea6feb71..706efa8a 100644 --- a/core/file/gen.rc +++ b/core/file/gen.rc @@ -11,7 +11,7 @@ cflags\ build '$outdir'/include/magic.h sed '$srcdir'/src/magic.h.in ; with\ expr s,X.YY,`{echo $version | tr -d .}^, -phony headers include/magic.h +phony headers '$outdir'/include/magic.h build '$outdir'/file.1 sed '$srcdir'/doc/file.man ; exprs=(\ -e s,__CSECTION__,1,g\ @@ -20,7 +20,9 @@ build '$outdir'/file.1 sed '$srcdir'/doc/file.man ; exprs=(\ -e s,__MAGIC__,/share/file/magic,g\ ) with expr $"exprs -lib libmagic.a -d 'phony/$dir/headers phony/core/zlib/headers' src/^(\ +phony deps ('$dir' core/zlib)^/headers + +lib libmagic.a -d '$dir'/deps src/^(\ magic.c\ apprentice.c\ softmagic.c\ @@ -41,7 +43,7 @@ lib libmagic.a -d 'phony/$dir/headers phony/core/zlib/headers' src/^(\ fmtcheck.c\ ) -exe file -d 'phony/$dir/headers' src/file.c libmagic.a '$builddir/core/zlib/libz.a' +exe file -d '$dir'/headers src/file.c libmagic.a '$builddir/core/zlib/libz.a' file bin/file '$outdir'/file 755 file share/man/man1/file.1 '$outdir'/file.1 644 diff --git a/core/git/gen.rc b/core/git/gen.rc index 3fa499da..c85010e9 100644 --- a/core/git/gen.rc +++ b/core/git/gen.rc @@ -10,17 +10,14 @@ cflags\ rule cmdlist 'oldcwd=$$PWD && cd $srcdir && ./generate-cmdlist.sh $$oldcwd/$in >$$oldcwd/$out.tmp && mv $$oldcwd/$out.tmp $$oldcwd/$out' build '$outdir'/common-cmds.h cmdlist '$srcdir'/command-list.txt '|' '$srcdir'/Documentation/`{grep -v '^#' commands.txt} -deps=(\ - phony/core/^(curl libressl zlib)^/headers\ - '$outdir'/common-cmds.h\ -) +phony deps '$outdir'/common-cmds.h core/^(curl libressl zlib)^/headers -cc exec_cmd.c '||' $deps ; with cflags '$cflags ''-DPREFIX=""''' -cc common-main.c '||' $deps -cc compat/regex/regex.c '||' $deps ; with cflags '$cflags -DGAWK -DNO_MBSUPPORT' +cc exec_cmd.c '||' '$dir'/deps ; with cflags '$cflags ''-DPREFIX=""''' +cc common-main.c '||' '$dir'/deps +cc compat/regex/regex.c '||' '$dir'/deps ; with cflags '$cflags -DGAWK -DNO_MBSUPPORT' # src/Makefile:/^LIB_OBJS.\+= -lib libgit.a -d $"deps\ +lib libgit.a -d '$dir'/deps\ abspath.c\ advice.c\ alias.c\ @@ -200,7 +197,7 @@ lib libxdiff.a xdiff/^(\ ) # src/Makefile:/^BUILTIN_OBJS.\+= -exe git -d $"deps git.c common-main.c.o builtin/^(\ +exe git -d '$dir'/deps git.c common-main.c.o builtin/^(\ add.c\ am.c\ annotate.c\ @@ -312,7 +309,7 @@ fn x { shift if(~ $#* 0) srcs=$name.c if not srcs=$* - exe git-$name -d $"deps $srcs common-main.c.o libgit.a.d + exe git-$name -d '$dir'/deps $srcs common-main.c.o libgit.a.d file libexec/git-core/git-$name '$outdir'/git-$name 755 } diff --git a/core/libressl/gen.rc b/core/libressl/gen.rc index 44ee46d2..d1fe8498 100644 --- a/core/libressl/gen.rc +++ b/core/libressl/gen.rc @@ -90,7 +90,7 @@ for(srchdr in $srchdrs) { phony headers $hdrs # src/lib/libcrypto/crypto/Makefile -lib libcrypto.a -d 'phony/$dir/headers' src/lib/libcrypto/^(\ +lib libcrypto.a -d '$dir'/headers src/lib/libcrypto/^(\ cryptlib.c malloc-wrapper.c mem_dbg.c cversion.c ex_data.c cpt_err.c\ o_time.c o_str.c o_init.c\ mem_clr.c\ diff --git a/core/mdocml/gen.rc b/core/mdocml/gen.rc index 9ecace70..a3a268c2 100644 --- a/core/mdocml/gen.rc +++ b/core/mdocml/gen.rc @@ -4,7 +4,7 @@ cflags\ -I include\ -I '$dir' -lib libmandoc.a -d phony/core/zlib/headers\ +lib libmandoc.a -d core/zlib/headers\ man.c\ man_hash.c\ man_macro.c\ diff --git a/core/openbsd/gen.rc b/core/openbsd/gen.rc index 4ea363ed..86987910 100644 --- a/core/openbsd/gen.rc +++ b/core/openbsd/gen.rc @@ -12,7 +12,7 @@ build '$outdir'/lib/libc/crypt/arc4random.h copy '$srcdir'/lib/libcrypto/crypto/ build '$outdir'/lib/libc/crypt/chacha_private.h copy '$srcdir'/lib/libc/crypt/chacha_private.h cc '$outdir'/lib/libc/crypt/arc4random.c '||' '$outdir'/lib/libc/crypt/^(arc4random.h chacha_private.h) -lib libbsd.a -d phony/core/libressl/headers\ +lib libbsd.a -d core/libressl/headers\ lib/libc/^(\ crypt/^(arc4random.c.o arc4random_uniform.c)\ gen/^(fts.c vis.c warnc.c vwarnc.c)\ diff --git a/core/openssh/gen.rc b/core/openssh/gen.rc index 2ac23aae..ba269df2 100644 --- a/core/openssh/gen.rc +++ b/core/openssh/gen.rc @@ -34,11 +34,11 @@ lib libopenbsd-compat.a openbsd-compat/^(\ port-aix.c port-irix.c port-linux.c port-solaris.c port-uw.c\ ) -deps=phony/core/^(libressl zlib)^/headers +phony deps core/^(libressl zlib)^/headers # port-tun.c from openbsd-compat depends on sshbuf-getput-basic.c and ssherr.c # from libssh.a, so just include it in libssh.a. -lib libssh.a -d $"deps\ +lib libssh.a -d '$dir'/deps\ ssh_api.c\ ssherr.c\ sshbuf.c\ diff --git a/core/perp/gen.rc b/core/perp/gen.rc index 21c628a8..870d8432 100644 --- a/core/perp/gen.rc +++ b/core/perp/gen.rc @@ -19,9 +19,9 @@ rule sysstr '$outdir/mksysstr $type >$out.tmp && mv $out.tmp $out' build '$outdir'/sysstr_errno.c.in sysstr '|' '$outdir'/mksysstr ; with type errno build '$outdir'/sysstr_signo.c.in sysstr '|' '$outdir'/mksysstr ; with type signo -phony internal_headers outvec_STDOUT.h rlimit_defs.c.in sysstr_^(errno signo)^.c.in +phony deps '$outdir'/^(outvec_STDOUT.h rlimit_defs.c.in sysstr_^(errno signo)^.c.in) -lib libasagna.a -d 'phony/$dir/internal_headers' lasagna/^(\ +lib libasagna.a -d '$dir'/deps lasagna/^(\ buf/buf_^(cmp copy fill ndx rcopy rndx)^.c\ cstr/cstr_^(cat chop cmp cmpi contains copy dup lcat lcpy len ltrim match matchi ncmp pos rpos rtrim trim vcat_ vcopy_ vlen_)^.c\ cdb/^(cdb_^(find cc clear close distance dynget dynread get hashpart init open read seq) cdbmk_^(add addioq addrec clear finish init _update))^.c\ diff --git a/core/pigz/gen.rc b/core/pigz/gen.rc index 04353d89..a1c0bfd1 100644 --- a/core/pigz/gen.rc +++ b/core/pigz/gen.rc @@ -1,6 +1,6 @@ cflags -Wall -Wextra -I '$builddir'/core/zlib/include -exe pigz -d phony/core/zlib/headers\ +exe pigz -d core/zlib/headers\ pigz.c yarn.c try.c\ zopfli/src/zopfli/^(deflate.c blocksplitter.c tree.c lz77.c cache.c hash.c util.c squeeze.c katajainen.c)\ '$builddir'/core/zlib/libz.a diff --git a/core/util-linux/gen.rc b/core/util-linux/gen.rc index 220a4637..d69ca256 100644 --- a/core/util-linux/gen.rc +++ b/core/util-linux/gen.rc @@ -15,7 +15,7 @@ build '$outdir'/libfdisk.h sed '$srcdir'/libfdisk/src/libfdisk.h.in ; expr=(\ -e /@LIBFDISK_PATCH_VERSION@/d\ ) with expr $"expr -phony deps libsmartcols.h libfdisk.h +phony deps '$outdir'/^(libsmartcols.h libfdisk.h) lib libcommon.a lib/^(\ blkdev.c\ @@ -98,7 +98,7 @@ lib libuuid.a libuuid/src/^(\ uuid_time.c\ ) -exe fdisk -d 'phony/$dir/deps' \ +exe fdisk -d '$dir'/deps\ disk-utils/^(fdisk.c fdisk-menu.c fdisk-list.c)\ libfdisk.a.d libsmartcols.a libtcolors.a file bin/fdisk '$outdir'/fdisk 755 diff --git a/core/zlib/gen.rc b/core/zlib/gen.rc index 4843b6d9..c868a348 100644 --- a/core/zlib/gen.rc +++ b/core/zlib/gen.rc @@ -29,6 +29,6 @@ for(hdr in $hdrs) { build '$outdir'/include/$hdr copy '$srcdir'/$hdr file include/$hdr '$srcdir'/$hdr 644 } -phony headers include/$hdrs +phony headers '$outdir'/include/$hdrs fetch git |
