Skip to content

Commit a6baba1

Browse files
committed
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.
1 parent c8383f2 commit a6baba1

File tree

239 files changed

+2101
-2253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+2101
-2253
lines changed

Makefile

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@
2121
# make -j8 -O MODE=tiny
2222
#
2323
# # build individual target
24-
# make -j8 -O o//examples/hello.com
25-
# o//examples/hello.com
24+
# make -j8 -O o//examples/hello
25+
# o//examples/hello
2626
#
2727
# # view source
2828
# less examples/hello.c
2929
#
3030
# # view binary
31-
# o//tool/viz/bing.com o//examples/hello.com |
32-
# o//tool/viz/fold.com
31+
# o//tool/viz/bing o//examples/hello |
32+
# o//tool/viz/fold
3333
#
3434
# # view transitive closure of legalese
35-
# o//tool/viz/bing.com -n o//examples/hello.com |
36-
# o//tool/viz/fold.com
35+
# o//tool/viz/bing -n o//examples/hello |
36+
# o//tool/viz/fold
3737
#
3838
# # basic debugging
39-
# make -j8 -O MODE=dbg o/dbg/examples/crashreport.com
40-
# o/examples/crashreport.com
39+
# make -j8 -O MODE=dbg o/dbg/examples/crashreport
40+
# o/examples/crashreport
4141
# less examples/crashreport.c
4242
#
4343
# # extremely tiny binaries
@@ -51,15 +51,15 @@
5151
#
5252
# TROUBLESHOOTING
5353
#
54-
# make -j8 -O V=1 o//examples/hello.com
54+
# make -j8 -O V=1 o//examples/hello
5555
# make o//examples/life.elf -pn |& less
5656
# etc.
5757
#
5858
# SEE ALSO
5959
#
6060
# build/config.mk
6161

62-
SHELL = build/bootstrap/cocmd.com
62+
SHELL = build/bootstrap/cocmd
6363
MAKEFLAGS += --no-builtin-rules
6464

6565
.SUFFIXES:
@@ -77,8 +77,8 @@ COMMA := ,
7777
PWD := $(shell pwd)
7878

