cosmopolitan/libc/unicode/unicode.mk
Justine Tunney b740cca642 Improve build system
- Reduce full build latency from ~20s to ~18s
- Bring back silent mode if `make V=0` is passed
- Demodernize utimes() polyfill so it works RHEL5
- Delete some old shell scripts that are no longer needed
- Truncate long lines when outputting builds to Emacs buffers
2021-02-19 23:03:34 -08:00

85 lines
3.4 KiB
Makefile

#-*-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_UNICODE
LIBC_UNICODE_ARTIFACTS += LIBC_UNICODE_A
LIBC_UNICODE = $(LIBC_UNICODE_A_DEPS) $(LIBC_UNICODE_A)
LIBC_UNICODE_A = o/$(MODE)/libc/unicode/unicode.a
LIBC_UNICODE_A_FILES := $(wildcard libc/unicode/*)
LIBC_UNICODE_A_HDRS = $(filter %.h,$(LIBC_UNICODE_A_FILES))
LIBC_UNICODE_A_SRCS_A = $(filter %.s,$(LIBC_UNICODE_A_FILES))
LIBC_UNICODE_A_SRCS_S = $(filter %.S,$(LIBC_UNICODE_A_FILES))
LIBC_UNICODE_A_SRCS_C = $(filter %.c,$(LIBC_UNICODE_A_FILES))
LIBC_UNICODE_A_SRCS = \
$(LIBC_UNICODE_A_SRCS_A) \
$(LIBC_UNICODE_A_SRCS_S) \
$(LIBC_UNICODE_A_SRCS_C)
LIBC_UNICODE_A_OBJS = \
$(LIBC_UNICODE_A_SRCS_A:%.s=o/$(MODE)/%.o) \
$(LIBC_UNICODE_A_SRCS_S:%.S=o/$(MODE)/%.o) \
$(LIBC_UNICODE_A_SRCS_C:%.c=o/$(MODE)/%.o)
LIBC_UNICODE_A_CHECKS = \
$(LIBC_UNICODE_A).pkg \
$(LIBC_UNICODE_A_HDRS:%=o/$(MODE)/%.ok)
LIBC_UNICODE_A_DIRECTDEPS = \
LIBC_INTRIN \
LIBC_NEXGEN32E \
LIBC_RUNTIME \
LIBC_STR \
LIBC_STUBS \
LIBC_SYSV
LIBC_UNICODE_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_UNICODE_A_DIRECTDEPS),$($(x))))
$(LIBC_UNICODE_A): \
libc/unicode/ \
$(LIBC_UNICODE_A).pkg \
$(LIBC_UNICODE_A_OBJS)
$(LIBC_UNICODE_A).pkg: \
$(LIBC_UNICODE_A_OBJS) \
$(foreach x,$(LIBC_UNICODE_A_DIRECTDEPS),$($(x)_A).pkg)
LIBC_UNICODE_LIBS = $(foreach x,$(LIBC_UNICODE_ARTIFACTS),$($(x)))
LIBC_UNICODE_SRCS = $(foreach x,$(LIBC_UNICODE_ARTIFACTS),$($(x)_SRCS))
LIBC_UNICODE_HDRS = $(foreach x,$(LIBC_UNICODE_ARTIFACTS),$($(x)_HDRS))
LIBC_UNICODE_BINS = $(foreach x,$(LIBC_UNICODE_ARTIFACTS),$($(x)_BINS))
LIBC_UNICODE_CHECKS = $(foreach x,$(LIBC_UNICODE_ARTIFACTS),$($(x)_CHECKS))
LIBC_UNICODE_OBJS = $(foreach x,$(LIBC_UNICODE_ARTIFACTS),$($(x)_OBJS))
LIBC_UNICODE_TESTS = $(foreach x,$(LIBC_UNICODE_ARTIFACTS),$($(x)_TESTS))
$(LIBC_UNICODE_OBJS): $(BUILD_FILES) libc/unicode/unicode.mk
.PHONY: o/$(MODE)/libc/unicode
o/$(MODE)/libc/unicode: $(LIBC_UNICODE) $(LIBC_UNICODE_CHECKS)
o/$(MODE)/libc/unicode/eastasianwidth.bin: \
libc/unicode/eastasianwidth.txt \
o/$(MODE)/tool/decode/mkwides.com
@$(COMPILE) -AMKWIDES -T$@ o/$(MODE)/tool/decode/mkwides.com -o $@ $<
o/$(MODE)/libc/unicode/eastasianwidth.bin.lz4: \
o/$(MODE)/libc/unicode/eastasianwidth.bin \
o/$(MODE)/third_party/lz4cli/lz4cli.com
@$(COMPILE) -ALZ4 -T$@ o/$(MODE)/third_party/lz4cli/lz4cli.com -q -f -9 --content-size $< $@
o/$(MODE)/libc/unicode/eastasianwidth.s: \
o/$(MODE)/libc/unicode/eastasianwidth.bin.lz4 \
o/$(MODE)/tool/build/lz4toasm.com
@$(COMPILE) -ABIN2ASM -T$@ o/$(MODE)/tool/build/lz4toasm.com -s kEastAsianWidth -o $@ $<
o/$(MODE)/libc/unicode/combiningchars.bin: \
libc/unicode/unicodedata.txt \
o/$(MODE)/tool/decode/mkcombos.com
@$(COMPILE) -AMKCOMBOS -T$@ o/$(MODE)/tool/decode/mkcombos.com -o $@ $<
o/$(MODE)/libc/unicode/combiningchars.bin.lz4: \
o/$(MODE)/libc/unicode/combiningchars.bin \
o/$(MODE)/third_party/lz4cli/lz4cli.com
@$(COMPILE) -ALZ4 -T$@ o/$(MODE)/third_party/lz4cli/lz4cli.com -q -f -9 --content-size $< $@
o/$(MODE)/libc/unicode/combiningchars.s: \
o/$(MODE)/libc/unicode/combiningchars.bin.lz4 \
o/$(MODE)/tool/build/lz4toasm.com
@$(COMPILE) -ABIN2ASM -T$@ o/$(MODE)/tool/build/lz4toasm.com -s kCombiningChars -o $@ $<