mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-25 12:00:31 +00:00
Fix Landlock Make so it can read pattern rule vars
It turned out that specifying all SRCS and INCS as dependencies on the pattern rules for all headers, caused `make` memory usage to skyrocket from 40mb ot 160mb. This change also reduces the build graph another 4%.
This commit is contained in:
parent
62ca1b0902
commit
ead3fc2b31
53 changed files with 105 additions and 93 deletions
|
@ -30,6 +30,7 @@
|
|||
#include "libc/calls/termios.h"
|
||||
#include "libc/calls/ucontext.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/bing.internal.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/stat.h"
|
||||
#include "libc/dce.h"
|
||||
|
@ -25,7 +24,9 @@
|
|||
#include "libc/elf/struct/rela.h"
|
||||
#include "libc/elf/struct/shdr.h"
|
||||
#include "libc/elf/struct/sym.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/log/check.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
|
|
|
@ -76,6 +76,7 @@
|
|||
#include "libc/sysv/consts/w.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/time/struct/timezone.h"
|
||||
#include "libc/time/struct/utimbuf.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "third_party/mbedtls/endian.h"
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "libc/calls/struct/flock.h"
|
||||
#include "libc/calls/struct/iovec.h"
|
||||
#include "libc/calls/struct/rusage.h"
|
||||
#include "libc/calls/struct/seccomp.h"
|
||||
#include "libc/calls/struct/sigaction.h"
|
||||
#include "libc/calls/struct/stat.h"
|
||||
#include "libc/calls/struct/termios.h"
|
||||
|
@ -57,6 +56,7 @@
|
|||
#include "libc/runtime/gc.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/memtrack.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/stack.h"
|
||||
#include "libc/sock/goodsocket.internal.h"
|
||||
|
|
|
@ -5,17 +5,17 @@ import re
|
|||
import sys
|
||||
|
||||
def GetDeps(path):
|
||||
deps = set()
|
||||
def Dive(path, depth):
|
||||
if path in deps:
|
||||
def Dive(path, depth, visited):
|
||||
sys.stdout.write('%s%s' % ('\t' * depth, path))
|
||||
if path in visited:
|
||||
sys.stdout.write(' cycle\n')
|
||||
return
|
||||
deps.add(path)
|
||||
sys.stdout.write('%s%s\n' % ('\t' * depth, path))
|
||||
sys.stdout.write('\n')
|
||||
with open(path) as f:
|
||||
code = f.read()
|
||||
for dep in re.findall(r'[.#]include "([^"]+)"', code):
|
||||
Dive(dep, depth + 1)
|
||||
Dive(path, 0)
|
||||
Dive(dep, depth + 1, visited + [path])
|
||||
Dive(path, 0, [])
|
||||
sys.stdout.write('\n')
|
||||
|
||||
for arg in sys.argv[1:]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue