cosmopolitan/libc/nt/nt.mk

365 lines
16 KiB
Makefile
Raw Normal View History

2020-06-15 14:18:57 +00:00
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘
PKGS += LIBC_NT
LIBC_NT_LIBS = $(foreach x,$(LIBC_NT_ARTIFACTS),$($(x)))
LIBC_NT_HDRS = $(foreach x,$(LIBC_NT_ARTIFACTS),$($(x)_HDRS))
LIBC_NT_INCS = $(foreach x,$(LIBC_NT_ARTIFACTS),$($(x)_INCS))
2020-06-15 14:18:57 +00:00
LIBC_NT_SRCS = $(foreach x,$(LIBC_NT_ARTIFACTS),$($(x)_SRCS))
LIBC_NT_OBJS = $(foreach x,$(LIBC_NT_ARTIFACTS),$($(x)_OBJS))
LIBC_NT_CHECKS = $(foreach x,$(LIBC_NT_ARTIFACTS),$($(x)_CHECKS))
#───────────────────────────────────────────────────────────────────────────────
LIBC_NT_ARTIFACTS += LIBC_NT_A
LIBC_NT_A_FILES := \
$(wildcard libc/nt/enum/*) \
$(wildcard libc/nt/struct/*) \
$(wildcard libc/nt/typedef/*) \
$(wildcard libc/nt/thunk/*) \
$(wildcard libc/nt/nt/thunk/*) \
$(wildcard libc/nt/nt/*.*) \
$(wildcard libc/nt/*)
LIBC_NT_A_HDRS = $(filter %.h,$(LIBC_NT_A_FILES))
LIBC_NT_A_INCS = $(filter %.inc,$(LIBC_NT_A_FILES))
2020-06-15 14:18:57 +00:00
LIBC_NT_A_CHECKS = $(patsubst %,o/$(MODE)/%.ok,$(filter %.h,$(LIBC_NT_A_HDRS)))
#───────────────────────────────────────────────────────────────────────────────
LIBC_NT_ARTIFACTS += LIBC_NT_KERNEL32_A
LIBC_NT_KERNEL32 = $(LIBC_NT_KERNEL32_A_DEPS) $(LIBC_NT_KERNEL32_A)
LIBC_NT_KERNEL32_A = o/$(MODE)/libc/nt/kernel32.a
LIBC_NT_KERNEL32_A_SRCS := $(wildcard libc/nt/kernel32/*.s) libc/nt/sysv2nt.s
2020-06-15 14:18:57 +00:00
LIBC_NT_KERNEL32_A_OBJS = $(LIBC_NT_KERNEL32_A_SRCS:%.s=o/$(MODE)/%.o)
LIBC_NT_KERNEL32_A_CHECKS = $(LIBC_NT_KERNEL32_A).pkg
LIBC_NT_KERNEL32_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_NT_KERNEL32_A_DIRECTDEPS),$($(x))))
$(LIBC_NT_KERNEL32_A): \
libc/nt/kernel32/ \
$(LIBC_NT_KERNEL32_A).pkg \
$(LIBC_NT_KERNEL32_A_OBJS)
$(LIBC_NT_KERNEL32_A).pkg: \
$(LIBC_NT_KERNEL32_A_OBJS) \
$(foreach x,$(LIBC_NT_KERNEL32_A_DIRECTDEPS),$($(x)_A).pkg)
#───────────────────────────────────────────────────────────────────────────────
LIBC_NT_ARTIFACTS += LIBC_NT_ADVAPI32_A
LIBC_NT_ADVAPI32 = $(LIBC_NT_ADVAPI32_A_DEPS) $(LIBC_NT_ADVAPI32_A)
LIBC_NT_ADVAPI32_A = o/$(MODE)/libc/nt/advapi32.a
LIBC_NT_ADVAPI32_A_SRCS := $(wildcard libc/nt/advapi32/*.s)
LIBC_NT_ADVAPI32_A_OBJS = $(LIBC_NT_ADVAPI32_A_SRCS:%.s=o/$(MODE)/%.o)
LIBC_NT_ADVAPI32_A_CHECKS = $(LIBC_NT_ADVAPI32_A).pkg
LIBC_NT_ADVAPI32_A_DIRECTDEPS = LIBC_NT_KERNEL32
2020-06-15 14:18:57 +00:00
LIBC_NT_ADVAPI32_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_NT_ADVAPI32_A_DIRECTDEPS),$($(x))))
$(LIBC_NT_ADVAPI32_A): \
libc/nt/advapi32/ \
$(LIBC_NT_ADVAPI32_A).pkg \
$(LIBC_NT_ADVAPI32_A_OBJS)
$(LIBC_NT_ADVAPI32_A).pkg: \
$(LIBC_NT_ADVAPI32_A_OBJS) \
$(foreach x,$(LIBC_NT_ADVAPI32_A_DIRECTDEPS),$($(x)_A).pkg)
#───────────────────────────────────────────────────────────────────────────────
LIBC_NT_ARTIFACTS += LIBC_NT_COMDLG32_A
LIBC_NT_COMDLG32 = $(LIBC_NT_COMDLG32_A_DEPS) $(LIBC_NT_COMDLG32_A)
LIBC_NT_COMDLG32_A = o/$(MODE)/libc/nt/comdlg32.a
LIBC_NT_COMDLG32_A_SRCS := $(wildcard libc/nt/comdlg32/*.s)
LIBC_NT_COMDLG32_A_OBJS = $(LIBC_NT_COMDLG32_A_SRCS:%.s=o/$(MODE)/%.o)
LIBC_NT_COMDLG32_A_CHECKS = $(LIBC_NT_COMDLG32_A).pkg
LIBC_NT_COMDLG32_A_DIRECTDEPS = LIBC_NT_KERNEL32
2020-06-15 14:18:57 +00:00
LIBC_NT_COMDLG32_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_NT_COMDLG32_A_DIRECTDEPS),$($(x))))
$(LIBC_NT_COMDLG32_A): \
libc/nt/comdlg32/ \
$(LIBC_NT_COMDLG32_A).pkg \
$(LIBC_NT_COMDLG32_A_OBJS)
$(LIBC_NT_COMDLG32_A).pkg: \
$(LIBC_NT_COMDLG32_A_OBJS) \
$(foreach x,$(LIBC_NT_COMDLG32_A_DIRECTDEPS),$($(x)_A).pkg)
#───────────────────────────────────────────────────────────────────────────────
LIBC_NT_ARTIFACTS += LIBC_NT_GDI32_A
LIBC_NT_GDI32 = $(LIBC_NT_GDI32_A_DEPS) $(LIBC_NT_GDI32_A)
LIBC_NT_GDI32_A = o/$(MODE)/libc/nt/gdi32.a
LIBC_NT_GDI32_A_SRCS := $(wildcard libc/nt/gdi32/*.s)
LIBC_NT_GDI32_A_OBJS = $(LIBC_NT_GDI32_A_SRCS:%.s=o/$(MODE)/%.o)
LIBC_NT_GDI32_A_CHECKS = $(LIBC_NT_GDI32_A).pkg
LIBC_NT_GDI32_A_DIRECTDEPS = LIBC_NT_KERNEL32
2020-06-15 14:18:57 +00:00
LIBC_NT_GDI32_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_NT_GDI32_A_DIRECTDEPS),$($(x))))
$(LIBC_NT_GDI32_A): \
libc/nt/gdi32/ \
$(LIBC_NT_GDI32_A).pkg \
$(LIBC_NT_GDI32_A_OBJS)
$(LIBC_NT_GDI32_A).pkg: \
$(LIBC_NT_GDI32_A_OBJS) \
$(foreach x,$(LIBC_NT_GDI32_A_DIRECTDEPS),$($(x)_A).pkg)
#───────────────────────────────────────────────────────────────────────────────
LIBC_NT_ARTIFACTS += LIBC_NT_NTDLL_A
LIBC_NT_NTDLL = $(LIBC_NT_NTDLL_A_DEPS) $(LIBC_NT_NTDLL_A)
LIBC_NT_NTDLL_A = o/$(MODE)/libc/nt/ntdll.a
LIBC_NT_NTDLL_A_SRCS_A := $(wildcard libc/nt/ntdll/*.s)
LIBC_NT_NTDLL_A_SRCS_S = libc/nt/ntdllimport.S
LIBC_NT_NTDLL_A_SRCS = $(LIBC_NT_NTDLL_A_SRCS_A) $(LIBC_NT_NTDLL_A_SRCS_S)
LIBC_NT_NTDLL_A_OBJS = \
$(LIBC_NT_NTDLL_A_SRCS_A:%.s=o/$(MODE)/%.o) \
$(LIBC_NT_NTDLL_A_SRCS_S:%.S=o/$(MODE)/%.o)
2020-06-15 14:18:57 +00:00
LIBC_NT_NTDLL_A_CHECKS = $(LIBC_NT_NTDLL_A).pkg
LIBC_NT_NTDLL_A_DIRECTDEPS = LIBC_NT_KERNEL32
2020-06-15 14:18:57 +00:00
LIBC_NT_NTDLL_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_NT_NTDLL_A_DIRECTDEPS),$($(x))))
$(LIBC_NT_NTDLL_A): \
libc/nt/ntdll/ \
$(LIBC_NT_NTDLL_A).pkg \
$(LIBC_NT_NTDLL_A_OBJS)
$(LIBC_NT_NTDLL_A).pkg: \
$(LIBC_NT_NTDLL_A_OBJS) \
$(foreach x,$(LIBC_NT_NTDLL_A_DIRECTDEPS),$($(x)_A).pkg)
$(LIBC_NT_NTDLL_A_OBJS): \
o/libc/nt/ntdllimport.inc
o/libc/nt/ntdllimport.inc: \
ape/relocations.h \
libc/nt/ntdllimport.h \
libc/macros.internal.h \
Prove that Makefile is fully defined The whole repository is now buildable with GNU Make Landlock sandboxing. This proves that no Makefile targets exist which touch files other than their declared prerequisites. In order to do this, we had to: 1. Stop code morphing GCC output in package.com and instead run a newly introduced FIXUPOBJ.COM command after GCC invocations. 2. Disable all the crumby Python unit tests that do things like create files in the current directory, or rename() files between folders. This ended up being a lot of tests, but most of them are still ok. 3. Introduce an .UNSANDBOXED variable to GNU Make to disable Landlock. We currently only do this for things like `make tags`. 4. This change deletes some GNU Make code that was preventing the execve() optimization from working. This means it should no longer be necessary in most cases for command invocations to be indirected through the cocmd interpreter. 5. Missing dependencies had to be declared in certain places, in cases where they couldn't be automatically determined by MKDEPS.COM 6. The libcxx header situation has finally been tamed. One of the things that makes this difficult is MKDEPS.COM only wants to consider the first 64kb of a file, in order to go fast. But libcxx likes to have #include lines buried after huge documentation. 7. An .UNVEIL variable has been introduced to GNU Make just in case we ever wish to explicitly specify additional things that need to be whitelisted which aren't strictly prerequisites. This works in a manner similar to the recently introduced .EXTRA_PREREQS feature. There's now a new build/bootstrap/make.com prebuilt binary available. It should no longer be possible to write invalid Makefile code.
2022-08-06 10:51:50 +00:00
libc/intrin/asancodes.h
2020-06-15 14:18:57 +00:00
#───────────────────────────────────────────────────────────────────────────────
LIBC_NT_ARTIFACTS += LIBC_NT_URL_A
LIBC_NT_URL = $(LIBC_NT_URL_A_DEPS) $(LIBC_NT_URL_A)
LIBC_NT_URL_A = o/$(MODE)/libc/nt/url.a
LIBC_NT_URL_A_SRCS := $(wildcard libc/nt/url/*.s)
LIBC_NT_URL_A_OBJS = $(LIBC_NT_URL_A_SRCS:%.s=o/$(MODE)/%.o)
LIBC_NT_URL_A_CHECKS = $(LIBC_NT_URL_A).pkg
LIBC_NT_URL_A_DIRECTDEPS = LIBC_NT_KERNEL32
2020-06-15 14:18:57 +00:00
LIBC_NT_URL_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_NT_URL_A_DIRECTDEPS),$($(x))))
$(LIBC_NT_URL_A): \
libc/nt/url/ \
$(LIBC_NT_URL_A).pkg \
$(LIBC_NT_URL_A_OBJS)
$(LIBC_NT_URL_A).pkg: \
$(LIBC_NT_URL_A_OBJS) \
$(foreach x,$(LIBC_NT_URL_A_DIRECTDEPS),$($(x)_A).pkg)
#───────────────────────────────────────────────────────────────────────────────
LIBC_NT_ARTIFACTS += LIBC_NT_SYNCHRONIZATION_A
LIBC_NT_SYNCHRONIZATION = $(LIBC_NT_SYNCHRONIZATION_A_DEPS) $(LIBC_NT_SYNCHRONIZATION_A)
LIBC_NT_SYNCHRONIZATION_A = o/$(MODE)/libc/nt/synchronization.a
LIBC_NT_SYNCHRONIZATION_A_SRCS := $(wildcard libc/nt/API-MS-Win-Core-Synch-l1-2-0/*.s)
LIBC_NT_SYNCHRONIZATION_A_OBJS = $(LIBC_NT_SYNCHRONIZATION_A_SRCS:%.s=o/$(MODE)/%.o)
LIBC_NT_SYNCHRONIZATION_A_CHECKS = $(LIBC_NT_SYNCHRONIZATION_A).pkg
LIBC_NT_SYNCHRONIZATION_A_DIRECTDEPS = LIBC_NT_KERNEL32
LIBC_NT_SYNCHRONIZATION_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_NT_SYNCHRONIZATION_A_DIRECTDEPS),$($(x))))
$(LIBC_NT_SYNCHRONIZATION_A): \
libc/nt/API-MS-Win-Core-Synch-l1-2-0/ \
$(LIBC_NT_SYNCHRONIZATION_A).pkg \
$(LIBC_NT_SYNCHRONIZATION_A_OBJS)
$(LIBC_NT_SYNCHRONIZATION_A).pkg: \
$(LIBC_NT_SYNCHRONIZATION_A_OBJS) \
$(foreach x,$(LIBC_NT_SYNCHRONIZATION_A_DIRECTDEPS),$($(x)_A).pkg)
#───────────────────────────────────────────────────────────────────────────────
2020-06-15 14:18:57 +00:00
LIBC_NT_ARTIFACTS += LIBC_NT_USER32_A
LIBC_NT_USER32 = $(LIBC_NT_USER32_A_DEPS) $(LIBC_NT_USER32_A)
LIBC_NT_USER32_A = o/$(MODE)/libc/nt/user32.a
LIBC_NT_USER32_A_SRCS := $(wildcard libc/nt/user32/*.s)
LIBC_NT_USER32_A_OBJS = $(LIBC_NT_USER32_A_SRCS:%.s=o/$(MODE)/%.o)
LIBC_NT_USER32_A_CHECKS = $(LIBC_NT_USER32_A).pkg
LIBC_NT_USER32_A_DIRECTDEPS = LIBC_NT_KERNEL32
2020-06-15 14:18:57 +00:00
LIBC_NT_USER32_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_NT_USER32_A_DIRECTDEPS),$($(x))))
$(LIBC_NT_USER32_A): \
libc/nt/user32/ \
$(LIBC_NT_USER32_A).pkg \
$(LIBC_NT_USER32_A_OBJS)
$(LIBC_NT_USER32_A).pkg: \
$(LIBC_NT_USER32_A_OBJS) \
$(foreach x,$(LIBC_NT_USER32_A_DIRECTDEPS),$($(x)_A).pkg)
#───────────────────────────────────────────────────────────────────────────────
LIBC_NT_ARTIFACTS += LIBC_NT_WS2_32_A
LIBC_NT_WS2_32 = $(LIBC_NT_WS2_32_A_DEPS) $(LIBC_NT_WS2_32_A)
LIBC_NT_WS2_32_A = o/$(MODE)/libc/nt/ws2_32.a
LIBC_NT_WS2_32_A_SRCS := $(wildcard libc/nt/ws2_32/*.s)
LIBC_NT_WS2_32_A_OBJS = $(LIBC_NT_WS2_32_A_SRCS:%.s=o/$(MODE)/%.o)
LIBC_NT_WS2_32_A_CHECKS = $(LIBC_NT_WS2_32_A).pkg
LIBC_NT_WS2_32_A_DIRECTDEPS = LIBC_NT_KERNEL32
2020-06-15 14:18:57 +00:00
LIBC_NT_WS2_32_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_NT_WS2_32_A_DIRECTDEPS),$($(x))))
$(LIBC_NT_WS2_32_A): \
libc/nt/ws2_32/ \
$(LIBC_NT_WS2_32_A).pkg \
$(LIBC_NT_WS2_32_A_OBJS)
$(LIBC_NT_WS2_32_A).pkg: \
$(LIBC_NT_WS2_32_A_OBJS) \
$(foreach x,$(LIBC_NT_WS2_32_A_DIRECTDEPS),$($(x)_A).pkg)
#───────────────────────────────────────────────────────────────────────────────
LIBC_NT_ARTIFACTS += LIBC_NT_IPHLPAPI_A
LIBC_NT_IPHLPAPI = $(LIBC_NT_IPHLPAPI_A_DEPS) $(LIBC_NT_IPHLPAPI_A)
LIBC_NT_IPHLPAPI_A = o/$(MODE)/libc/nt/iphlpapi.a
LIBC_NT_IPHLPAPI_A_SRCS := $(wildcard libc/nt/iphlpapi/*.s)
LIBC_NT_IPHLPAPI_A_OBJS = $(LIBC_NT_IPHLPAPI_A_SRCS:%.s=o/$(MODE)/%.o)
LIBC_NT_IPHLPAPI_A_CHECKS = $(LIBC_IPHLPAPI_32_A).pkg
LIBC_NT_IPHLPAPI_A_DIRECTDEPS = LIBC_NT_KERNEL32
LIBC_NT_IPHLPAPI_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_NT_IPHLPAPI_A_DIRECTDEPS),$($(x))))
$(LIBC_NT_IPHLPAPI_A): \
libc/nt/iphlpapi/ \
$(LIBC_NT_IPHLPAPI_A).pkg \
$(LIBC_NT_IPHLPAPI_A_OBJS)
$(LIBC_NT_IPHLPAPI_A).pkg: \
$(LIBC_NT_IPHLPAPI_A_OBJS) \
$(foreach x,$(LIBC_NT_IPHLPAPI_A_DIRECTDEPS),$($(x)_A).pkg)
#───────────────────────────────────────────────────────────────────────────────
2020-06-15 14:18:57 +00:00
LIBC_NT_ARTIFACTS += LIBC_NT_MSWSOCK_A
LIBC_NT_MSWSOCK = $(LIBC_NT_MSWSOCK_A_DEPS) $(LIBC_NT_MSWSOCK_A)
LIBC_NT_MSWSOCK_A = o/$(MODE)/libc/nt/MsWSock.a
LIBC_NT_MSWSOCK_A_SRCS := $(wildcard libc/nt/MsWSock/*.s)
LIBC_NT_MSWSOCK_A_OBJS = $(LIBC_NT_MSWSOCK_A_SRCS:%.s=o/$(MODE)/%.o)
LIBC_NT_MSWSOCK_A_CHECKS = $(LIBC_NT_MSWSOCK_A).pkg
LIBC_NT_MSWSOCK_A_DIRECTDEPS = LIBC_NT_KERNEL32
2020-06-15 14:18:57 +00:00
LIBC_NT_MSWSOCK_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_NT_MSWSOCK_A_DIRECTDEPS),$($(x))))
$(LIBC_NT_MSWSOCK_A): \
libc/nt/MsWSock/ \
$(LIBC_NT_MSWSOCK_A).pkg \
$(LIBC_NT_MSWSOCK_A_OBJS)
$(LIBC_NT_MSWSOCK_A).pkg: \
$(LIBC_NT_MSWSOCK_A_OBJS) \
$(foreach x,$(LIBC_NT_MSWSOCK_A_DIRECTDEPS),$($(x)_A).pkg)
#───────────────────────────────────────────────────────────────────────────────
Add SSL to redbean Your redbean can now interoperate with clients that require TLS crypto. This is accomplished using a protocol polyglot that lets us distinguish between HTTP and HTTPS regardless of the port number. Certificates will be generated automatically, if none are supplied by the user. Footprint increases by only a few hundred kb so redbean in MODY=tiny is now 1.0mb - Add lseek() polyfills for ZIP executable - Automatically polyfill /tmp/FOO paths on NT - Fix readdir() / ftw() / nftw() bugs on Windows - Introduce -B flag for slower SSL that's stronger - Remove mbedtls features Cosmopolitan doesn't need - Have base64 decoder support the uri-safe alternative - Remove Truncated HMAC because it's forbidden by the IETF - Add all the mbedtls test suites and make them go 3x faster - Support opendir() / readdir() / closedir() on ZIP executable - Use Everest for ECDHE-ECDSA because it's so good it's so good - Add tinier implementation of sha1 since it's not worth the rom - Add chi-square monte-carlo mean correlation tests for getrandom() - Source entropy on Windows from the proper interface everyone uses We're continuing to outperform NGINX and other servers on raw message throughput. Using SSL means that instead of 1,000,000 qps you can get around 300,000 qps. However redbean isn't as fast as NGINX yet at SSL handshakes, since redbean can do 2,627 per second and NGINX does 4.3k Right now, the SSL UX story works best if you give your redbean a key signing key since that can be easily generated by openssl using a one liner then redbean will do all the things that are impossibly hard to do like signing ecdsa and rsa certificates that'll work in chrome. We should integrate the let's encrypt acme protocol in the future. Live Demo: https://redbean.justine.lol/ Root Cert: https://redbean.justine.lol/redbean1.crt
2021-06-24 19:31:26 +00:00
LIBC_NT_ARTIFACTS += LIBC_NT_IPHLPAPI_A
LIBC_NT_IPHLPAPI = $(LIBC_NT_IPHLPAPI_A_DEPS) $(LIBC_NT_IPHLPAPI_A)
LIBC_NT_IPHLPAPI_A = o/$(MODE)/libc/nt/iphlpapi.a
LIBC_NT_IPHLPAPI_A_SRCS := $(wildcard libc/nt/iphlpapi/*.s)
LIBC_NT_IPHLPAPI_A_OBJS = $(LIBC_NT_IPHLPAPI_A_SRCS:%.s=o/$(MODE)/%.o)
LIBC_NT_IPHLPAPI_A_CHECKS = $(LIBC_NT_IPHLPAPI_A).pkg
LIBC_NT_IPHLPAPI_A_DIRECTDEPS = LIBC_NT_KERNEL32
LIBC_NT_IPHLPAPI_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_NT_IPHLPAPI_A_DIRECTDEPS),$($(x))))
$(LIBC_NT_IPHLPAPI_A): \
libc/nt/iphlpapi/ \
$(LIBC_NT_IPHLPAPI_A).pkg \
$(LIBC_NT_IPHLPAPI_A_OBJS)
$(LIBC_NT_IPHLPAPI_A).pkg: \
$(LIBC_NT_IPHLPAPI_A_OBJS) \
$(foreach x,$(LIBC_NT_IPHLPAPI_A_DIRECTDEPS),$($(x)_A).pkg)
#───────────────────────────────────────────────────────────────────────────────
2022-04-21 20:44:59 +00:00
LIBC_NT_ARTIFACTS += LIBC_NT_POWRPROF_A
LIBC_NT_POWRPROF = $(LIBC_NT_POWRPROF_A_DEPS) $(LIBC_NT_POWRPROF_A)
LIBC_NT_POWRPROF_A = o/$(MODE)/libc/nt/powrprof.a
LIBC_NT_POWRPROF_A_SRCS := $(wildcard libc/nt/PowrProf/*.s)
LIBC_NT_POWRPROF_A_OBJS = $(LIBC_NT_POWRPROF_A_SRCS:%.s=o/$(MODE)/%.o)
LIBC_NT_POWRPROF_A_CHECKS = $(LIBC_NT_POWRPROF_A).pkg
LIBC_NT_POWRPROF_A_DIRECTDEPS = LIBC_NT_KERNEL32
LIBC_NT_POWRPROF_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_NT_POWRPROF_A_DIRECTDEPS),$($(x))))
$(LIBC_NT_POWRPROF_A): \
libc/nt/PowrProf/ \
$(LIBC_NT_POWRPROF_A).pkg \
$(LIBC_NT_POWRPROF_A_OBJS)
$(LIBC_NT_POWRPROF_A).pkg: \
$(LIBC_NT_POWRPROF_A_OBJS) \
$(foreach x,$(LIBC_NT_POWRPROF_A_DIRECTDEPS),$($(x)_A).pkg)
#───────────────────────────────────────────────────────────────────────────────
LIBC_NT_ARTIFACTS += LIBC_NT_PDH_A
LIBC_NT_PDH = $(LIBC_NT_PDH_A_DEPS) $(LIBC_NT_PDH_A)
LIBC_NT_PDH_A = o/$(MODE)/libc/nt/pdh.a
LIBC_NT_PDH_A_SRCS := $(wildcard libc/nt/pdh/*.s)
LIBC_NT_PDH_A_OBJS = $(LIBC_NT_PDH_A_SRCS:%.s=o/$(MODE)/%.o)
LIBC_NT_PDH_A_CHECKS = $(LIBC_NT_PDH_A).pkg
LIBC_NT_PDH_A_DIRECTDEPS = LIBC_NT_KERNEL32
LIBC_NT_PDH_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_NT_PDH_A_DIRECTDEPS),$($(x))))
$(LIBC_NT_PDH_A): \
libc/nt/pdh/ \
$(LIBC_NT_PDH_A).pkg \
$(LIBC_NT_PDH_A_OBJS)
$(LIBC_NT_PDH_A).pkg: \
$(LIBC_NT_PDH_A_OBJS) \
$(foreach x,$(LIBC_NT_PDH_A_DIRECTDEPS),$($(x)_A).pkg)
#───────────────────────────────────────────────────────────────────────────────
LIBC_NT_ARTIFACTS += LIBC_NT_PSAPI_A
LIBC_NT_PSAPI = $(LIBC_NT_PSAPI_A_DEPS) $(LIBC_NT_PSAPI_A)
LIBC_NT_PSAPI_A = o/$(MODE)/libc/nt/psapi.a
LIBC_NT_PSAPI_A_SRCS := $(wildcard libc/nt/psapi/*.s)
LIBC_NT_PSAPI_A_OBJS = $(LIBC_NT_PSAPI_A_SRCS:%.s=o/$(MODE)/%.o)
LIBC_NT_PSAPI_A_CHECKS = $(LIBC_NT_PSAPI_A).pkg
LIBC_NT_PSAPI_A_DIRECTDEPS = LIBC_NT_KERNEL32
LIBC_NT_PSAPI_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_NT_PSAPI_A_DIRECTDEPS),$($(x))))
$(LIBC_NT_PSAPI_A): \
libc/nt/psapi/ \
$(LIBC_NT_PSAPI_A).pkg \
$(LIBC_NT_PSAPI_A_OBJS)
$(LIBC_NT_PSAPI_A).pkg: \
$(LIBC_NT_PSAPI_A_OBJS) \
$(foreach x,$(LIBC_NT_PSAPI_A_DIRECTDEPS),$($(x)_A).pkg)
#───────────────────────────────────────────────────────────────────────────────
Prove that Makefile is fully defined The whole repository is now buildable with GNU Make Landlock sandboxing. This proves that no Makefile targets exist which touch files other than their declared prerequisites. In order to do this, we had to: 1. Stop code morphing GCC output in package.com and instead run a newly introduced FIXUPOBJ.COM command after GCC invocations. 2. Disable all the crumby Python unit tests that do things like create files in the current directory, or rename() files between folders. This ended up being a lot of tests, but most of them are still ok. 3. Introduce an .UNSANDBOXED variable to GNU Make to disable Landlock. We currently only do this for things like `make tags`. 4. This change deletes some GNU Make code that was preventing the execve() optimization from working. This means it should no longer be necessary in most cases for command invocations to be indirected through the cocmd interpreter. 5. Missing dependencies had to be declared in certain places, in cases where they couldn't be automatically determined by MKDEPS.COM 6. The libcxx header situation has finally been tamed. One of the things that makes this difficult is MKDEPS.COM only wants to consider the first 64kb of a file, in order to go fast. But libcxx likes to have #include lines buried after huge documentation. 7. An .UNVEIL variable has been introduced to GNU Make just in case we ever wish to explicitly specify additional things that need to be whitelisted which aren't strictly prerequisites. This works in a manner similar to the recently introduced .EXTRA_PREREQS feature. There's now a new build/bootstrap/make.com prebuilt binary available. It should no longer be possible to write invalid Makefile code.
2022-08-06 10:51:50 +00:00
$(LIBC_NT_OBJS): \
o/libc/nt/codegen.inc
2020-06-15 14:18:57 +00:00
o/libc/nt/codegen.inc: \
ape/idata.internal.h \
Prove that Makefile is fully defined The whole repository is now buildable with GNU Make Landlock sandboxing. This proves that no Makefile targets exist which touch files other than their declared prerequisites. In order to do this, we had to: 1. Stop code morphing GCC output in package.com and instead run a newly introduced FIXUPOBJ.COM command after GCC invocations. 2. Disable all the crumby Python unit tests that do things like create files in the current directory, or rename() files between folders. This ended up being a lot of tests, but most of them are still ok. 3. Introduce an .UNSANDBOXED variable to GNU Make to disable Landlock. We currently only do this for things like `make tags`. 4. This change deletes some GNU Make code that was preventing the execve() optimization from working. This means it should no longer be necessary in most cases for command invocations to be indirected through the cocmd interpreter. 5. Missing dependencies had to be declared in certain places, in cases where they couldn't be automatically determined by MKDEPS.COM 6. The libcxx header situation has finally been tamed. One of the things that makes this difficult is MKDEPS.COM only wants to consider the first 64kb of a file, in order to go fast. But libcxx likes to have #include lines buried after huge documentation. 7. An .UNVEIL variable has been introduced to GNU Make just in case we ever wish to explicitly specify additional things that need to be whitelisted which aren't strictly prerequisites. This works in a manner similar to the recently introduced .EXTRA_PREREQS feature. There's now a new build/bootstrap/make.com prebuilt binary available. It should no longer be possible to write invalid Makefile code.
2022-08-06 10:51:50 +00:00
ape/macros.internal.h \
ape/relocations.h \
libc/macros.internal.h \
libc/intrin/asancodes.h
2020-06-15 14:18:57 +00:00
.PHONY: o/$(MODE)/libc/nt
o/$(MODE)/libc/nt: \
$(LIBC_NT_LIBS) \
$(LIBC_NT_CHECKS)