forked from matteoserva/MegaFuse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (35 loc) · 1.2 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
TARGET = MegaFuse
###############
SRC = src/MegaFuseApp.cpp src/file_cache_row.cpp src/EventsHandler.cpp src/MegaFuse.cpp src/megafusemodel.cpp src/megaposix.cpp src/Config.cpp src/fuseImpl.cpp src/megacli.cpp src/Logger.cpp
SRC += sdk/megabdb.cpp sdk/megaclient.cpp sdk/megacrypto.cpp
OUT = $(TARGET)
OBJ = $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SRC)))
.PHONY: clean install
# include directories
INCLUDES = -I inc -I /usr/include/cryptopp -I sdk
# C compiler flags (-g -O2 -Wall)
CCFLAGS = -O0 -g -fstack-protector-all -Wall #-non-call-exceptions
CCFLAGS += $(shell pkg-config --cflags libcurl fuse)
CPPFLAGS = -std=c++0x $(CCFLAGS) -D_GLIBCXX_DEBUG
# compiler
CC = gcc
CPP = g++
CXX= g++
# library paths
LIBS =
# compile flags
LDFLAGS = -lcryptopp -lfreeimage -ldb_cxx
LDFLAGS += $(shell pkg-config --libs libcurl fuse)
megafuse: $(OUT)
all: megafuse
$(OUT): $(OBJ)
$(CPP) $(CPPFLAGS) -o $(OUT) $(OBJ) $(LDFLAGS)
.cpp.o:
$(CPP) $(INCLUDES) $(CPPFLAGS) -c $< -o $@
clean:
rm -f $(OBJ) $(OUT)
install: $(OUT)
mkdir -p /usr/share/doc/MegaFuse
cp FAQ.txt LICENSE.txt README.md megafuse.conf /usr/share/doc/MegaFuse/
cp megafuse.service megafuse@.service /lib/systemd/system/
cp $(OUT) /usr/bin/