-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (25 loc) · 774 Bytes
/
Makefile
File metadata and controls
33 lines (25 loc) · 774 Bytes
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
.PHONY: clean libarchivefs
UNAME := $(shell uname)
CFLAGS = -Wall -Wextra -Werror -fdiagnostics-color=auto \
-Iinclude -I/usr/local/include/osxfuse -I/usr/local/opt/libarchive/include
LDFLAGS = -larchive
ifeq ($(UNAME),Darwin)
LDFLAGS += -losxfuse
CFLAGS += -D_DARWIN_USE_64_BIT_INODE
endif
ifeq ($(UNAME),Linux)
LDFLAGS += -lfuse -Wl,-R/usr/local/opt/archivefs/lib
endif
all: archivefs
archivefs: src/main.c libarchivefs | create_build_directory
gcc -D_FILE_OFFSET_BITS=64 -L/usr/local/opt/libarchive/lib -L/usr/local/lib \
src/main.c -o archivefs \
$(LDFLAGS) $(CFLAGS) \
-L./target/release/ -larchivefs
create_build_directory:
mkdir -p build/
libarchivefs: src/lib.rs Cargo.toml
cargo build --release
clean:
rm -rf build/ archivefs
cargo clean