forked from AmigaLabs/clib4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
librt.gmk
85 lines (68 loc) · 2.11 KB
/
librt.gmk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#
# $Id: librt.gmk,v 1.0 2023-04-27 10:09:48 clib4devs Exp $
#
ifndef SPE
OUT_STATIC := $(BUILD_DIR)/obj/librt
OUT_SHARED := $(BUILD_DIR)/obj.shared/librt
else
OUT_STATIC := $(BUILD_DIR)/obj/soft-float/librt
OUT_SHARED := $(BUILD_DIR)/obj.shared/soft-float/librt
endif
ifeq ($(SHARED),yes)
LIBS += $(OUTPUT_LIB)/librt.so
endif
ifeq ($(STATIC),yes)
LIBS += $(OUTPUT_LIB)/librt.a
endif
RT_LIB := \
rt/aio_init.o \
rt/aio_cancel.o \
rt/aio_error.o \
rt/aio_fsync.o \
rt/aio_misc.o \
rt/aio_notify.o \
rt/aio_read.o \
rt/aio_read64.o \
rt/aio_return.o \
rt/aio_sigqueue.o \
rt/aio_suspend.o \
rt/aio_write.o \
rt/aio_write64.o \
rt/clist.o \
rt/lio_listio.o \
rt/rt.lib_rev.o
SOURCES_SHARED = $(addprefix $(OUT_SHARED)/, $(RT_LIB))
SOURCES_STATIC = $(addprefix $(OUT_STATIC)/, $(RT_LIB))
# Dependencies to rebuild if the library version changes
$(OUT_STATIC)/rt/rt.lib_rev.o : $(LIB_DIR)/rt/rt.lib_rev.c $(LIB_DIR)/rt/rt.lib_rev.h
$(OUT_SHARED)/rt/rt.lib_rev.o : $(LIB_DIR)/rt/rt.lib_rev.c $(LIB_DIR)/rt/rt.lib_rev.h
$(OUT_STATIC)/%.o : CFLAGS += -Wno-missing-braces $(LARGEDATA)
$(OUT_SHARED)/%.o : CFLAGS += -Wno-missing-braces $(PIC) $(LARGEDATA)
$(OUT_STATIC)/rt/rt.lib_rev.o : $(LIB_DIR)/rt/rt.lib_rev.c
$(VERBOSE)$(COMPILE)
$(OUT_SHARED)/rt/rt.lib_rev.o : $(LIB_DIR)/rt/rt.lib_rev.c
$(VERBOSE)$(COMPILE_SHARED)
$(OUT_STATIC)/%.o : CFLAGS += $(LARGEDATA)
$(OUT_SHARED)/%.o : CFLAGS += $(PIC) $(LARGEDATA)
ifdef SPE
$(OUT_STATIC)/%.o : $(LIB_DIR)/%.c
$(VERBOSE)$(COMPILE_SPE)
$(OUT_SHARED)/%.o : $(LIB_DIR)/%.c
$(VERBOSE)$(COMPILE_SHARED_SPE)
else
$(OUT_STATIC)/%.o : $(LIB_DIR)/%.c
$(VERBOSE)$(COMPILE)
$(OUT_SHARED)/%.o : $(LIB_DIR)/%.c
$(VERBOSE)$(COMPILE_SHARED)
endif
ifndef SPE
$(BUILD_DIR)/lib/librt.a : $(SOURCES_STATIC)
$(VERBOSE)$(MAKELIB)
$(BUILD_DIR)/lib/librt.so :$(OUTPUT_LIB)/libc.so $(SOURCES_SHARED)
$(VERBOSE)$(MAKESHARED)
else
$(BUILD_DIR)/lib/soft-float/librt.a : $(SOURCES_STATIC)
$(VERBOSE)$(MAKELIB)
$(BUILD_DIR)/lib/soft-float/librt.so :$(OUTPUT_LIB)/libc.so $(SOURCES_SHARED)
$(VERBOSE)$(MAKESHARED)
endif