123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- include ../../buildenv.mk
- CFLAGS += $(ENCLAVE_CFLAGS)
- ASFLAGS := $(CFLAGS)
- CFLAGS += -std=c99
- CXXFLAGS += $(ENCLAVE_CXXFLAGS) -fno-exceptions -fno-rtti
- CPPFLAGS += -I. \
- -I$(COMMON_DIR)/inc \
- -I$(COMMON_DIR)/inc/tlibc \
- -I$(COMMON_DIR)/inc/internal \
- -I$(LINUX_SDK_DIR)/trts \
- -I./gdtoa
- ifneq ($(USE_OPT_LIBS), 0)
- CFLAGS += -D_TLIBC_USE_INTEL_FAST_STRING_
- CXXFLAGS += -D_TLIBC_USE_INTEL_FAST_STRING_
- LIBC_C_SRCS := $(wildcard gen/*.c gdtoa/*.c locale/*.c math/*.c stdlib/*.c string/*.c stdio/*.c time/*.c)
- else
- LIBC_C_SRCS := $(wildcard gen/*.c gdtoa/*.c locale/*.c stdlib/*.c string/*.c stdio/*.c time/*.c)
- endif
- LIBC_CPP_SRCS := $(wildcard gen/*.cpp) tstdc_version.cpp
- LIBC_ASM_SRCS := $(wildcard gen/*.S)
- LIBC_OBJS := $(LIBC_C_SRCS:.c=.o)
- LIBC_OBJS += $(LIBC_CPP_SRCS:.cpp=.o)
- LIBC_OBJS += $(LIBC_ASM_SRCS:.S=.o)
- LIBC_OBJS := $(sort $(LIBC_OBJS))
- LIBC_NAME := libtlibc.a
- .PHONY: all
- all: $(LIBC_NAME)
- $(LIBC_NAME): $(LIBC_OBJS)
- $(AR) rcs $@ $^
- string/consttime_memequal.o: string/consttime_memequal.c
- $(CC) $(filter-out -O2,$(CFLAGS)) -O1 $(CPPFLAGS) -c $< -o $@
-
- %.o: %.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- %.o: %.cpp
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@
- %.o: %.S
- $(CC) $(ASFLAGS) $(CPPFLAGS) -c $< -o $@
- .PHONY: clean
- clean:
- @$(RM) $(LIBC_NAME) $(LIBC_OBJS)
|