21
21
# make -j8 -O MODE=tiny
22
22
#
23
23
# # 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
26
26
#
27
27
# # view source
28
28
# less examples/hello.c
29
29
#
30
30
# # 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
33
33
#
34
34
# # 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
37
37
#
38
38
# # 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
41
41
# less examples/crashreport.c
42
42
#
43
43
# # extremely tiny binaries
51
51
#
52
52
# TROUBLESHOOTING
53
53
#
54
- # make -j8 -O V=1 o//examples/hello.com
54
+ # make -j8 -O V=1 o//examples/hello
55
55
# make o//examples/life.elf -pn |& less
56
56
# etc.
57
57
#
58
58
# SEE ALSO
59
59
#
60
60
# build/config.mk
61
61
62
- SHELL = build/bootstrap/cocmd.com
62
+ SHELL = build/bootstrap/cocmd
63
63
MAKEFLAGS += --no-builtin-rules
64
64
65
65
.SUFFIXES :
@@ -77,8 +77,8 @@ COMMA := ,
77
77
PWD := $(shell pwd)
78
78
79
79
# 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
82
82
ifneq ($(findstring //wsl.localhost/,$(CURDIR ) $(PWD ) ) ,)
83
83
$(warning wsl2 interop is enabled)
84
84
$(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)
89
89
90
90
# apple still distributes a 17 year old version of gnu make
91
91
ifeq ($(MAKE_VERSION ) , 3.81)
92
- $(error please use build/bootstrap/make.com )
92
+ $(error please use build/bootstrap/make)
93
93
endif
94
94
95
95
LC_ALL = C
@@ -101,21 +101,21 @@ XARGS ?= xargs -P4 -rs8000
101
101
DOT ?= dot
102
102
CLANG = clang
103
103
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 )
119
119
120
120
IGNORE := $(shell $(MKDIR ) $(TMPDIR ) )
121
121
@@ -187,7 +187,7 @@ o/$(MODE): \
187
187
o/$(MODE ) / : o/$(MODE )
188
188
o/$(MODE ) /. : o/$(MODE )
189
189
190
- # check if we're using o//third_party/make/make.com
190
+ # check if we're using o//third_party/make/make
191
191
# we added sandboxing to guarantee cosmo's makefile is hermetic
192
192
# it also shaves away 200ms of startup latency with native $(uniq)
193
193
ifneq ($(LANDLOCKMAKE_VERSION ) ,)
@@ -415,17 +415,17 @@ o/$(MODE)/hdrs-old.txt: o/$(MODE)/.x $(MAKEFILES) $(call uniq,$(foreach x,$(HDRS
415
415
$(file >$@ ) $(foreach x,$(HDRS ) $(INCS ) ,$(file >>$@ ,$(x ) ) )
416
416
417
417
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
419
419
@$(RM ) $@
420
- @o/$(MODE ) /third_party/ctags/ctags.com $(TAGSFLAGS ) -L $< -o $@
420
+ @o/$(MODE ) /third_party/ctags/ctags $(TAGSFLAGS ) -L $< -o $@
421
421
422
422
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
424
424
@$(RM ) $@
425
- @build/htags o/$(MODE ) /third_party/ctags/ctags.com -L $< -o $@
425
+ @build/htags o/$(MODE ) /third_party/ctags/ctags -L $< -o $@
426
426
427
427
loc : private .UNSANDBOXED = 1
428
- loc : o/$(MODE ) /tool/build/summy.com
428
+ loc : o/$(MODE ) /tool/build/summy
429
429
find -name \* .h -or -name \* .c -or -name \* .S | \
430
430
$(XARGS ) wc -l | grep total | awk ' {print $$1}' | $<
431
431
@@ -550,16 +550,16 @@ o/cosmopolitan.h: o/cosmopolitan.h.txt \
550
550
$(wildcard libc/integral/* ) \
551
551
$(foreach x,$(COSMOPOLITAN_H_PKGS ) ,$($(x ) _HDRS) ) \
552
552
$(foreach x,$(COSMOPOLITAN_H_PKGS ) ,$($(x ) _INCS) )
553
- @$(COMPILE ) -AROLLUP -T$@ build/bootstrap/rollup.com @$< >> $@
553
+ @$(COMPILE ) -AROLLUP -T$@ build/bootstrap/rollup @$< >> $@
554
554
555
555
o/cosmopolitan.html : private .UNSANDBOXED = 1
556
556
o/cosmopolitan.html : \
557
- o/$(MODE ) /third_party/chibicc/chibicc.com. dbg \
557
+ o/$(MODE ) /third_party/chibicc/chibicc.dbg \
558
558
$(filter-out % .s,$(foreach x,$(COSMOPOLITAN_OBJECTS ) ,$($(x ) _SRCS) ) ) \
559
559
$(filter-out % .cpp,$(filter-out % .cc,$(SRCS ) ) ) \
560
560
$(HDRS )
561
561
$(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 \
563
563
-fno-common -include libc/integral/normalize.inc -o $@ \
564
564
-DCOSMO @$(TMPDIR ) /$(subst /,_,$@ )
565
565
@@ -582,23 +582,23 @@ TOOLCHAIN_ARTIFACTS = \
582
582
o/$(MODE ) /ape/ape-no-modify-self.o \
583
583
o/$(MODE ) /cosmopolitan.a \
584
584
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
592
592
else
593
593
TOOLCHAIN_ARTIFACTS = \
594
594
o/$(MODE ) /ape/ape.elf \
595
595
o/$(MODE ) /ape/aarch64.lds \
596
596
o/$(MODE ) /libc/crt/crt.o \
597
597
o/$(MODE ) /cosmopolitan.a \
598
598
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
602
602
endif
603
603
604
604
.PHONY : toolchain
0 commit comments