7979
# detect wsl2 running cosmopolitan binaries on the host by checking whether:
80-
# - user ran build/bootstrap/make.com, in which case make's working directory is in wsl
81-
# - user ran make, in which case cocmd.com's working directory is in wsl
80+
# - user ran build/bootstrap/make, in which case make's working directory is in wsl
81+
# - user ran make, in which case cocmd's working directory is in wsl
8282
ifneq ($(findstring //wsl.localhost/,$(CURDIR) $(PWD)),)
8383
$(warning wsl2 interop is enabled)
8484
$(error you need to run sudo sh -c 'echo -1 > /proc/sys/fs/binfmt_misc/WSLInterop')
@@ -89,7 +89,7 @@ UNAME_S := $(shell uname -s)
8989

9090
# apple still distributes a 17 year old version of gnu make
9191
ifeq ($(MAKE_VERSION), 3.81)
92-
$(error please use build/bootstrap/make.com)
92+
$(error please use build/bootstrap/make)
9393
endif
9494

9595
LC_ALL = C
@@ -101,21 +101,21 @@ XARGS ?= xargs -P4 -rs8000
101101
DOT ?= dot
102102
CLANG = clang
103103
TMPDIR = o/tmp
104-
AR = build/bootstrap/ar.com
105-
CP = build/bootstrap/cp.com
106-
RM = build/bootstrap/rm.com -f
107-
GZIP = build/bootstrap/gzip.com
108-
ECHO = build/bootstrap/echo.com
109-
CHMOD = build/bootstrap/chmod.com
110-
TOUCH = build/bootstrap/touch.com
111-
PKG = build/bootstrap/package.com
112-
MKDEPS = build/bootstrap/mkdeps.com
113-
ZIPOBJ = build/bootstrap/zipobj.com
114-
ZIPCOPY = build/bootstrap/zipcopy.com
115-
PECHECK = build/bootstrap/pecheck.com
116-
FIXUPOBJ = build/bootstrap/fixupobj.com
117-
MKDIR = build/bootstrap/mkdir.com -p
118-
COMPILE = build/bootstrap/compile.com -V9 -M2048m -P8192 $(QUOTA)
104+
AR = build/bootstrap/ar
105+
CP = build/bootstrap/cp
106+
RM = build/bootstrap/rm -f
107+
GZIP = build/bootstrap/gzip
108+
ECHO = build/bootstrap/echo
109+
CHMOD = build/bootstrap/chmod
110+
TOUCH = build/bootstrap/touch
111+
PKG = build/bootstrap/package
112+
MKDEPS = build/bootstrap/mkdeps
113+
ZIPOBJ = build/bootstrap/zipobj
114+
ZIPCOPY = build/bootstrap/zipcopy
115+
PECHECK = build/bootstrap/pecheck
116+
FIXUPOBJ = build/bootstrap/fixupobj
117+
MKDIR = build/bootstrap/mkdir -p
118+
COMPILE = build/bootstrap/compile -V9 -M2048m -P8192 $(QUOTA)
119119

120120
IGNORE := $(shell $(MKDIR) $(TMPDIR))
121121

@@ -187,7 +187,7 @@ o/$(MODE): \
187187
o/$(MODE)/: o/$(MODE)
188188
o/$(MODE)/.: o/$(MODE)
189189

190-
# check if we're using o//third_party/make/make.com
190+
# check if we're using o//third_party/make/make
191191
# we added sandboxing to guarantee cosmo's makefile is hermetic
192192
# it also shaves away 200ms of startup latency with native $(uniq)
193193
ifneq ($(LANDLOCKMAKE_VERSION),)
@@ -415,17 +415,17 @@ o/$(MODE)/hdrs-old.txt: o/$(MODE)/.x $(MAKEFILES) $(call uniq,$(foreach x,$(HDRS
415415
$(file >$@) $(foreach x,$(HDRS) $(INCS),$(file >>$@,$(x)))
416416

417417
TAGS: private .UNSANDBOXED = 1
418-
TAGS: o/$(MODE)/srcs-old.txt $(SRCS) #o/$(MODE)/third_party/ctags/ctags.com
418+
TAGS: o/$(MODE)/srcs-old.txt $(SRCS) #o/$(MODE)/third_party/ctags/ctags
419419
@$(RM) $@
420-
@o/$(MODE)/third_party/ctags/ctags.com $(TAGSFLAGS) -L $< -o $@
420+
@o/$(MODE)/third_party/ctags/ctags $(TAGSFLAGS) -L $< -o $@
421421

422422
HTAGS: private .UNSANDBOXED = 1
423-
HTAGS: o/$(MODE)/hdrs-old.txt $(filter-out third_party/libcxx/%,$(HDRS)) #o/$(MODE)/third_party/ctags/ctags.com
423+
HTAGS: o/$(MODE)/hdrs-old.txt $(filter-out third_party/libcxx/%,$(HDRS)) #o/$(MODE)/third_party/ctags/ctags
424424
@$(RM) $@
425-
@build/htags o/$(MODE)/third_party/ctags/ctags.com -L $< -o $@
425+
@build/htags o/$(MODE)/third_party/ctags/ctags -L $< -o $@
426426

427427
loc: private .UNSANDBOXED = 1
428-
loc: o/$(MODE)/tool/build/summy.com
428+
loc: o/$(MODE)/tool/build/summy
429429
find -name \*.h -or -name \*.c -or -name \*.S | \
430430
$(XARGS) wc -l | grep total | awk '{print $$1}' | $<
431431

@@ -550,16 +550,16 @@ o/cosmopolitan.h: o/cosmopolitan.h.txt \
550550
$(wildcard libc/integral/*) \
551551
$(foreach x,$(COSMOPOLITAN_H_PKGS),$($(x)_HDRS)) \
552552
$(foreach x,$(COSMOPOLITAN_H_PKGS),$($(x)_INCS))
553-
@$(COMPILE) -AROLLUP -T$@ build/bootstrap/rollup.com @$< >>$@
553+
@$(COMPILE) -AROLLUP -T$@ build/bootstrap/rollup @$< >>$@
554554

555555
o/cosmopolitan.html: private .UNSANDBOXED = 1
556556
o/cosmopolitan.html: \
557-
o/$(MODE)/third_party/chibicc/chibicc.com.dbg \
557+
o/$(MODE)/third_party/chibicc/chibicc.dbg \
558558
$(filter-out %.s,$(foreach x,$(COSMOPOLITAN_OBJECTS),$($(x)_SRCS))) \
559559
$(filter-out %.cpp,$(filter-out %.cc,$(SRCS))) \
560560
$(HDRS)
561561
$(file >$(TMPDIR)/$(subst /,_,$@),$(filter-out %.cpp,$(filter-out %.cc,$(filter-out %.s,$(foreach x,$(COSMOPOLITAN_OBJECTS),$($(x)_SRCS))))))
562-
o/$(MODE)/third_party/chibicc/chibicc.com.dbg -J \
562+
o/$(MODE)/third_party/chibicc/chibicc.dbg -J \
563563
-fno-common -include libc/integral/normalize.inc -o $@ \
564564
-DCOSMO @$(TMPDIR)/$(subst /,_,$@)
565565

@@ -582,23 +582,23 @@ TOOLCHAIN_ARTIFACTS = \
582582
o/$(MODE)/ape/ape-no-modify-self.o \
583583
o/$(MODE)/cosmopolitan.a \
584584
o/$(MODE)/third_party/libcxx/libcxx.a \
585-
o/$(MODE)/tool/build/march-native.com \
586-
o/$(MODE)/tool/build/ar.com \
587-
o/$(MODE)/tool/build/mktemper.com \
588-
o/$(MODE)/tool/build/fixupobj.com \
589-
o/$(MODE)/tool/build/zipcopy.com \
590-
o/$(MODE)/tool/build/apelink.com \
591-
o/$(MODE)/tool/build/pecheck.com
585+
o/$(MODE)/tool/build/march-native \
586+
o/$(MODE)/tool/build/ar \
587+
o/$(MODE)/tool/build/mktemper \
588+
o/$(MODE)/tool/build/fixupobj \
589+
o/$(MODE)/tool/build/zipcopy \
590+
o/$(MODE)/tool/build/apelink \
591+
o/$(MODE)/tool/build/pecheck
592592
else
593593
TOOLCHAIN_ARTIFACTS = \
594594
o/$(MODE)/ape/ape.elf \
595595
o/$(MODE)/ape/aarch64.lds \
596596
o/$(MODE)/libc/crt/crt.o \
597597
o/$(MODE)/cosmopolitan.a \
598598
o/$(MODE)/third_party/libcxx/libcxx.a \
599-
o/$(MODE)/tool/build/march-native.com \
600-
o/$(MODE)/tool/build/fixupobj.com \
601-
o/$(MODE)/tool/build/zipcopy.com
599+
o/$(MODE)/tool/build/march-native \
600+
o/$(MODE)/tool/build/fixupobj \
601+
o/$(MODE)/tool/build/zipcopy
602602
endif
603603

604604
.PHONY: toolchain

ape/BUILD.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ o/$(MODE)/ape/loader-xnu-clang.asm: ape/loader.c
220220
@$(COMPILE) -AOBJECTIFY.c $(CLANG) -DSUPPORT_VECTOR=8 -S -g0 $(APE_LOADER_FLAGS)
221221

222222
o/$(MODE)/ape/ape.elf: o/$(MODE)/ape/ape.elf.dbg
223-
@$(COMPILE) -AOBJBINCOPY -w build/bootstrap/objbincopy.com -f -o $@ $<
223+
@$(COMPILE) -AOBJBINCOPY -w build/bootstrap/objbincopy -f -o $@ $<
224224

225225
o/$(MODE)/ape/ape.macho: o/$(MODE)/ape/ape.elf.dbg
226-
@$(COMPILE) -AOBJBINCOPY -w build/bootstrap/objbincopy.com -fm -o $@ $<
226+
@$(COMPILE) -AOBJBINCOPY -w build/bootstrap/objbincopy -fm -o $@ $<
227227

228228
APE_LOADER_LDFLAGS = \
229229
-static \

ape/loader-macho.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "libc/macros.internal.h"
2323

2424
// Apple Mach-O Executable Headers
25-
// Fixups are applied by objbincopy.com
25+
// Fixups are applied by objbincopy
2626
// There must exist a MAC_LC_SEGMENT_64 for every PT_LOAD
2727

2828
.section .macho,"a",@progbits
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)