-
Notifications
You must be signed in to change notification settings - Fork 7
/
libprofile.gmk
65 lines (50 loc) · 1.68 KB
/
libprofile.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
#
# $Id: libprofile.gmk,v 1.1 2006-09-17 17:37:27 clib2devs Exp $
#
ifndef SPE
OUT_STATIC := $(BUILD_DIR)/obj/libprofile
OUT_SHARED := $(BUILD_DIR)/obj.shared/libprofile
else
OUT_STATIC := $(BUILD_DIR)/obj/soft-float/libprofile
OUT_SHARED := $(BUILD_DIR)/obj.shared/soft-float/libprofile
endif
ifeq ($(SHARED),yes)
LIBS += $(OUTPUT_LIB)/libprofile.so
endif
ifeq ($(STATIC),yes)
LIBS += $(OUTPUT_LIB)/libprofile.a
endif
PROFILE_LIB = \
profile/_mcount.o \
profile/profil.o \
profile/gmon.o \
profile/mcount.o
SOURCES_SHARED = $(addprefix $(OUT_SHARED)/, $(PROFILE_LIB))
SOURCES_STATIC = $(addprefix $(OUT_STATIC)/, $(PROFILE_LIB))
# Dependencies to rebuild if the library version changes
$(OUT_STATIC)/profile.lib_rev.o : $(LIB_DIR)/profile/profile.lib_rev.c $(LIB_DIR)/profile/profile.lib_rev.h
$(OUT_SHARED)/profile.lib_rev.o : $(LIB_DIR)/profile/profile.lib_rev.c $(LIB_DIR)/profile/profile.lib_rev.h
$(OUT_STATIC)/%.o : AFLAGS += $(LARGEDATA)
$(OUT_SHARED)/%.o : AFLAGS += $(PIC) $(LARGEDATA)
$(OUT_STATIC)/%.o : $(LIB_DIR)/%.S
$(VERBOSE)$(ASSEMBLE)
$(OUT_SHARED)/%.o : $(LIB_DIR)/%.S
$(VERBOSE)$(ASSEMBLE)
$(OUT_STATIC)/%.o : CFLAGS += $(LARGEDATA)
$(OUT_SHARED)/%.o : CFLAGS += $(PIC) $(LARGEDATA)
CFLAGS := $(filter-out -pg, $(CFLAGS))
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)/libprofile.a : $(SOURCES_STATIC)
$(VERBOSE)$(MAKELIB)
$(OUTPUT_LIB)/libprofile.so : $(OUTPUT_LIB)/libc.so $(SOURCES_SHARED)
$(VERBOSE)$(MAKESHARED)