-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (22 loc) · 697 Bytes
/
Makefile
File metadata and controls
29 lines (22 loc) · 697 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
CC := cc
CFLAGS := -std=c11 -Wall -g -fPIC -fstack-protector -fstack-protector-all -pthread -Wno-unused-variable -Wno-unused-but-set-variable
LIB := -lfuse -lpthread -lrt -lfskit -lfskit_fuse -lpstat
INC := -I.
C_SRCS:= $(wildcard *.c)
OBJ := $(patsubst %.c,%.o,$(C_SRCS))
DEFS := -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS -D_FILE_OFFSET_BITS=64
RUNFS := runfs
DESTDIR ?= /
PREFIX ?= /usr
BINDIR ?= $(DESTDIR)/$(PREFIX)/bin
all: runfs
runfs: $(OBJ)
$(CC) $(CFLAGS) -o $(RUNFS) $(OBJ) $(LIBINC) $(LIB)
install: runfs
mkdir -p $(BINDIR)
cp -a $(RUNFS) $(BINDIR)
%.o : %.c
$(CC) $(CFLAGS) -o "$@" $(INC) -c "$<" $(DEFS)
.PHONY: clean
clean:
/bin/rm -f $(OBJ) $(RUNFS)