forked from PL125/emmcdl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·52 lines (43 loc) · 1.25 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
CC = $(CROSS_COMPILE)g++
COMPILER = $(shell $(CC) -dM -E - < /dev/null | grep _WIN32 > /dev/null && echo "mingw" || echo "none")
ifeq ($(COMPILER), none)
COMPILER = linux
endif
TARGET=emmcdl
TARGET_EXE=$(TARGET)
SRC = \
src/crc.cpp \
src/dload.cpp \
src/emmcdl.cpp \
src/ffu.cpp \
src/firehose.cpp \
src/partition.cpp \
src/protocol.cpp \
src/sahara.cpp \
src/sparse.cpp \
src/xmlparser.cpp
OBJ = $(SRC:.cpp=.o)
DEPEND_STATIC_LIB =
CFLAGS = -std=c++11 -fno-rtti -fno-exceptions
CFLAGS += -I./inc
LDFLAGS = -lpthread
ifeq ($(COMPILER), linux)
SRC += src/diskwriter_linux.cpp
SRC += src/serialport.cpp
#DEPEND_STATIC_LIB += ../../../output/lib/libselinux.a ../../../output/lib/libpcre.a
endif
ifeq ($(COMPILER), mingw)
SRC += src/diskwriter.cpp src/serialport.cpp
CFLAGS += -DPLATFORM_WINDOWS -DARM -D_WIN32_WINNT=0x0600
#CFLAGS += -I../../../development/host/windows/usb/api -DUSE_MINGW src/sysdeps_windows.cpp
#DEPEND_STATIC_LIB += ../../../prebuild/host/windows-x64/AdbWinApi.lib
LDFLAGS += -static
endif
$(TARGET_EXE):$(OBJ) $(DEPEND_STATIC_LIB);$(CC) -o $@ $^ $(LDFLAGS)
$(filter %.o,$(OBJ)):%.o:%.cpp;$(CC) $(CFLAGS) -c -o $@ $<
.PHONY:install
install:
cp -rf $(TARGET_EXE) ../../../output/bin/
.PHONY:clean
clean:
rm -f $(OBJ) $(TARGET_EXE) *.o