forked from sdhand/x11fs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
39 lines (27 loc) · 741 Bytes
/
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
CC?=cc
LD=$(CC)
LIBS=`pkg-config fuse3 --libs` `pkg-config xcb --libs` `pkg-config xcb-icccm --libs`
CFLAGS=-Wall -std=gnu11 -c `pkg-config fuse3 --cflags` `pkg-config xcb --cflags`
PREFIX?=/usr/local
SRCDIR=src
OBJDIR=obj
BINDIR=bin
SRC := $(wildcard $(SRCDIR)/*.c)
OBJ := $(SRC:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
all: x11fs
$(OBJDIR):
mkdir -p $(OBJDIR)
$(BINDIR):
mkdir -p $(BINDIR)
$(OBJDIR)/%.o: $(SRCDIR)/%.c $(wildcard $(SRCDIR)/*.h) $(OBJDIR)
$(CC) $(CFLAGS) -o $@ $<
x11fs: $(BINDIR) $(OBJ)
$(LD) $(OBJ) $(LIBS) -o $(BINDIR)/$@
install: x11fs
mkdir -p $(DESTDIR)$(PREFIX)/bin/
cp $(BINDIR)/x11fs $(DESTDIR)$(PREFIX)/bin/
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/x11fs
clean:
rm -f $(OBJDIR)/*.o
rm -f $(BINDIR)/x11fs