-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
57 lines (44 loc) · 1.9 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
53
54
55
56
57
libdir.x86_64 := $(shell if [ -d "/usr/lib/x86_64-linux-gnu" ]; then echo "/usr/lib/x86_64-linux-gnu"; else echo "/usr/lib64"; fi )
libdir.i686 := $(shell if [ -d "/usr/lib/i386-linux-gnu" ]; then echo "/usr/lib/i386-linux-gnu"; else echo "/usr/lib"; fi )
libdir.arm := $(shell if [ -d "/usr/lib/arm-linux-gnueabihf" ]; then echo "/usr/lib/arm-linux-gnueabihf"; else echo "/usr/lib"; fi )
libdir.macos := /usr/local/lib
ISNOTMACOS := $(shell uname -a | grep "Darwin" >/dev/null ; echo $$? )
ifeq ($(ISNOTMACOS), 0)
MACHINE := macos
CFLAGS := -bundle
else
MACHINE := $(shell uname -m)
ifneq (, $(findstring armv, $(MACHINE)))
MACHINE := arm
endif
CFLAGS := -shared
endif
libdir = $(libdir.$(MACHINE))/geany
all: prepare build
prepare:
cd ./lloyd-yajl-66cb08c && bash configure
cp ./lloyd-yajl-66cb08c/src/api/yajl_common.h ./lloyd-yajl-66cb08c/build/yajl-2.1.0/include/yajl
cd ./lloyd-yajl-66cb08c && make distro
build:
gcc -DLOCALEDIR=\"\" -DGETTEXT_PACKAGE=\"zhgzhg\" -c ./geany_json_prettifier.c -fPIC `pkg-config --cflags geany`
gcc geany_json_prettifier.o -o jsonprettifier.so "./lloyd-yajl-66cb08c/build/yajl-2.1.0/lib/libyajl_s.a" $(CFLAGS) `pkg-config --libs geany`
install: globaluninstall globalinstall localuninstall
uninstall: globaluninstall
globaluninstall:
rm -f "$(libdir)/jsonprettifier.so"
rm -f $(libdir)/jsonprettifier.*
rm -f $(libdir)/json_prettifier.*
globalinstall:
cp -f ./jsonprettifier.so "$(libdir)/jsonprettifier.so"
chmod 755 "$(libdir)/jsonprettifier.so"
localinstall: localuninstall
mkdir -p "$(HOME)/.config/geany/plugins"
cp -f ./jsonprettifier.so "$(HOME)/.config/geany/plugins/jsonprettifier.so"
chmod 755 "$(HOME)/.config/geany/plugins/jsonprettifier.so"
localuninstall:
rm -f "$(HOME)/.config/geany/plugins/jsonprettifier.so"
clean:
rm -f ./jsonprettifier.so
rm -f ./geany_json_prettifier.o
rm -f ./lloyd-yajl-66cb08c/Makefile
rm -fr ./lloyd-yajl-66cb08c/build