blob: 9fff2f95cc666800dad93a66389d32bb8ad8eba6 [file] [log] [blame]
Dees_Troy51a0e822012-09-05 15:24:24 -04001LOCAL_PATH := $(call my-dir)
2
3include $(CLEAR_VARS)
4
5LOCAL_MODULE := pigz
Matt Mowerdb220442014-10-31 22:43:59 -05006LOCAL_MODULE_TAGS := eng optional
Dees_Troy51a0e822012-09-05 15:24:24 -04007LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
8LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
Matt Mowerdb220442014-10-31 22:43:59 -05009LOCAL_CFLAGS :=
Dees_Troy51a0e822012-09-05 15:24:24 -040010LOCAL_SRC_FILES = pigz.c yarn.c
11LOCAL_C_INCLUDES += $(LOCAL_PATH) \
12 external/zlib
13LOCAL_SHARED_LIBRARIES += libz libc
14
15include $(BUILD_EXECUTABLE)
16
17PIGZ_TOOLS := unpigz
18SYMLINKS := $(addprefix $(TARGET_RECOVERY_ROOT_OUT)/sbin/,$(PIGZ_TOOLS))
19$(SYMLINKS): PIGZ_BINARY := $(LOCAL_MODULE)
20$(SYMLINKS): $(LOCAL_INSTALLED_MODULE)
21 @echo "Symlink: $@ -> $(PIGZ_BINARY)"
22 @mkdir -p $(dir $@)
23 @rm -rf $@
24 $(hide) ln -sf $(PIGZ_BINARY) $@
25
Dees Troyb47f28b2014-12-11 17:20:59 +000026ifneq (,$(filter $(PLATFORM_SDK_VERSION),16 17 18))
27ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS)
28
29# We need this so that the installed files could be picked up based on the
30# local module name
31ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \
32 $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SYMLINKS)
33endif
34
Matt Mower031163b2014-11-01 15:13:03 -050035include $(CLEAR_VARS)
36LOCAL_MODULE := unpigz_symlink
37LOCAL_MODULE_TAGS := optional
38LOCAL_ADDITIONAL_DEPENDENCIES := $(SYMLINKS)
39include $(BUILD_PHONY_PACKAGE)
40SYMLINKS :=