forked from RehabMan/Lenovo-U430-Touch-DSDT-Patch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
86 lines (70 loc) · 2.14 KB
/
makefile
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# makefile
#
# Patches/Installs/Builds DSDT patches for Lenovo u430
#
# Created by RehabMan
#
BUILDDIR=./build
HDA=ALC283
RESOURCES=./Resources_$(HDA)
HDAINJECT=AppleHDA_$(HDA).kext
USBINJECT=USBXHC_u430.kext
BACKLIGHTINJECT=AppleBacklightInjector.kext
VERSION_ERA=$(shell ./print_version.sh)
ifeq "$(VERSION_ERA)" "10.10-"
INSTDIR=/System/Library/Extensions
else
INSTDIR=/Library/Extensions
endif
SLE=/System/Library/Extensions
# set build products
PRODUCTS=$(BUILDDIR)/SSDT-HACK.aml
IASLFLAGS=-vw 2095
IASL=iasl
.PHONY: all
all: $(PRODUCTS) $(HDAINJECT)
$(BUILDDIR)/SSDT-HACK.aml: ./SSDT-HACK.dsl
$(IASL) $(IASLFLAGS) -p $@ $<
.PHONY: clean
clean:
rm -f $(BUILDDIR)/*.dsl $(BUILDDIR)/*.aml
# Clover Install
.PHONY: install
install: $(PRODUCTS)
$(eval EFIDIR:=$(shell sudo ./mount_efi.sh /))
rm -f $(EFIDIR)/EFI/CLOVER/ACPI/patched/SSDT-HACK.aml
rm -f $(EFIDIR)/EFI/CLOVER/ACPI/patched/DSDT.aml
rm -f $(EFIDIR)/EFI/CLOVER/ACPI/patched/SSDT-2.aml
rm -f $(EFIDIR)/EFI/CLOVER/ACPI/patched/SSDT-3.aml
rm -f $(EFIDIR)/EFI/CLOVER/ACPI/patched/SSDT-4.aml
rm -f $(EFIDIR)/EFI/CLOVER/ACPI/patched/SSDT-5.aml
rm -f $(EFIDIR)/EFI/CLOVER/ACPI/patched/SSDT-7.aml
cp $(BUILDDIR)/SSDT-HACK.aml $(EFIDIR)/EFI/CLOVER/ACPI/patched/SSDT-HACK.aml
$(HDAINJECT): $(RESOURCES)/*.plist ./patch_hda.sh
./patch_hda.sh $(HDA)
touch $@
$(BACKLIGHTINJECT): Backlight.plist patch_backlight.sh
./patch_backlight.sh
touch $@
.PHONY: update_kernelcache
update_kernelcache:
sudo touch $(SLE)
sudo kextcache -update-volume /
.PHONY: install_hda
install_hda:
sudo rm -Rf $(INSTDIR)/$(HDAINJECT)
sudo cp -R ./$(HDAINJECT) $(INSTDIR)
if [ "`which tag`" != "" ]; then sudo tag -a Blue $(INSTDIR)/$(HDAINJECT); fi
make update_kernelcache
.PHONY: install_usb
install_usb:
sudo rm -Rf $(INSTDIR)/$(USBINJECT)
sudo cp -R ./$(USBINJECT) $(INSTDIR)
if [ "`which tag`" != "" ]; then sudo tag -a Blue $(INSTDIR)/$(USBINJECT); fi
make update_kernelcache
.PHONY: install_backlight
install_backlight:
sudo rm -Rf $(INSTDIR)/$(BACKLIGHTINJECT)
sudo cp -R ./$(BACKLIGHTINJECT) $(INSTDIR)
if [ "`which tag`" != "" ]; then sudo tag -a Blue $(INSTDIR)/$(BACKLIGHTINJECT); fi
make update_kernelcache