2020-06-15 07:18:57 -07:00
|
|
|
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
|
|
|
|
#── vi: set noet ft=make ts=8 sw=8 fenc=utf-8 :vi ────────────────────┘
|
|
|
|
#
|
|
|
|
# SYNOPSIS
|
|
|
|
#
|
|
|
|
# Cosmopolitan String Formatting
|
|
|
|
#
|
|
|
|
# DESCRIPTION
|
|
|
|
#
|
|
|
|
# This package provides incredible domain-specific languages for
|
|
|
|
# encoding and decoding strings.
|
|
|
|
|
|
|
|
PKGS += LIBC_FMT
|
|
|
|
|
|
|
|
LIBC_FMT_ARTIFACTS += LIBC_FMT_A
|
|
|
|
LIBC_FMT = $(LIBC_FMT_A_DEPS) $(LIBC_FMT_A)
|
|
|
|
LIBC_FMT_A = o/$(MODE)/libc/fmt/fmt.a
|
|
|
|
LIBC_FMT_A_FILES := $(wildcard libc/fmt/*)
|
|
|
|
LIBC_FMT_A_HDRS = $(filter %.h,$(LIBC_FMT_A_FILES))
|
2021-02-02 03:45:31 -08:00
|
|
|
LIBC_FMT_A_INCS = $(filter %.inc,$(LIBC_FMT_A_FILES))
|
2020-06-15 07:18:57 -07:00
|
|
|
LIBC_FMT_A_SRCS_S = $(filter %.S,$(LIBC_FMT_A_FILES))
|
|
|
|
LIBC_FMT_A_SRCS_C = $(filter %.c,$(LIBC_FMT_A_FILES))
|
|
|
|
|
|
|
|
LIBC_FMT_A_SRCS = \
|
|
|
|
$(LIBC_FMT_A_SRCS_S) \
|
|
|
|
$(LIBC_FMT_A_SRCS_C)
|
|
|
|
|
|
|
|
LIBC_FMT_A_OBJS = \
|
|
|
|
$(LIBC_FMT_A_SRCS_S:%.S=o/$(MODE)/%.o) \
|
|
|
|
$(LIBC_FMT_A_SRCS_C:%.c=o/$(MODE)/%.o)
|
|
|
|
|
|
|
|
LIBC_FMT_A_CHECKS = \
|
|
|
|
$(LIBC_FMT_A).pkg \
|
|
|
|
$(LIBC_FMT_A_HDRS:%=o/$(MODE)/%.ok)
|
|
|
|
|
|
|
|
LIBC_FMT_A_DIRECTDEPS = \
|
2023-06-18 00:55:09 -07:00
|
|
|
LIBC_INTRIN \
|
2020-06-15 07:18:57 -07:00
|
|
|
LIBC_NEXGEN32E \
|
2020-12-28 13:47:19 -08:00
|
|
|
LIBC_NT_KERNEL32 \
|
2020-12-09 15:04:54 -08:00
|
|
|
LIBC_STR \
|
2020-08-25 04:23:25 -07:00
|
|
|
LIBC_SYSV \
|
2020-12-09 15:04:54 -08:00
|
|
|
LIBC_TINYMATH \
|
2024-09-01 01:14:40 -07:00
|
|
|
THIRD_PARTY_COMPILER_RT \
|
2020-06-15 07:18:57 -07:00
|
|
|
|
|
|
|
LIBC_FMT_A_DEPS := \
|
|
|
|
$(call uniq,$(foreach x,$(LIBC_FMT_A_DIRECTDEPS),$($(x))))
|
|
|
|
|
|
|
|
$(LIBC_FMT_A): libc/fmt/ \
|
|
|
|
$(LIBC_FMT_A).pkg \
|
|
|
|
$(LIBC_FMT_A_OBJS)
|
|
|
|
|
|
|
|
$(LIBC_FMT_A).pkg: \
|
|
|
|
$(LIBC_FMT_A_OBJS) \
|
|
|
|
$(foreach x,$(LIBC_FMT_A_DIRECTDEPS),$($(x)_A).pkg)
|
|
|
|
|
2022-08-10 18:00:45 -07:00
|
|
|
$(LIBC_FMT_A_OBJS): private \
|
2023-06-05 23:35:31 -07:00
|
|
|
CFLAGS += \
|
2024-06-22 05:45:49 -07:00
|
|
|
-fno-jump-tables
|
2020-06-15 07:18:57 -07:00
|
|
|
|
2021-09-27 22:58:51 -07:00
|
|
|
o/$(MODE)/libc/fmt/formatint64.o \
|
|
|
|
o/$(MODE)/libc/fmt/formatint64thousands.o \
|
2020-12-09 15:04:54 -08:00
|
|
|
o/$(MODE)/libc/fmt/dosdatetimetounix.o \
|
2022-08-10 18:00:45 -07:00
|
|
|
o/$(MODE)/libc/fmt/itoa64radix10.greg.o: private\
|
2023-06-05 23:35:31 -07:00
|
|
|
CFLAGS += \
|
2020-12-09 15:04:54 -08:00
|
|
|
-O3
|
|
|
|
|
2021-08-13 11:18:25 -07:00
|
|
|
o/$(MODE)/libc/fmt/atoi.o \
|
|
|
|
o/$(MODE)/libc/fmt/strtol.o \
|
|
|
|
o/$(MODE)/libc/fmt/strtoul.o \
|
|
|
|
o/$(MODE)/libc/fmt/wcstol.o \
|
|
|
|
o/$(MODE)/libc/fmt/wcstoul.o \
|
|
|
|
o/$(MODE)/libc/fmt/strtoimax.o \
|
|
|
|
o/$(MODE)/libc/fmt/strtoumax.o \
|
|
|
|
o/$(MODE)/libc/fmt/wcstoimax.o \
|
2022-08-10 18:00:45 -07:00
|
|
|
o/$(MODE)/libc/fmt/wcstoumax.o: private \
|
2023-06-05 23:35:31 -07:00
|
|
|
CFLAGS += \
|
2021-08-13 11:18:25 -07:00
|
|
|
-Os
|
|
|
|
|
2020-06-15 07:18:57 -07:00
|
|
|
LIBC_FMT_LIBS = $(foreach x,$(LIBC_FMT_ARTIFACTS),$($(x)))
|
|
|
|
LIBC_FMT_SRCS = $(foreach x,$(LIBC_FMT_ARTIFACTS),$($(x)_SRCS))
|
|
|
|
LIBC_FMT_HDRS = $(foreach x,$(LIBC_FMT_ARTIFACTS),$($(x)_HDRS))
|
2021-02-02 03:45:31 -08:00
|
|
|
LIBC_FMT_INCS = $(foreach x,$(LIBC_FMT_ARTIFACTS),$($(x)_INCS))
|
2020-06-15 07:18:57 -07:00
|
|
|
LIBC_FMT_CHECKS = $(foreach x,$(LIBC_FMT_ARTIFACTS),$($(x)_CHECKS))
|
|
|
|
LIBC_FMT_OBJS = $(foreach x,$(LIBC_FMT_ARTIFACTS),$($(x)_OBJS))
|
2023-11-28 11:21:08 -08:00
|
|
|
$(LIBC_FMT_OBJS): $(BUILD_FILES) libc/fmt/BUILD.mk
|
2020-06-15 07:18:57 -07:00
|
|
|
|
|
|
|
.PHONY: o/$(MODE)/libc/fmt
|
|
|
|
o/$(MODE)/libc/fmt: $(LIBC_FMT_CHECKS)
|