forked from ProcursusTeam/Procursus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pincrush.mk
42 lines (33 loc) · 1.24 KB
/
pincrush.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
ifneq ($(PROCURSUS),1)
$(error Use the main Makefile)
endif
SUBPROJECTS += pincrush
DOWNLOAD += https://github.com/DHowett/pincrush/archive/$(PINCRUSH_VERSION).tar.gz
PINCRUSH_VERSION := 0.9.2
DEB_PINCRUSH_V ?= $(PINCRUSH_VERSION)
pincrush-setup: setup
$(call EXTRACT_TAR,$(PINCRUSH_VERSION).tar.gz,pincrush-$(PINCRUSH_VERSION),pincrush)
mkdir -p $(BUILD_STAGE)/pincrush/usr/bin
ifneq ($(wildcard $(BUILD_WORK)/pincrush/.build_complete),)
pincrush:
@echo "Using previously built pincrush."
else
pincrush: pincrush-setup libpng16
cd $(BUILD_WORK)/pincrush; \
$(SED) -i '/#include <stdbool.h>/a #include <string.h>' pincrush.c; \
$(CC) $(CFLAGS) $(LDFLAGS) -DVERSION=\"$(PINCRUSH_VERSION)\" -o $(BUILD_STAGE)/pincrush/usr/bin/pincrush pincrush.c -lpng16 -lz
touch $(BUILD_WORK)/pincrush/.build_complete
endif
pincrush-package: pincrush-stage
# pincrush.mk Package Structure
rm -rf $(BUILD_DIST)/pincrush
mkdir -p $(BUILD_DIST)/pincrush
# pincrush.mk Prep pincrush
cp -a $(BUILD_STAGE)/pincrush/usr $(BUILD_DIST)/pincrush
# pincrush.mk Sign
$(call SIGN,pincrush,general.xml)
# pincrush.mk Make .debs
$(call PACK,pincrush,DEB_PINCRUSH_V)
# pincrush.mk Build cleanup
rm -rf $(BUILD_DIST)/pincrush
.PHONY: pincrush pincrush-package