-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·64 lines (51 loc) · 1.69 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
##
#
# AnV LZVN/LZSS kernel cache decompressor V1.0
#
# Intel 64-bit (x86_64) version
#
##
PREFIX=/usr/local
XCODEPATH=/Applications/Xcode.app
PLATFORM=MacOSX.platform
SDK=MacOSX.sdk
SDKPREFIX=$(XCODEPATH)/Contents/Developer/Platforms/$(PLATFORM)/Developer/SDKs/$(SDK)
NASM=nasm
CC=clang -I$(PREFIX)/include -F$(SDKPREFIX)/System/Library/Frameworks
AR=ar
RANLIB=ranlib
CODESIGN=codesign
CSIDENT=Apple Development
LIBS=-L. -llzvn -F$(SDKPREFIX)/System/Library/Frameworks -framework IOKit -framework CoreFoundation
INSTALL=install
ARFLAGS=cru
CFLAGS=-arch x86_64 -arch arm64 -Os -mmacosx-version-min=10.6
ASFLAGS=$(CFLAGS)
all: decompkernelcache decompkernelcache-kc
# .asm.o:
# $(NASM) -o $@ -f macho64 $<
# .s.o:
# $(CC) $(ASFLAGS) -c $< -o $@
# .S.o:
# $(CC) $(ASFLAGS) -c $< -o $@
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
WINSUPSRC/IOCFUnserialize.o: WINSUPSRC/IOCFUnserialize.c
lzvndec.o: lzvndec.c
lzvn_encode.o: lzvn_encode.c
liblzvn.a: lzvndec.o lzvn_encode.o
$(AR) $(ARFLAGS) $@ lzvndec.o lzvn_encode.o
$(RANLIB) liblzvn.a
decompkernelcache: decompkernelcache.o WINSUPSRC/IOCFUnserialize.o liblzvn.a
$(CC) $(CFLAGS) -o $@ decompkernelcache.o WINSUPSRC/IOCFUnserialize.o $(LIBS)
$(CODESIGN) -s "$(CSIDENT)" $@
decompkernelcache-kc: decompkernelcache-kc.o WINSUPSRC/IOCFUnserialize.o liblzvn.a
$(CC) $(CFLAGS) -o $@ decompkernelcache-kc.o WINSUPSRC/IOCFUnserialize.o $(LIBS)
$(CODESIGN) -s "$(CSIDENT)" $@
clean:
rm -f *.o WINSUPSRC/IOCFUnserialize.o liblzvn.a decompkernelcache decompkernelcache-kc
install: decompkernelcache lzvn.h liblzvn.a
$(INSTALL) decompkernelcache $(PREFIX)/bin
$(INSTALL) decompkernelcache-kc $(PREFIX)/bin
$(INSTALL) liblzvn.a $(PREFIX)/lib
$(INSTALL) lzvn.h $(PREFIX)/include