-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlibdebug.gmk
87 lines (72 loc) · 2.17 KB
/
libdebug.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
86
87
#
# $Id: libdebug.gmk,v 1.0 2022-07-09 10:09:48 clib4devs Exp $
#
ifndef SPE
OUT_STATIC := $(BUILD_DIR)/obj/libdebug
OUT_SHARED := $(BUILD_DIR)/obj.shared/libdebug
else
OUT_STATIC := $(BUILD_DIR)/obj/soft-float/libdebug
OUT_SHARED := $(BUILD_DIR)/obj.shared/soft-float/libdebug
endif
ifeq ($(SHARED),yes)
LIBS += $(OUTPUT_LIB)/libdebug.so
endif
ifeq ($(STATIC),yes)
LIBS += $(OUTPUT_LIB)/libdebug.a
endif
DEBUG_LIB := \
debug/cmpstrexec.o \
debug/debug.o \
debug/kcmpstr.o \
debug/kdofmt.o \
debug/kgetc.o \
debug/kgetch1.o \
debug/kgetch2.o \
debug/kgetchar1.o \
debug/kgetchar2.o \
debug/kgetnum1.o \
debug/kgetnum2.o \
debug/kmaygetch.o \
debug/kmaygetchar.o \
debug/kprintf1.o \
debug/kprintf2.o \
debug/kputc.o \
debug/kputch1.o \
debug/kputch2.o \
debug/kputchar1.o \
debug/kputchar2.o \
debug/kputfmt.o \
debug/kputs1.o \
debug/kputs2.o \
debug/kputstr1.o \
debug/kputstr2.o \
debug/kvprintf1.o \
debug/kvprintf2.o
SOURCES_SHARED = $(addprefix $(OUT_SHARED)/, $(DEBUG_LIB))
SOURCES_STATIC = $(addprefix $(OUT_STATIC)/, $(DEBUG_LIB))
# Dependencies to rebuild if the library version changes
$(OUT_STATIC)/debug/debug.lib_rev.o : $(LIB_DIR)/debug/debug.lib_rev.c $(LIB_DIR)/debug/debug.lib_rev.h
$(OUT_SHARED)/debug/debug.lib_rev.o : $(LIB_DIR)/debug/debug.lib_rev.c $(LIB_DIR)/debug/debug.lib_rev.h
$(OUT_STATIC)/%.o : CFLAGS += -Wno-missing-braces $(LARGEDATA)
$(OUT_SHARED)/%.o : CFLAGS += -Wno-missing-braces $(PIC) $(LARGEDATA)
$(OUT_STATIC)/debug/debug.lib_rev.o : $(LIB_DIR)/debug/debug.lib_rev.c
$(VERBOSE)$(COMPILE)
$(OUT_SHARED)/debug/debug.lib_rev.o : $(LIB_DIR)/debug/debug.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
$(OUTPUT_LIB)/libdebug.a : $(SOURCES_STATIC)
$(VERBOSE)$(MAKELIB)
$(OUTPUT_LIB)/libdebug.so :$(OUTPUT_LIB)/libc.so $(SOURCES_SHARED)
$(VERBOSE)$(MAKESHARED)