cosmopolitan/libc/thread/thread.mk
Justine Tunney de5de19004 Make improvements
- Document redbean's argon2 module
- Fix regressions in cthreads library
- Make testlib work better with threads
- Give the cthreads library lots of love
- Remove some of the stdio assembly code
- Implement getloadavg() across platforms
- Code size optimizations for errnos, etc.
- Only check for signals in main thread on Windows
- Make errnos for dup2 / dup3 consistent with posix

This change also fixes a bug in the argon2 module, where the NUL
terminator was being included in the hash encoded ascii string. This
shouldn't require any database migrations to folks who found this module
and productionized it, since the argon2 library treats it as a c string.
2022-05-28 00:28:09 -07:00

61 lines
1.9 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_THREAD
LIBC_THREAD_ARTIFACTS += LIBC_THREAD_A
LIBC_THREAD = $(LIBC_THREAD_A_DEPS) $(LIBC_THREAD_A)
LIBC_THREAD_A = o/$(MODE)/libc/thread/thread.a
LIBC_THREAD_A_FILES := $(wildcard libc/thread/*)
LIBC_THREAD_A_HDRS = $(filter %.h,$(LIBC_THREAD_A_FILES))
LIBC_THREAD_A_SRCS_S = $(filter %.S,$(LIBC_THREAD_A_FILES))
LIBC_THREAD_A_SRCS_C = $(filter %.c,$(LIBC_THREAD_A_FILES))
LIBC_THREAD_A_SRCS = \
$(LIBC_THREAD_A_SRCS_S) \
$(LIBC_THREAD_A_SRCS_C)
LIBC_THREAD_A_OBJS = \
$(LIBC_THREAD_A_SRCS_S:%.S=o/$(MODE)/%.o) \
$(LIBC_THREAD_A_SRCS_C:%.c=o/$(MODE)/%.o)
LIBC_THREAD_A_CHECKS = \
$(LIBC_THREAD_A).pkg \
$(LIBC_THREAD_A_HDRS:%=o/$(MODE)/%.ok)
LIBC_THREAD_A_DIRECTDEPS = \
LIBC_STUBS \
LIBC_CALLS \
LIBC_INTRIN \
LIBC_BITS \
LIBC_MEM \
LIBC_RUNTIME \
LIBC_SYSV \
LIBC_SYSV_CALLS \
LIBC_NEXGEN32E
LIBC_THREAD_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_THREAD_A_DIRECTDEPS),$($(x))))
$(LIBC_THREAD_A): \
libc/thread/ \
$(LIBC_THREAD_A).pkg \
$(LIBC_THREAD_A_OBJS)
$(LIBC_THREAD_A).pkg: \
$(LIBC_THREAD_A_OBJS) \
$(foreach x,$(LIBC_THREAD_A_DIRECTDEPS),$($(x)_A).pkg)
o/tinylinux/libc/thread/clone.o: \
OVERRIDE_CFLAGS += \
-ffunction-sections
LIBC_THREAD_LIBS = $(foreach x,$(LIBC_THREAD_ARTIFACTS),$($(x)))
LIBC_THREAD_SRCS = $(foreach x,$(LIBC_THREAD_ARTIFACTS),$($(x)_SRCS))
LIBC_THREAD_HDRS = $(foreach x,$(LIBC_THREAD_ARTIFACTS),$($(x)_HDRS))
LIBC_THREAD_CHECKS = $(foreach x,$(LIBC_THREAD_ARTIFACTS),$($(x)_CHECKS))
LIBC_THREAD_OBJS = $(foreach x,$(LIBC_THREAD_ARTIFACTS),$($(x)_OBJS))
$(LIBC_THREAD_OBJS): $(BUILD_FILES) libc/thread/thread.mk
.PHONY: o/$(MODE)/libc/thread
o/$(MODE)/libc/thread: $(LIBC_THREAD_CHECKS)