forked from ProcursusTeam/Procursus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libzip.mk
54 lines (45 loc) · 1.45 KB
/
libzip.mk
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
ifneq ($(PROCURSUS),1)
$(error Use the main Makefile)
endif
SUBPROJECTS += libzip
DOWNLOAD += https://libzip.org/download/libzip-$(LIBZIP_VERSION).tar.gz
LIBZIP_VERSION := 1.7.0
DEB_LIBZIP_V ?= $(LIBZIP_VERSION)
libzip-setup: setup
$(call EXTRACT_TAR,libzip-$(LIBZIP_VERSION).tar.gz,libzip-$(LIBZIP_VERSION),libzip)
ifneq ($(wildcard $(BUILD_WORK)/libzip/.build_complete),)
libzip:
@echo "Using previously built libzip."
else
libzip: libzip-setup
cd $(BUILD_WORK)/libzip && cmake . \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=Darwin \
-DCMAKE_CROSSCOMPILING=true \
-DCMAKE_INSTALL_NAME_TOOL=$(I_N_T) \
-DCMAKE_INSTALL_PREFIX=/ \
-DCMAKE_INSTALL_NAME_DIR=/usr/lib \
-DCMAKE_INSTALL_RPATH=/usr \
-DCMAKE_OSX_SYSROOT="$(SYSROOT)" \
-DCMAKE_C_FLAGS="$(CFLAGS)" \
-DCMAKE_CXX_FLAGS="$(CXXFLAGS)" \
-DCOMMON_ARCH=$(DEB_ARCH) \
-DCMAKE_FIND_ROOT_PATH=$(BUILD_BASE)
+$(MAKE) -C $(BUILD_WORK)/libzip
+$(MAKE) -C $(BUILD_WORK)/libzip install \
DESTDIR="$(BUILD_STAGE)/libzip"
touch $(BUILD_WORK)/libzip/.build_complete
endif
libzip-package: libzip-stage
# libzip.mk Package Structure
rm -rf $(BUILD_DIST)/nano
mkdir -p $(BUILD_DIST)/nano
# libzip.mk Prep libzip
cp -a $(BUILD_STAGE)/libzip/usr $(BUILD_DIST)/libzip
# libzip.mk Sign
$(call SIGN,libzip,general.xml)
# libzip.mk Make .debs
$(call PACK,libzip,DEB_LIBZIP_V)
# libzip.mk Build cleanup
rm -rf $(BUILD_DIST)/nano
.PHONY: libzip libzip-package