3 ## Since include directives do not impose additional dependencies, we can make
4 ## Makefile more clear, simply putting all includes we ever need in single
5 ## variable. Keep it alphabetic, please.
10 -I/usr/include/appfw \
11 -I/usr/include/dbus-1.0 \
12 -I/usr/include/e_dbus-1 \
13 -I/usr/include/ecore-1 \
14 -I/usr/include/edje-1 \
15 -I/usr/include/eet-1 \
16 -I/usr/include/efreet-1 \
17 -I/usr/include/eina-1 \
18 -I/usr/include/eina-1/eina \
19 -I/usr/include/elementary-1 \
20 -I/usr/include/ethumb-1 \
21 -I/usr/include/evas-1 \
22 -I/usr/include/pixman-1 \
23 -I/usr/include/system \
24 -I/usr/include/vconf \
25 -I/usr/lib/dbus-1.0/include \
30 -fomit-frame-pointer \
42 ## Since linking unneeded libraries bloats output of ldd(1), this variable
43 ## holds search paths and common libraries.
48 -lcapi-appfw-application \
49 -lcapi-system-runtime-info \
61 ## FIXME: Ideally, UTILITY_SRCS is sources for probe infrastructure and
62 ## PROBE_SRCS is sources for actual replacement functions. Unfortunatelly,
63 ## it is not so easy and UTILITY_SRCS do not link alone.
65 COMMON_SRCS = $(UTILITY_SRCS) $(PROBE_SRCS)
67 ./helper/libdaprobe.c \
70 ./helper/dacollection.c \
71 ./helper/dacapture.c \
72 ./helper/daforkexec.c \
74 ./custom_chart/da_chart.c \
77 ./probe_memory/libdamemalloc.c \
78 ./probe_memory/libdamemmanage.c \
79 ./probe_socket/libdasocket.c \
80 ./probe_event/da_event.c \
81 ./probe_event/keytouch.c \
82 ./probe_event/orientation.c \
83 ./probe_third/libdaemon.c \
84 ./probe_thread/libdathread.c \
85 ./probe_thread/libdasync.c \
86 ./probe_userfunc/libdauserfunc.c \
87 ./probe_file/da_io_posix.c \
88 ./probe_file/da_io_stdc.c \
90 DUMMY_SRCS = ./custom_chart/da_chart_dummy.c
91 CAPI_SRCS = $(COMMON_SRCS) \
92 ./probe_capi/capi_appfw.c
93 # ./probe_ui/capi_capture.c
95 TIZEN_SRCS = $(COMMON_SRCS) $(CAPI_SRCS)\
96 ./helper/addr-tizen.c \
97 ./helper/common_probe_init.cpp \
98 ./probe_memory/libdanew.cpp
100 ASM_SRC = ./helper/da_call_original.S
102 ## Totally brain-dead.
103 ## FIXME: Rewrite this normally with eval.
104 ASM_OBJ = $(patsubst %.S,%.o, $(ASM_SRC))
105 CAPI_OBJS = $(patsubst %.c,%.o, $(CAPI_SRCS)) $(ASM_OBJ)
106 TIZEN_OBJS = $(patsubst %.cpp,%.o, $(patsubst %.c,%.o, $(TIZEN_SRCS))) $(ASM_OBJ)
107 DUMMY_OBJS = $(patsubst %.c,%.o, $(DUMMY_SRCS))
110 TIZEN_TARGET = da_probe_tizen.so
111 DUMMY_TARGET = libdaprobe.so
113 CPPFLAGS = $(INCLUDE_CPPFLAGS) -D_GNU_SOURCE -DSELF_LIB_NAME="\"/$(INSTALLDIR)/$(TIZEN_TARGET)\""
114 CFLAGS = $(WARN_CFLAGS) -fPIC
115 CXXFLAGS = $(WARN_CFLAGS) -fPIC
117 TIZEN_CPPFLAGS = -DTIZENAPP $(SWAP_PROBE_DEFS)
118 TIZEN_LDFLAGS = -lstdc++
120 all: capi tizen dummy
121 tizen: headers $(TIZEN_TARGET)
122 dummy: headers $(DUMMY_TARGET)
124 $(ASM_OBJ): $(ASM_SRC)
125 $(CC) $(ASMFLAG) -c $^ -o $@
127 GENERATED_HEADERS = include/api_id_mapping.h include/api_id_list.h include/id_list
128 headers: $(GENERATED_HEADERS)
130 rm -f $(GENERATED_HEADERS)
132 include/api_id_mapping.h: ./scripts/gen_api_id_mapping_header.awk
133 include/api_id_list.h: ./scripts/gen_api_id_mapping_header_list.awk
134 include/id_list: ./scripts/gen_api_id_mapping_list.awk
136 da_api_map: $(GENERATED_HEADERS)
138 $(GENERATED_HEADERS): APINAMES=scripts/api_names.txt
139 $(GENERATED_HEADERS): ./scripts/api_names.txt
140 $(GENERATED_HEADERS):
141 awk -f $< < $(APINAMES) > $@
143 $(TIZEN_TARGET): LDFLAGS+=$(TIZEN_LDFLAGS)
144 $(TIZEN_TARGET): CPPFLAGS+=$(TIZEN_CPPFLAGS)
145 $(TIZEN_TARGET): $(TIZEN_OBJS)
146 $(CC) $(LDFLAGS) $^ -o $@
148 $(DUMMY_TARGET): $(DUMMY_OBJS)
149 $(CC) $(LDFLAGS) $^ -o $@
152 [ -d "$(DESTDIR)/$(INSTALLDIR)" ] || mkdir -p $(DESTDIR)/$(INSTALLDIR)
153 install $(TIZEN_TARGET) $(DUMMY_TARGET) $(DESTDIR)/$(INSTALLDIR)/
154 install -m 644 include/id_list $(DESTDIR)/$(INSTALLDIR)/da_api_map
157 rm -f *.so *.o $(GENERATED_HEADERS)
159 .PHONY: all capi tizen dummy clean install headers