Stop using .com extension in monorepo

The WIN32 CreateProcess() function does not require an .exe or .com
suffix in order to spawn an executable. Now that we have Cosmo bash
we're no longer so dependent on the cmd.exe prompt.
This commit is contained in:
Justine Tunney 2024-03-02 16:57:56 -08:00
parent c8383f25b4
commit a6baba1b07
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
239 changed files with 2092 additions and 2244 deletions

View file

@ -11,87 +11,87 @@ TOOL_HELLO_SRCS = $(TOOL_HELLO_SRCS_C) $(TOOL_HELLO_SRCS_S)
TOOL_HELLO_OBJS = $(TOOL_HELLO_SRCS_C:%.c=o/$(MODE)/%.o) $(TOOL_HELLO_SRCS_S:%.S=o/$(MODE)/%.o)
TOOL_HELLO_BINS = $(TOOL_HELLO_COMS) $(TOOL_HELLO_COMS:%=%.dbg)
TOOL_HELLO_COMS = \
o/$(MODE)/tool/hello/hello.com \
o/$(MODE)/tool/hello/hello-pe.com \
o/$(MODE)/tool/hello/hello-elf.com \
o/$(MODE)/tool/hello/hello-unix.com
TOOL_HELLO_COMS = \
o/$(MODE)/tool/hello/hello \
o/$(MODE)/tool/hello/hello-pe \
o/$(MODE)/tool/hello/hello-elf \
o/$(MODE)/tool/hello/hello-unix
TOOL_HELLO_DIRECTDEPS = \
LIBC_CALLS \
TOOL_HELLO_DIRECTDEPS = \
LIBC_CALLS \
LIBC_RUNTIME
TOOL_HELLO_DEPS := \
TOOL_HELLO_DEPS := \
$(call uniq,$(foreach x,$(TOOL_HELLO_DIRECTDEPS),$($(x))))
o/$(MODE)/tool/hello/hello.pkg: \
$(TOOL_HELLO_OBJS) \
o/$(MODE)/tool/hello/hello.pkg: \
$(TOOL_HELLO_OBJS) \
$(foreach x,$(TOOL_HELLO_DIRECTDEPS),$($(x)_A).pkg)
# generates debuggable executable using gcc
o/$(MODE)/tool/hello/hello.com.dbg: \
$(TOOL_HELLO_DEPS) \
o/$(MODE)/tool/hello/hello.o \
o/$(MODE)/tool/hello/hello.pkg \
$(CRT) \
o/$(MODE)/tool/hello/hello.dbg: \
$(TOOL_HELLO_DEPS) \
o/$(MODE)/tool/hello/hello.o \
o/$(MODE)/tool/hello/hello.pkg \
$(CRT) \
$(APE)
@$(APELINK)
# uses apelink to turn it into an ape executable
# support vector is set to all operating systems
o/$(MODE)/tool/hello/hello.ape: \
o/$(MODE)/tool/hello/hello.com.dbg \
o/$(MODE)/tool/build/apelink.com \
o/$(MODE)/tool/build/pecheck.com \
o/$(MODE)/tool/hello/hello.ape: \
o/$(MODE)/tool/hello/hello.dbg \
o/$(MODE)/tool/build/apelink \
o/$(MODE)/tool/build/pecheck \
o/$(MODE)/ape/ape.elf
@$(COMPILE) -ALINK.ape o/$(MODE)/tool/build/apelink.com -o $@ -l o/$(MODE)/ape/ape.elf $<
@$(COMPILE) -APECHECK -wT$@ o/$(MODE)/tool/build/pecheck.com $@
@$(COMPILE) -ALINK.ape o/$(MODE)/tool/build/apelink -o $@ -l o/$(MODE)/ape/ape.elf $<
@$(COMPILE) -APECHECK -wT$@ o/$(MODE)/tool/build/pecheck $@
# uses apelink to generate elf-only executable
# support vector = linux/freebsd/openbsd/netbsd/metal
o/$(MODE)/tool/hello/hello-elf.ape: \
o/$(MODE)/tool/hello/hello.com.dbg \
o/$(MODE)/tool/build/apelink.com \
o/$(MODE)/tool/hello/hello-elf.ape: \
o/$(MODE)/tool/hello/hello.dbg \
o/$(MODE)/tool/build/apelink \
o/$(MODE)/ape/ape.elf
@$(COMPILE) -ALINK.ape o/$(MODE)/tool/build/apelink.com -V elf -o $@ -l o/$(MODE)/ape/ape.elf $<
@$(COMPILE) -ALINK.ape o/$(MODE)/tool/build/apelink -V elf -o $@ -l o/$(MODE)/ape/ape.elf $<
# uses apelink to generate non-pe ape executable
# support vector = macos/linux/freebsd/openbsd/netbsd
# - great way to avoid attention from bad virus scanners
# - creates tinier executable by reducing alignment requirement
o/$(MODE)/tool/hello/hello-unix.ape: \
o/$(MODE)/tool/hello/hello.com.dbg \
o/$(MODE)/tool/build/apelink.com \
o/$(MODE)/tool/hello/hello-unix.ape: \
o/$(MODE)/tool/hello/hello.dbg \
o/$(MODE)/tool/build/apelink \
o/$(MODE)/ape/ape.elf
@$(COMPILE) -ALINK.ape o/$(MODE)/tool/build/apelink.com -V unix -o $@ -l o/$(MODE)/ape/ape.elf $<
@$(COMPILE) -ALINK.ape o/$(MODE)/tool/build/apelink -V unix -o $@ -l o/$(MODE)/ape/ape.elf $<
# elf2pe generates optimal pe binaries
# windows is the only platform supported
# doesn't depend on ape or the cosmopolitan c library
o/$(MODE)/tool/hello/hello-pe.com.dbg: \
o/$(MODE)/tool/hello/hello-pe.dbg: \
o/$(MODE)/tool/hello/hello-pe.o
@$(COMPILE) -ALINK.elf $(LINK) $(LINKARGS) $(OUTPUT_OPTION) -q -e WinMain
o/$(MODE)/tool/hello/hello-pe.ape: \
o/$(MODE)/tool/hello/hello-pe.com.dbg \
o/$(MODE)/tool/build/elf2pe.com
@$(COMPILE) -AELF2PE o/$(MODE)/tool/build/elf2pe.com -o $@ $<
o/$(MODE)/tool/hello/hello-pe.ape: \
o/$(MODE)/tool/hello/hello-pe.dbg \
o/$(MODE)/tool/build/elf2pe
@$(COMPILE) -AELF2PE o/$(MODE)/tool/build/elf2pe -o $@ $<
# elf2pe can generate binaries that don't have dll imports
o/$(MODE)/tool/hello/life-pe.com.dbg: \
o/$(MODE)/tool/hello/life-pe.dbg: \
o/$(MODE)/tool/hello/life-pe.o
@$(COMPILE) -ALINK.elf $(LINK) $(LINKARGS) $(OUTPUT_OPTION) -q -e WinMain
o/$(MODE)/tool/hello/life-pe.ape: \
o/$(MODE)/tool/hello/life-pe.com.dbg \
o/$(MODE)/tool/build/elf2pe.com
@$(COMPILE) -AELF2PE o/$(MODE)/tool/build/elf2pe.com -o $@ $<
o/$(MODE)/tool/hello/life-pe.ape: \
o/$(MODE)/tool/hello/life-pe.dbg \
o/$(MODE)/tool/build/elf2pe
@$(COMPILE) -AELF2PE o/$(MODE)/tool/build/elf2pe -o $@ $<
# demonstrates in process monitor the lowest resource usage a win32 app can have
o/$(MODE)/tool/hello/wait-pe.com.dbg: \
o/$(MODE)/tool/hello/wait-pe.dbg: \
o/$(MODE)/tool/hello/wait-pe.o
@$(COMPILE) -ALINK.elf $(LINK) $(LINKARGS) $(OUTPUT_OPTION) -q -e WinMain
o/$(MODE)/tool/hello/wait-pe.ape: \
o/$(MODE)/tool/hello/wait-pe.com.dbg \
o/$(MODE)/tool/build/elf2pe.com
@$(COMPILE) -AELF2PE o/$(MODE)/tool/build/elf2pe.com -R 64kb -S 4kb -o $@ $<
o/$(MODE)/tool/hello/wait-pe.ape: \
o/$(MODE)/tool/hello/wait-pe.dbg \
o/$(MODE)/tool/build/elf2pe
@$(COMPILE) -AELF2PE o/$(MODE)/tool/build/elf2pe -R 64kb -S 4kb -o $@ $<
$(TOOL_HELLO_OBJS): tool/hello/BUILD.mk