forked from ProcursusTeam/Procursus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap-cmds.mk
48 lines (38 loc) · 1.7 KB
/
bootstrap-cmds.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
ifneq ($(PROCURSUS),1)
$(error Use the main Makefile)
endif
SUBPROJECTS += bootstrap-cmds
BOOTSTRAP-CMDS_VERSION := 116
DEB_BOOTSTRAP-CMDS_V ?= $(BOOTSTRAP-CMDS_VERSION)
bootstrap-cmds-setup: setup
wget -q -nc -P $(BUILD_SOURCE) https://opensource.apple.com/tarballs/bootstrap_cmds/bootstrap_cmds-$(BOOTSTRAP-CMDS_VERSION).tar.gz
$(call EXTRACT_TAR,bootstrap_cmds-$(BOOTSTRAP-CMDS_VERSION).tar.gz,bootstrap_cmds-$(BOOTSTRAP-CMDS_VERSION),bootstrap-cmds)
mkdir -p $(BUILD_STAGE)/bootstrap-cmds/usr/{bin,libexec}
ifneq ($(wildcard $(BUILD_WORK)/bootstrap-cmds/.build_complete),)
bootstrap-cmds:
@echo "Using previously built bootstrap-cmds."
else
bootstrap-cmds: .SHELLFLAGS=-O extglob -c
bootstrap-cmds: bootstrap-cmds-setup
cd $(BUILD_WORK)/bootstrap-cmds/migcom.tproj; \
yacc -d parser.y; \
lex lexxer.l; \
$(CC) $(ARCH) -isysroot $(TARGET_SYSROOT) $(PLATFORM_VERSION_MIN) -DMIG_VERSION=\"mig-$(BOOTSTRAP-CMDS_VERSION)\" -o migcom !(handler).c -save-temps; \
cp -a migcom $(BUILD_STAGE)/bootstrap-cmds/usr/libexec; \
cp -a mig.sh $(BUILD_STAGE)/bootstrap-cmds/usr/bin/mig
touch $(BUILD_WORK)/bootstrap-cmds/.build_complete
endif
bootstrap-cmds-package: bootstrap-cmds-stage
# bootstrap-cmds.mk Package Structure
rm -rf $(BUILD_DIST)/bootstrap-cmds
# bootstrap-cmds.mk Prep bootstrap-cmds
cp -a $(BUILD_STAGE)/bootstrap-cmds $(BUILD_DIST)
# bootstrap-cmds.mk Sign
$(call SIGN,bootstrap-cmds,general.xml)
# bootstrap-cmds.mk Permissions
$(FAKEROOT) chmod a+x $(BUILD_DIST)/bootstrap-cmds/usr/bin/mig
# bootstrap-cmds.mk Make .debs
$(call PACK,bootstrap-cmds,DEB_BOOTSTRAP-CMDS_V)
# bootstrap-cmds.mk Build cleanup
rm -rf $(BUILD_DIST)/bootstrap-cmds
.PHONY: bootstrap-cmds bootstrap-cmds-package