forked from GreySyntax/iRecoveryplusplus
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
39 lines (30 loc) · 1.18 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
CXXFLAGS = -O2 -g -Wall -fmessage-length=0 -I./include
CXXALL = -lreadline ./libirecovery/libirecovery.a
CXXCSS = -I"./include" -I"./libirecovery/include" -I"/usr/local/include" -L"/usr/local/lib"
CXXWIN = -lusb -I"C:\MinGW\include" -L"C:\MinGW\lib"
CXXNIX = -lusb-1.0
CXXOSX = -lusb-1.0 -framework CoreFoundation -framework IOKit
DIRS = ./src ./include
TARGET = ./bin/iRecovery
EXTRA_FILES = ./Makefile ./images/irecvpp-black.jpg ./images/irecvpp.png
SOURCE := $(foreach DIR,$(DIRS),$(wildcard $(DIR)/*.cpp))
HEADERS := $(foreach DIR,$(DIRS),$(wildcard $(DIR)/*.h))
all:
@echo 'iRecovery++, requires you run make with a platform argument (win, linux, mach, backup).'
start:
@echo ''
@echo 'Building iRecovery++'
@echo ''
@rm -rf ./bin;
linux: start $(SOURCE)
@mkdir ./bin;
$(CXX) -o $(TARGET) $(SOURCE) $(CXXCSS) $(CXXALL) $(CXXNIX)
mach: start $(SOURCE)
@mkdir ./bin;
$(CXX) -o $(TARGET) $(SOURCE) $(CXXCSS) $(CXXALL) $(CXXOSX)
win: start $(SOURCE)
@mkdir ./bin;
$(CXX) -o $(TARGET) $(SOURCE) $(CXXALL) $(CXXWIN)
backup: $(SOURCE) $(HEADERS) $(EXTRA_FILES)
@if [ ! -e ./backup ]; then mkdir ./backup; fi;
@zip ./backup/`date +%d-%m-%y_%H.%M`.zip $(SOURCE) $(HEADERS) $(EXTRA_FILES)