-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
35 lines (28 loc) · 798 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
CFLAGS=-I/usr/include/libr -I/usr/include
# $(shell pkg-config --cflags r_core)
LDFLAGS=$(shell pkg-config --libs r_core) $(shell curl-config --libs)
PLUGDIR=$(shell r2 -H R2_USER_PLUGINS)
LIBEXT=$(shell r2 -H LIBEXT)
PLUGNAME=first
TARGET=$(PLUGNAME).$(LIBEXT)
# ifndef VERBOSE
# .SILENT:
# endif
all:
$(CC) $(CFLAGS) -g -O3 -shared -fPIC -Wno-discarded-qualifiers utils.c first.c jsmn.c ini.c -o first.$(LIBEXT) $(LDFLAGS)
$(MAKE) install
.PHONY : install
install:
mkdir -p $(HOME)/.config/first
mkdir -p $(HOME)/.config/first/db
cp -rf first.config $(HOME)/.config/first/
mkdir -p $(PLUGDIR)
rm -rf $(PLUGDIR)/$(TARGET)
cp -rf $(TARGET) $(PLUGDIR)/
.PHONY : uninstall
uninstall:
rm -rf $(PLUGDIR)/$(TARGET)
rm -rf $(HOME)/.config/first
.PHONY : clean
clean:
rm -rf $(TARGET)