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───────────────────────┘
|
|
|
|
#
|
|
|
|
# SYNOPSIS
|
|
|
|
#
|
|
|
|
# Freestanding Hermetically-Sealed Monolithic Repository
|
|
|
|
#
|
|
|
|
# REQUIREMENTS
|
|
|
|
#
|
|
|
|
# You can run your programs on any operating system, but you have
|
|
|
|
# to build them on Linux 2.6+ (or WSL) using GNU Make. A modern C
|
|
|
|
# compiler that's statically-linked comes included as a courtesy.
|
|
|
|
#
|
|
|
|
# EXAMPLES
|
|
|
|
#
|
|
|
|
# # build and run everything
|
|
|
|
# make -j8 -O
|
|
|
|
# make -j8 -O MODE=dbg
|
|
|
|
# make -j8 -O MODE=opt
|
|
|
|
# make -j8 -O MODE=rel
|
|
|
|
# make -j8 -O MODE=tiny
|
|
|
|
#
|
|
|
|
# # build individual target
|
|
|
|
# make -j8 -O o//examples/hello.com
|
|
|
|
# o//examples/hello.com
|
|
|
|
#
|
|
|
|
# # view source
|
|
|
|
# less examples/hello.c
|
|
|
|
#
|
|
|
|
# # view binary
|
|
|
|
# o//tool/viz/bing.com o//examples/hello.com |
|
|
|
|
# o//tool/viz/fold.com
|
|
|
|
#
|
|
|
|
# # view transitive closure of legalese
|
|
|
|
# o//tool/viz/bing.com -n o//examples/hello.com |
|
|
|
|
# o//tool/viz/fold.com
|
|
|
|
#
|
|
|
|
# # basic debugging
|
|
|
|
# make -j8 -O MODE=dbg o/dbg/examples/crashreport.com
|
2022-04-17 05:09:36 +00:00
|
|
|
# o/examples/crashreport.com
|
2020-06-15 14:18:57 +00:00
|
|
|
# less examples/crashreport.c
|
|
|
|
#
|
2021-03-03 22:30:25 +00:00
|
|
|
# # extremely tiny binaries
|
2020-06-15 14:18:57 +00:00
|
|
|
# make -j8 -O MODE=tiny \
|
2020-06-16 02:01:28 +00:00
|
|
|
# LDFLAGS+=-s \
|
|
|
|
# CPPFLAGS+=-DIM_FEELING_NAUGHTY \
|
|
|
|
# CPPFLAGS+=-DSUPPORT_VECTOR=0b00000001 \
|
2020-06-15 14:18:57 +00:00
|
|
|
# o/tiny/examples/hello4.elf
|
|
|
|
# ls -hal o/tiny/examples/hello4.elf
|
|
|
|
# o/tiny/examples/hello4.elf
|
|
|
|
#
|
|
|
|
# TROUBLESHOOTING
|
|
|
|
#
|
2021-02-07 14:11:44 +00:00
|
|
|
# make -j8 -O V=1 o//examples/hello.com
|
2020-06-15 14:18:57 +00:00
|
|
|
# make o//examples/life.elf -pn |& less
|
|
|
|
# etc.
|
|
|
|
#
|
|
|
|
# SEE ALSO
|
|
|
|
#
|
|
|
|
# build/config.mk
|
|
|
|
|
2022-07-21 16:16:38 +00:00
|
|
|
SHELL = build/bootstrap/cocmd.com
|
2022-08-07 12:59:53 +00:00
|
|
|
HOSTS ?= freebsd openbsd netbsd rhel7 rhel5 win10 xnu
|
2022-07-21 16:16:38 +00:00
|
|
|
MAKEFLAGS += --no-builtin-rules
|
2020-06-15 14:18:57 +00:00
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
.DELETE_ON_ERROR:
|
|
|
|
.FEATURES: output-sync
|
|
|
|
.PHONY: all o bins check test depend tags
|
|
|
|
|
|
|
|
all: o
|
2022-03-21 10:46:16 +00:00
|
|
|
o: o/$(MODE)
|
|
|
|
|
|
|
|
o/$(MODE): \
|
|
|
|
o/$(MODE)/ape \
|
2020-12-19 19:21:04 +00:00
|
|
|
o/$(MODE)/dsp \
|
|
|
|
o/$(MODE)/net \
|
|
|
|
o/$(MODE)/libc \
|
|
|
|
o/$(MODE)/test \
|
|
|
|
o/$(MODE)/tool \
|
|
|
|
o/$(MODE)/examples \
|
2020-06-15 14:18:57 +00:00
|
|
|
o/$(MODE)/third_party
|
|
|
|
|
|
|
|
PKGS =
|
|
|
|
|
2021-02-03 14:22:51 +00:00
|
|
|
-include ~/.cosmo.mk
|
2020-06-15 14:18:57 +00:00
|
|
|
include build/functions.mk #─┐
|
2021-02-03 14:22:51 +00:00
|
|
|
include build/definitions.mk # ├──META
|
|
|
|
include build/config.mk # │ You can build
|
|
|
|
include build/rules.mk # │ You can topologically order
|
2020-06-15 14:18:57 +00:00
|
|
|
include build/online.mk # │
|
|
|
|
include libc/stubs/stubs.mk #─┘
|
|
|
|
include libc/nexgen32e/nexgen32e.mk #─┐
|
2021-02-03 14:22:51 +00:00
|
|
|
include libc/sysv/sysv.mk # ├──SYSTEM SUPPORT
|
|
|
|
include libc/nt/nt.mk # │ You can do math
|
|
|
|
include libc/intrin/intrin.mk # │ You can use the stack
|
|
|
|
include libc/linux/linux.mk # │ You can manipulate arrays
|
|
|
|
include libc/tinymath/tinymath.mk # │ You can issue raw system calls
|
2020-06-15 14:18:57 +00:00
|
|
|
include third_party/compiler_rt/compiler_rt.mk # │
|
|
|
|
include libc/bits/bits.mk # │
|
|
|
|
include libc/str/str.mk # │
|
|
|
|
include third_party/xed/xed.mk # │
|
|
|
|
include third_party/zlib/zlib.mk # │
|
|
|
|
include libc/elf/elf.mk # │
|
2021-02-03 14:22:51 +00:00
|
|
|
include ape/ape.mk # │
|
|
|
|
include libc/fmt/fmt.mk #─┘
|
2020-06-15 14:18:57 +00:00
|
|
|
include libc/calls/calls.mk #─┐
|
2021-02-03 14:22:51 +00:00
|
|
|
include libc/runtime/runtime.mk # ├──SYSTEMS RUNTIME
|
|
|
|
include libc/crt/crt.mk # │ You can issue system calls
|
|
|
|
include libc/rand/rand.mk # │
|
2020-06-15 14:18:57 +00:00
|
|
|
include libc/unicode/unicode.mk # │
|
2021-02-03 14:22:51 +00:00
|
|
|
include third_party/dlmalloc/dlmalloc.mk #─┘
|
|
|
|
include libc/mem/mem.mk #─┐
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
include libc/zipos/zipos.mk # ├──DYNAMIC RUNTIME
|
|
|
|
include third_party/gdtoa/gdtoa.mk # │ You can now use stdio
|
|
|
|
include libc/time/time.mk # │ You can finally call malloc()
|
2022-04-20 16:56:53 +00:00
|
|
|
include libc/thread/thread.mk # │
|
2020-06-15 14:18:57 +00:00
|
|
|
include libc/alg/alg.mk # │
|
|
|
|
include libc/stdio/stdio.mk # │
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
include third_party/libcxx/libcxx.mk # │
|
2020-06-15 14:18:57 +00:00
|
|
|
include net/net.mk # │
|
|
|
|
include libc/log/log.mk # │
|
2021-09-07 00:36:47 +00:00
|
|
|
include third_party/bzip2/bzip2.mk # │
|
2020-06-15 14:18:57 +00:00
|
|
|
include dsp/core/core.mk # │
|
|
|
|
include libc/x/x.mk # │
|
|
|
|
include third_party/stb/stb.mk # │
|
|
|
|
include dsp/scale/scale.mk # │
|
|
|
|
include dsp/mpeg/mpeg.mk # │
|
|
|
|
include dsp/dsp.mk # │
|
2022-05-12 19:16:25 +00:00
|
|
|
include third_party/zlib/gz/gz.mk # │
|
2020-06-15 14:18:57 +00:00
|
|
|
include third_party/musl/musl.mk # │
|
|
|
|
include third_party/getopt/getopt.mk # │
|
|
|
|
include libc/libc.mk #─┘
|
|
|
|
include libc/sock/sock.mk #─┐
|
2021-02-03 14:22:51 +00:00
|
|
|
include dsp/tty/tty.mk # ├──ONLINE RUNTIME
|
|
|
|
include libc/dns/dns.mk # │ You can communicate with the network
|
2021-06-24 19:31:26 +00:00
|
|
|
include net/http/http.mk # │
|
2021-07-08 04:44:27 +00:00
|
|
|
include third_party/mbedtls/mbedtls.mk # │
|
|
|
|
include net/https/https.mk # │
|
2021-06-24 19:31:26 +00:00
|
|
|
include third_party/regex/regex.mk #─┘
|
2022-06-09 13:33:31 +00:00
|
|
|
include third_party/tidy/tidy.mk
|
2020-06-15 14:18:57 +00:00
|
|
|
include third_party/third_party.mk
|
|
|
|
include libc/testlib/testlib.mk
|
|
|
|
include tool/viz/lib/vizlib.mk
|
2022-05-12 18:01:58 +00:00
|
|
|
include tool/args/args.mk
|
|
|
|
include test/tool/args/test.mk
|
2021-08-14 18:26:23 +00:00
|
|
|
include third_party/linenoise/linenoise.mk
|
2022-03-18 10:17:08 +00:00
|
|
|
include third_party/maxmind/maxmind.mk
|
2022-07-17 09:40:39 +00:00
|
|
|
include net/finger/finger.mk
|
2022-07-09 18:44:19 +00:00
|
|
|
include third_party/double-conversion/double-conversion.mk
|
2021-03-08 22:13:40 +00:00
|
|
|
include third_party/lua/lua.mk
|
2021-10-26 18:54:07 +00:00
|
|
|
include third_party/make/make.mk
|
2022-06-23 10:39:44 +00:00
|
|
|
include third_party/finger/finger.mk
|
2021-09-16 00:24:36 +00:00
|
|
|
include third_party/argon2/argon2.mk
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
include third_party/smallz4/smallz4.mk
|
2021-05-04 14:39:59 +00:00
|
|
|
include third_party/sqlite3/sqlite3.mk
|
2021-06-24 19:31:26 +00:00
|
|
|
include third_party/mbedtls/test/test.mk
|
2021-04-09 08:06:57 +00:00
|
|
|
include third_party/quickjs/quickjs.mk
|
2020-06-15 14:18:57 +00:00
|
|
|
include third_party/lz4cli/lz4cli.mk
|
2022-04-21 04:59:25 +00:00
|
|
|
include third_party/zip/zip.mk
|
2022-06-10 11:54:37 +00:00
|
|
|
include third_party/unzip/unzip.mk
|
2020-06-15 14:18:57 +00:00
|
|
|
include tool/build/lib/buildlib.mk
|
2020-12-19 19:21:04 +00:00
|
|
|
include third_party/chibicc/chibicc.mk
|
|
|
|
include third_party/chibicc/test/test.mk
|
2021-10-08 15:11:51 +00:00
|
|
|
include third_party/python/python.mk
|
2020-08-25 11:23:25 +00:00
|
|
|
include tool/build/emucrt/emucrt.mk
|
|
|
|
include tool/build/emubin/emubin.mk
|
2020-06-15 14:18:57 +00:00
|
|
|
include tool/build/build.mk
|
2021-04-18 19:40:48 +00:00
|
|
|
include examples/examples.mk
|
2021-09-12 05:30:37 +00:00
|
|
|
include examples/pyapp/pyapp.mk
|
2022-06-11 16:27:14 +00:00
|
|
|
include examples/pylife/pylife.mk
|
2020-06-15 14:18:57 +00:00
|
|
|
include tool/decode/lib/decodelib.mk
|
|
|
|
include tool/decode/decode.mk
|
2022-03-17 21:12:41 +00:00
|
|
|
include tool/lambda/lib/lib.mk
|
|
|
|
include tool/lambda/lambda.mk
|
2022-04-08 03:30:22 +00:00
|
|
|
include tool/plinko/lib/lib.mk
|
|
|
|
include tool/plinko/plinko.mk
|
|
|
|
include test/tool/plinko/test.mk
|
2020-06-15 14:18:57 +00:00
|
|
|
include tool/hash/hash.mk
|
|
|
|
include tool/net/net.mk
|
|
|
|
include tool/viz/viz.mk
|
|
|
|
include tool/tool.mk
|
|
|
|
include test/libc/alg/test.mk
|
|
|
|
include test/libc/tinymath/test.mk
|
|
|
|
include test/libc/intrin/test.mk
|
|
|
|
include test/libc/mem/test.mk
|
|
|
|
include test/libc/nexgen32e/test.mk
|
|
|
|
include test/libc/runtime/test.mk
|
2022-04-20 16:56:53 +00:00
|
|
|
include test/libc/thread/test.mk
|
2020-06-15 14:18:57 +00:00
|
|
|
include test/libc/sock/test.mk
|
|
|
|
include test/libc/bits/test.mk
|
|
|
|
include test/libc/str/test.mk
|
2021-09-28 05:58:51 +00:00
|
|
|
include test/libc/log/test.mk
|
2020-06-15 14:18:57 +00:00
|
|
|
include test/libc/unicode/test.mk
|
|
|
|
include test/libc/calls/test.mk
|
|
|
|
include test/libc/x/test.mk
|
|
|
|
include test/libc/xed/test.mk
|
|
|
|
include test/libc/fmt/test.mk
|
|
|
|
include test/libc/dns/test.mk
|
|
|
|
include test/libc/rand/test.mk
|
|
|
|
include test/libc/time/test.mk
|
|
|
|
include test/libc/stdio/test.mk
|
2020-11-25 16:19:00 +00:00
|
|
|
include test/libc/release/test.mk
|
2020-06-15 14:18:57 +00:00
|
|
|
include test/libc/test.mk
|
|
|
|
include test/net/http/test.mk
|
2021-07-19 21:55:20 +00:00
|
|
|
include test/net/https/test.mk
|
2022-07-17 09:40:39 +00:00
|
|
|
include test/net/finger/test.mk
|
2020-06-15 14:18:57 +00:00
|
|
|
include test/net/test.mk
|
|
|
|
include test/tool/build/lib/test.mk
|
|
|
|
include test/tool/build/test.mk
|
|
|
|
include test/tool/viz/lib/test.mk
|
|
|
|
include test/tool/viz/test.mk
|
2021-02-27 18:47:19 +00:00
|
|
|
include test/tool/net/test.mk
|
2020-06-15 14:18:57 +00:00
|
|
|
include test/tool/test.mk
|
|
|
|
include test/dsp/core/test.mk
|
|
|
|
include test/dsp/scale/test.mk
|
|
|
|
include test/dsp/tty/test.mk
|
|
|
|
include test/dsp/test.mk
|
2020-06-18 23:14:47 +00:00
|
|
|
include examples/package/lib/build.mk
|
|
|
|
include examples/package/build.mk
|
2020-06-16 02:01:28 +00:00
|
|
|
#-φ-examples/package/new.sh
|
2020-06-16 13:38:43 +00:00
|
|
|
include test/test.mk
|
2020-06-15 14:18:57 +00:00
|
|
|
|
2021-05-02 14:48:59 +00:00
|
|
|
OBJS = $(foreach x,$(PKGS),$($(x)_OBJS))
|
|
|
|
SRCS := $(foreach x,$(PKGS),$($(x)_SRCS))
|
|
|
|
HDRS := $(foreach x,$(PKGS),$($(x)_HDRS))
|
|
|
|
INCS = $(foreach x,$(PKGS),$($(x)_INCS))
|
|
|
|
BINS = $(foreach x,$(PKGS),$($(x)_BINS))
|
|
|
|
TESTS = $(foreach x,$(PKGS),$($(x)_TESTS))
|
|
|
|
CHECKS = $(foreach x,$(PKGS),$($(x)_CHECKS))
|
2020-06-15 14:18:57 +00:00
|
|
|
|
|
|
|
bins: $(BINS)
|
|
|
|
check: $(CHECKS)
|
2022-03-16 20:33:13 +00:00
|
|
|
test: $(TESTS)
|
2020-06-15 14:18:57 +00:00
|
|
|
depend: o/$(MODE)/depend
|
|
|
|
tags: TAGS HTAGS
|
|
|
|
|
|
|
|
o/$(MODE)/.x:
|
2022-05-25 18:31:08 +00:00
|
|
|
@$(COMPILE) -AMKDIR -tT$@ $(MKDIR) $(@D)
|
2020-06-15 14:18:57 +00:00
|
|
|
|
|
|
|
o/$(MODE)/srcs.txt: o/$(MODE)/.x $(MAKEFILES) $(call uniq,$(foreach x,$(SRCS),$(dir $(x))))
|
2021-10-14 00:27:13 +00:00
|
|
|
$(file >$@,$(SRCS))
|
2021-05-02 14:48:59 +00:00
|
|
|
o/$(MODE)/hdrs.txt: o/$(MODE)/.x $(MAKEFILES) $(call uniq,$(foreach x,$(HDRS) $(INCS),$(dir $(x))))
|
2021-10-14 00:27:13 +00:00
|
|
|
$(file >$@,$(HDRS) $(INCS))
|
2021-07-19 21:55:20 +00:00
|
|
|
o/$(MODE)/incs.txt: o/$(MODE)/.x $(MAKEFILES) $(call uniq,$(foreach x,$(INCS) $(INCS),$(dir $(x))))
|
2021-10-14 00:27:13 +00:00
|
|
|
$(file >$@,$(INCS))
|
2021-07-19 21:55:20 +00:00
|
|
|
o/$(MODE)/depend: o/$(MODE)/.x o/$(MODE)/srcs.txt o/$(MODE)/hdrs.txt o/$(MODE)/incs.txt $(SRCS) $(HDRS) $(INCS)
|
2021-11-13 00:38:54 +00:00
|
|
|
@$(COMPILE) -AMKDEPS -L320 $(MKDEPS) -o $@ -r o/$(MODE)/ @o/$(MODE)/srcs.txt @o/$(MODE)/hdrs.txt @o/$(MODE)/incs.txt
|
2020-06-15 14:18:57 +00:00
|
|
|
|
2021-10-14 00:27:13 +00:00
|
|
|
o/$(MODE)/srcs-old.txt: o/$(MODE)/.x $(MAKEFILES) $(call uniq,$(foreach x,$(SRCS),$(dir $(x))))
|
|
|
|
$(file >$@) $(foreach x,$(SRCS),$(file >>$@,$(x)))
|
|
|
|
o/$(MODE)/hdrs-old.txt: o/$(MODE)/.x $(MAKEFILES) $(call uniq,$(foreach x,$(HDRS) $(INCS),$(dir $(x))))
|
|
|
|
$(file >$@) $(foreach x,$(HDRS) $(INCS),$(file >>$@,$(x)))
|
|
|
|
|
2022-08-06 10:51:50 +00:00
|
|
|
TAGS: .UNSANDBOXED = 1
|
2021-10-14 00:27:13 +00:00
|
|
|
TAGS: o/$(MODE)/srcs-old.txt $(SRCS)
|
2022-05-25 18:31:08 +00:00
|
|
|
@$(RM) $@
|
2022-08-10 19:56:45 +00:00
|
|
|
@$(TAGS) $(TAGSFLAGS) -L $< -o $@
|
2020-06-15 14:18:57 +00:00
|
|
|
|
2022-08-06 10:51:50 +00:00
|
|
|
HTAGS: .UNSANDBOXED = 1
|
2021-10-14 00:27:13 +00:00
|
|
|
HTAGS: o/$(MODE)/hdrs-old.txt $(HDRS)
|
2022-05-25 18:31:08 +00:00
|
|
|
@$(RM) $@
|
2022-08-10 19:56:45 +00:00
|
|
|
@build/htags -L $< -o $@
|
2020-06-15 14:18:57 +00:00
|
|
|
|
2022-08-06 10:51:50 +00:00
|
|
|
loc: .UNSANDBOXED = 1
|
2020-06-21 07:10:11 +00:00
|
|
|
loc: o/$(MODE)/tool/build/summy.com
|
|
|
|
find -name \*.h -or -name \*.c -or -name \*.S | \
|
|
|
|
$(XARGS) wc -l | grep total | awk '{print $$1}' | $<
|
2020-06-15 14:18:57 +00:00
|
|
|
|
2020-08-25 11:23:25 +00:00
|
|
|
COSMOPOLITAN_OBJECTS = \
|
2022-05-16 21:33:19 +00:00
|
|
|
NET_HTTP \
|
2020-08-25 11:23:25 +00:00
|
|
|
LIBC_DNS \
|
|
|
|
LIBC_SOCK \
|
2021-01-16 20:05:41 +00:00
|
|
|
LIBC_NT_WS2_32 \
|
2021-06-24 17:53:27 +00:00
|
|
|
LIBC_NT_IPHLPAPI \
|
2021-01-16 20:05:41 +00:00
|
|
|
LIBC_NT_MSWSOCK \
|
2020-11-25 16:19:00 +00:00
|
|
|
LIBC_X \
|
2020-08-25 11:23:25 +00:00
|
|
|
THIRD_PARTY_GETOPT \
|
2021-01-16 20:05:41 +00:00
|
|
|
LIBC_LOG \
|
|
|
|
LIBC_UNICODE \
|
|
|
|
LIBC_TIME \
|
|
|
|
LIBC_ZIPOS \
|
|
|
|
THIRD_PARTY_ZLIB \
|
2020-08-25 11:23:25 +00:00
|
|
|
THIRD_PARTY_MUSL \
|
2021-01-16 20:05:41 +00:00
|
|
|
LIBC_STDIO \
|
2021-03-06 19:41:01 +00:00
|
|
|
THIRD_PARTY_GDTOA \
|
2021-01-16 20:05:41 +00:00
|
|
|
THIRD_PARTY_REGEX \
|
|
|
|
LIBC_ALG \
|
|
|
|
LIBC_MEM \
|
|
|
|
THIRD_PARTY_DLMALLOC \
|
|
|
|
LIBC_BITS \
|
|
|
|
LIBC_RUNTIME \
|
|
|
|
LIBC_ELF \
|
|
|
|
LIBC_CALLS \
|
|
|
|
LIBC_RAND \
|
|
|
|
LIBC_SYSV_CALLS \
|
2022-03-23 02:51:27 +00:00
|
|
|
LIBC_NT_PSAPI \
|
2022-04-21 20:44:59 +00:00
|
|
|
LIBC_NT_POWRPROF \
|
2022-03-23 02:51:27 +00:00
|
|
|
LIBC_NT_PDH \
|
2022-08-10 19:44:56 +00:00
|
|
|
LIBC_NT_SHELL32 \
|
2021-01-28 06:18:23 +00:00
|
|
|
LIBC_NT_GDI32 \
|
|
|
|
LIBC_NT_COMDLG32 \
|
2022-08-10 19:44:56 +00:00
|
|
|
LIBC_NT_NETAPI32 \
|
2021-01-28 06:18:23 +00:00
|
|
|
LIBC_NT_URL \
|
|
|
|
LIBC_NT_USER32 \
|
2021-01-16 20:05:41 +00:00
|
|
|
LIBC_NT_NTDLL \
|
|
|
|
LIBC_NT_ADVAPI32 \
|
|
|
|
LIBC_FMT \
|
|
|
|
THIRD_PARTY_COMPILER_RT \
|
2021-10-13 18:26:05 +00:00
|
|
|
LIBC_THREAD \
|
2021-01-16 20:05:41 +00:00
|
|
|
LIBC_TINYMATH \
|
2022-04-13 05:11:00 +00:00
|
|
|
THIRD_PARTY_XED \
|
2021-01-16 20:05:41 +00:00
|
|
|
LIBC_STR \
|
2021-03-06 19:41:01 +00:00
|
|
|
LIBC_SYSV \
|
2021-01-16 20:05:41 +00:00
|
|
|
LIBC_INTRIN \
|
|
|
|
LIBC_NT_KERNEL32 \
|
|
|
|
LIBC_NEXGEN32E
|
2020-08-25 11:23:25 +00:00
|
|
|
|
|
|
|
COSMOPOLITAN_HEADERS = \
|
2022-07-21 16:16:38 +00:00
|
|
|
APE \
|
2020-08-25 11:23:25 +00:00
|
|
|
LIBC \
|
2020-11-25 16:19:00 +00:00
|
|
|
LIBC_ALG \
|
|
|
|
LIBC_BITS \
|
2020-08-25 11:23:25 +00:00
|
|
|
LIBC_CALLS \
|
|
|
|
LIBC_DNS \
|
2020-11-25 16:19:00 +00:00
|
|
|
LIBC_ELF \
|
2020-08-25 11:23:25 +00:00
|
|
|
LIBC_FMT \
|
2020-11-25 16:19:00 +00:00
|
|
|
LIBC_INTRIN \
|
|
|
|
LIBC_LOG \
|
2020-08-25 11:23:25 +00:00
|
|
|
LIBC_MEM \
|
2020-11-25 16:19:00 +00:00
|
|
|
LIBC_NEXGEN32E \
|
|
|
|
LIBC_NT \
|
2020-08-25 11:23:25 +00:00
|
|
|
LIBC_RAND \
|
|
|
|
LIBC_RUNTIME \
|
|
|
|
LIBC_SOCK \
|
|
|
|
LIBC_STDIO \
|
2022-04-13 05:11:00 +00:00
|
|
|
THIRD_PARTY_XED \
|
2020-08-25 11:23:25 +00:00
|
|
|
LIBC_STR \
|
2020-11-25 16:19:00 +00:00
|
|
|
LIBC_SYSV \
|
2021-10-13 18:26:05 +00:00
|
|
|
LIBC_THREAD \
|
2020-08-25 11:23:25 +00:00
|
|
|
LIBC_TIME \
|
2020-11-25 16:19:00 +00:00
|
|
|
LIBC_TINYMATH \
|
2020-08-25 11:23:25 +00:00
|
|
|
LIBC_UNICODE \
|
2020-11-25 16:19:00 +00:00
|
|
|
LIBC_X \
|
2020-08-25 11:23:25 +00:00
|
|
|
LIBC_ZIPOS \
|
2022-05-16 21:33:19 +00:00
|
|
|
NET_HTTP \
|
2020-08-25 11:23:25 +00:00
|
|
|
THIRD_PARTY_DLMALLOC \
|
2020-12-05 20:20:41 +00:00
|
|
|
THIRD_PARTY_GDTOA \
|
2020-08-25 11:23:25 +00:00
|
|
|
THIRD_PARTY_GETOPT \
|
|
|
|
THIRD_PARTY_MUSL \
|
2020-12-26 10:09:07 +00:00
|
|
|
THIRD_PARTY_ZLIB \
|
2022-05-12 19:16:25 +00:00
|
|
|
THIRD_PARTY_ZLIB_GZ \
|
2020-08-25 11:23:25 +00:00
|
|
|
THIRD_PARTY_REGEX
|
|
|
|
|
2021-10-14 00:27:13 +00:00
|
|
|
o/$(MODE)/cosmopolitan.a: \
|
|
|
|
$(foreach x,$(COSMOPOLITAN_OBJECTS),$($(x)_A_OBJS))
|
|
|
|
|
2022-07-21 16:16:38 +00:00
|
|
|
o/cosmopolitan.h: \
|
|
|
|
o/$(MODE)/tool/build/rollup.com \
|
|
|
|
libc/integral/normalize.inc \
|
|
|
|
$(foreach x,$(COSMOPOLITAN_HEADERS),$($(x)_HDRS)) \
|
|
|
|
$(foreach x,$(COSMOPOLITAN_HEADERS),$($(x)_INCS))
|
2022-08-09 13:28:41 +00:00
|
|
|
$(file >$(TMPDIR)/$(subst /,_,$@),libc/integral/normalize.inc $(foreach x,$(COSMOPOLITAN_HEADERS),$($(x)_HDRS)))
|
|
|
|
@$(COMPILE) -AROLLUP -T$@ o/$(MODE)/tool/build/rollup.com @$(TMPDIR)/$(subst /,_,$@) >$@
|
2020-08-25 11:23:25 +00:00
|
|
|
|
2020-12-28 01:05:03 +00:00
|
|
|
o/cosmopolitan.html: \
|
|
|
|
o/$(MODE)/third_party/chibicc/chibicc.com.dbg \
|
2022-08-07 12:59:53 +00:00
|
|
|
$(filter-out %.s,$(foreach x,$(COSMOPOLITAN_OBJECTS),$($(x)_SRCS))) \
|
|
|
|
$(SRCS) \
|
|
|
|
$(HDRS)
|
2022-08-09 13:28:41 +00:00
|
|
|
$(file >$(TMPDIR)/$(subst /,_,$@),$(filter-out %.s,$(foreach x,$(COSMOPOLITAN_OBJECTS),$($(x)_SRCS))))
|
2020-12-28 01:05:03 +00:00
|
|
|
o/$(MODE)/third_party/chibicc/chibicc.com.dbg -J \
|
|
|
|
-fno-common -include libc/integral/normalize.inc -o $@ \
|
2022-08-09 13:28:41 +00:00
|
|
|
@$(TMPDIR)/$(subst /,_,$@)
|
2020-12-26 10:09:07 +00:00
|
|
|
|
2021-02-04 01:48:59 +00:00
|
|
|
$(SRCS): \
|
|
|
|
libc/integral/normalize.inc \
|
|
|
|
libc/integral/c.inc \
|
|
|
|
libc/integral/cxx.inc \
|
|
|
|
libc/integral/cxxtypescompat.inc \
|
|
|
|
libc/integral/lp64arg.inc \
|
|
|
|
libc/integral/lp64.inc
|
|
|
|
|
2020-06-15 14:18:57 +00:00
|
|
|
# UNSPECIFIED PREREQUISITES TUTORIAL
|
|
|
|
#
|
|
|
|
# A build rule must exist for all files that make needs to consider in
|
|
|
|
# order to build the requested goal. That includes input source files,
|
|
|
|
# even if the rule is empty and does nothing. Otherwise, the .DEFAULT
|
|
|
|
# rule gets triggered.
|
|
|
|
#
|
|
|
|
# This is a normal and neecssary behavior when source files get deleted.
|
|
|
|
# The build reacts automatically to this happening, by simply deleting
|
|
|
|
# and regenerating the dependency graph; so we can safely use wildcard.
|
|
|
|
#
|
|
|
|
# This is abnormal if it needs to keep doing that repeatedly. That can
|
|
|
|
# only mean the build config is broken.
|
|
|
|
#
|
|
|
|
# Also note that a suboptimal in-between state may exist, where running
|
|
|
|
# `make -pn` reveals rules being generated with the .DEFAULT target, but
|
|
|
|
# never get executed since they're not members of the transitive closure
|
|
|
|
# of `make all`. In that case the build config could be improved.
|
|
|
|
%.mk:
|
2020-08-25 11:23:25 +00:00
|
|
|
~/.cosmo.mk:
|
2020-06-15 14:18:57 +00:00
|
|
|
$(SRCS):
|
|
|
|
$(HDRS):
|
2021-02-02 11:45:31 +00:00
|
|
|
$(INCS):
|
2020-06-15 14:18:57 +00:00
|
|
|
.DEFAULT:
|
2022-05-25 18:31:08 +00:00
|
|
|
@$(ECHO) >&2
|
|
|
|
@$(ECHO) NOTE: deleting o/$(MODE)/depend because of an unspecified prerequisite: $@ >&2
|
|
|
|
@$(ECHO) >&2
|
|
|
|
$(RM) o/$(MODE)/depend
|
2020-06-15 14:18:57 +00:00
|
|
|
|
|
|
|
-include o/$(MODE)/depend
|