forked from ProcursusTeam/Procursus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libonig.mk
50 lines (40 loc) · 1.62 KB
/
libonig.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
ifneq ($(PROCURSUS),1)
$(error Use the main Makefile)
endif
SUBPROJECTS += libonig
LIBONIG_VERSION := 6.9.4
DEB_LIBONIG_V ?= $(LIBONIG_VERSION)
libonig-setup: setup
wget -q -nc -P $(BUILD_SOURCE) https://github.com/kkos/oniguruma/releases/download/v$(LIBONIG_VERSION)/onig-$(LIBONIG_VERSION).tar.gz
$(call EXTRACT_TAR,onig-$(LIBONIG_VERSION).tar.gz,onig-$(LIBONIG_VERSION),libonig)
ifneq ($(wildcard $(BUILD_WORK)/libonig/.build_complete),)
libonig:
@echo "Using previously built libonig."
else
libonig: libonig-setup
cd $(BUILD_WORK)/libonig && ./configure -C \
--host=$(GNU_HOST_TRIPLE) \
--prefix=/usr
+$(MAKE) -C $(BUILD_WORK)/libonig install \
DESTDIR=$(BUILD_STAGE)/libonig
touch $(BUILD_WORK)/libonig/.build_complete
endif
libonig-package: libonig-stage
# libonig.mk Package Structure
rm -rf $(BUILD_DIST)/libonig{5,-dev}
mkdir -p $(BUILD_DIST)/libonig5/usr/lib \
$(BUILD_DIST)/libonig-dev/usr/{include,lib/pkgconfig}
# libonig.mk Prep libonig5
cp -a $(BUILD_STAGE)/libonig/usr/lib/libonig.5.dylib $(BUILD_DIST)/libonig5/usr/lib
# libonig.mk Prep libonig-dev
cp -a $(BUILD_STAGE)/libonig/usr/include/onig{gnu.h,posix.h,uruma.h} $(BUILD_DIST)/libonig-dev/usr/include
cp -a $(BUILD_STAGE)/libonig/usr/lib/libonig.{a,dylib} $(BUILD_DIST)/libonig-dev/usr/lib
cp -a $(BUILD_STAGE)/libonig/usr/lib/pkgconfig/oniguruma.pc $(BUILD_DIST)/libonig-dev/usr/lib/pkgconfig
# libonig.mk Sign
$(call SIGN,libonig5,general.xml)
# libonig.mk Make .debs
$(call PACK,libonig5,DEB_LIBONIG_V)
$(call PACK,libonig-dev,DEB_LIBONIG_V)
# libonig.mk Build cleanup
rm -rf $(BUILD_DIST)/libonig{5,-dev}
.PHONY: libonig libonig-package