forked from matteoserva/MegaFuse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (34 loc) · 1.23 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
TARGET = mega-netbsd
###############
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)))
INSTALLDIR = /usr/local/bin
.PHONY:
# include directories
INCLUDES = -I inc -I /usr/include/g++/ -I /usr/pkg/include/cryptopp -I /usr/pkg/include/db6 -I sdk
# C compiler flags (-g -O2 -Wall)
CCFLAGS = -O0 -g -fstack-protector-all -Wall -Wno-unused-variable #-non-call-exceptions
CCFLAGS += $(shell pkg-config --cflags libcurl fuse)
CPPFLAGS = -std=c++11 $(CCFLAGS) -D_GLIBCXX_DEBUG
# compiler
CC = clang
CPP = clang++
CXX= clang++
# library paths
LIBS =
# compile flags
LDFLAGS = -lcryptopp -lfreeimage -ldb6_cxx
LDFLAGS += $(shell pkg-config --libs libcurl ) -lrefuse -lperfuse
megafuse: $(OUT)
all: megafuse
$(OUT): $(OBJ)
$(CPP) $(CPPFLAGS) -o $(OUT) $(OBJ) $(LDFLAGS)
.cpp.o:
$(CPP) $(INCLUDES) $(CPPFLAGS) -c $< -o $@
install:
install -d -m0755 -o root -g wheel $(INSTALLDIR)
install -m0755 -o root -g wheel mega-netbsd $(INSTALLDIR)
clean:
rm -f $(OBJ) $(OUT)