Split screenshots into separate lib 71/110271/2
authorAlexander Aksenov <a.aksenov@samsung.com>
Wed, 28 Dec 2016 12:42:19 +0000 (15:42 +0300)
committerAlexander Aksenov <a.aksenov@samsung.com>
Mon, 16 Jan 2017 11:18:59 +0000 (14:18 +0300)
Change-Id: If2fb7b5b649e07cfb9f342b2d8b8d52586a787a6
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
Makefile
packaging/swap-probe.spec

index a32f283..c87a294 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,7 @@ PROBE_EVENT_TARGET = swap_probe_event.so
 PROBE_GRAPHICS_TARGET = swap_probe_graphics.so
 PROBE_UI_TARGET = swap_probe_ui.so
 PROBE_CAPI_TARGET = swap_probe_capi.so
+PROBE_SCREENSHOT_TARGET = swap_probe_screenshot.so
 DUMMY_TARGET = libdaprobe.so
 PARSE_ELF_LIB_TARGET = libparserelf.so
 PARSE_ELF_BIN_TARGET = parse_elf
@@ -82,7 +83,6 @@ LDFLAGS = -shared     \
        -lpthread                       \
        -lrt                            \
        -ldl                            \
-       -lwayland-client        \
        -Wl,-z,noexecstack
 
 ASMFLAG = -O0 -g -Werror
@@ -149,14 +149,31 @@ PROBE_CAPI_SRCS = \
        ./probe_capi/probe_capi.c
 
 ifeq ($(TIZEN_FEATURE_WAYLAND),y)
-UTILITY_SRCS += ./helper/dacapture.c
 PROBE_EVENT_SRCS += ./probe_event/orientation.c
 CFLAGS += -Wno-deprecated-declarations -Wno-unused-const-variable
 CFLAGS += -DTIZEN_FEATURE_WAYLAND
 CFLAGS += -I/usr/include/wayland-extension/
-TIZEN_LDFLAGS+=                                \
-       -lscreenshooter-client          \
-       -lwayland-tbm-client
+
+PROBE_SCREENSHOT_SRCS = ./helper/dacapture.c
+PROBE_SCREENSHOT_OBJS = $(patsubst %.cpp,%.o, $(patsubst %.c,%.o, $(PROBE_SCREENSHOT_SRCS)))
+
+screenshot:     tizen $(PROBE_SCREENSHOT_TARGET)
+
+PROBE_SCREENSHOT_LDFLAGS =      \
+       -L.                     \
+       -lscreenshooter-client  \
+       -lwayland-tbm-client    \
+       -lwayland-client        \
+       -l:da_probe_tizen.so
+
+$(PROBE_SCREENSHOT_TARGET): LDFLAGS+=$(PROBE_SCREENSHOT_LDFLAGS)
+$(PROBE_SCREENSHOT_TARGET): CPPFLAGS+=-DSELF_LIB_NAME="\"/$(INSTALLDIR)/$(PROBE_SCREENSHOT_TARGET)\"" -DTIZENAPP $(SWAP_PROBE_DEFS)
+$(PROBE_SCREENSHOT_TARGET): CPPFLAGS+=$(DEBUG_FLAGS)
+$(PROBE_SCREENSHOT_TARGET): $(TIZEN_TARGET) $(PROBE_SCREENSHOT_OBJS)
+       $(CC) $(LDFLAGS) $^ -o $@
+
+else
+screenshot: ;
 endif # TIZEN_FEATURE_WAYLAND
 
 DUMMY_SRCS = ./custom_chart/da_chart_dummy.c
@@ -184,7 +201,7 @@ PARSE_ELF_LIB_OBJ = $(patsubst %.c,%.o, $(PARSE_ELF_LIB_SRC))
 PARSE_ELF_BIN_OBJ = $(patsubst %.c,%.o, $(PARSE_ELF_BIN_SRC))
 
 
-all:           elflib tizen dummy event graphics ui capi elfparser
+all:           elflib tizen dummy event graphics ui capi screenshot elfparser
 tizen:         headers $(TIZEN_TARGET)
 dummy:         headers $(DUMMY_TARGET)
 elflib:                $(PARSE_ELF_LIB_OBJ) $(PARSE_ELF_LIB_TARGET)
@@ -306,7 +323,7 @@ $(PARSE_ELF_BIN_TARGET): $(PARSE_ELF_BIN_OBJ) $(PARSE_ELF_LIB_TARGET)
 
 ldheader:      $(SOURCE_HEADERS) $(LINKER_HEADER)
 
-install: install_da install_event install_graphics install_ui install_capi install_ld install_elf install_lsan
+install: install_da install_event install_graphics install_ui install_capi install_screenshot install_ld install_elf install_lsan
 
 install_da: all
        [ -d "$(DESTDIR)/$(INSTALLDIR)" ] || mkdir -p $(DESTDIR)/$(INSTALLDIR)
@@ -346,8 +363,11 @@ install_capi: capi
        [ -d "$(DESTDIR)/$(INSTALLDIR)" ] || mkdir -p $(DESTDIR)/$(INSTALLDIR)
        install $(PROBE_CAPI_TARGET) $(DESTDIR)/$(INSTALLDIR)/
 
+install_screenshot: screenshot
+       [ -d "$(DESTDIR)/$(INSTALLDIR)" ] || mkdir -p $(DESTDIR)/$(INSTALLDIR)
+       install $(PROBE_SCREENSHOT_TARGET) $(DESTDIR)/$(INSTALLDIR)/
 
 clean:
-       rm -f *.so $(TIZEN_OBJS) $(PROBE_EVENT_OBJS) $(PROBE_GRAPHICS_OBJS) $(PROBE_UI_OBJS) $(PROBE_CAPI_OBJS) $(PARSE_ELF_LIB_OBJ) $(PARSE_ELF_BIN_OBJ) $(GENERATED_HEADERS) $(API_NAME_LIST) $(SOURCE_HEADERS)
+       rm -f *.so $(TIZEN_OBJS) $(PROBE_EVENT_OBJS) $(PROBE_GRAPHICS_OBJS) $(PROBE_UI_OBJS) $(PROBE_CAPI_OBJS) $(PROBE_SCREENSHOT_OBJS) $(PARSE_ELF_LIB_OBJ) $(PARSE_ELF_BIN_OBJ) $(GENERATED_HEADERS) $(API_NAME_LIST) $(SOURCE_HEADERS)
 
-.PHONY: all capi tizen dummy event clean install_ld install_da install_event install_graphics install_ui install_capi install_elf install headers lsan
+.PHONY: all capi tizen dummy event clean install_ld install_da install_event install_graphics install_ui install_capi install_screenshot install_elf install headers lsan
index 42fa129..db10e03 100644 (file)
@@ -132,6 +132,7 @@ mkdir -p %{buildroot}/usr/local/bin
 %{_prefix}/lib/swap_probe_graphics.so
 %{_prefix}/lib/swap_probe_ui.so
 %{_prefix}/lib/swap_probe_capi.so
+%{_prefix}/lib/swap_probe_screenshot.so
 %{_prefix}/lib/libdaprobe.so
 
 %files -n swap-probe-devel