forked from nospaceships/node-yara
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
34 lines (28 loc) · 869 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
BASE=$(shell pwd)
OSNAME=$(shell uname)
CFGOPTS += --with-crypto
CFGOPTS += --enable-magic
ifeq ($(OSNAME),Darwin)
CFLAGS += -I/usr/local/include/node
CFLAGS += -I/usr/local/include
LDFLAGS += -L/usr/local/lib
endif
YARA?=4.2.3
libyara: yara
yara:
-rm -rf $(BASE)/build/yara
-rm -rf $(BASE)/deps/yara-$(YARA)
test -f $(BASE)/deps/yara-$(YARA).tar.gz || curl -L -k https://github.com/VirusTotal/yara/archive/v$(YARA).tar.gz > $(BASE)/deps/yara-$(YARA).tar.gz
cd $(BASE)/deps && tar -xzvf yara-$(YARA).tar.gz
cd $(BASE)/deps/yara-$(YARA) && ./bootstrap.sh
cd $(BASE)/deps/yara-$(YARA) && \
CFLAGS="$(CFLAGS)" \
LDFLAGS="$(LDFLAGS)" \
./configure \
$(CFGOPTS) \
--enable-static \
--disable-shared \
--with-pic \
--prefix=$(BASE)/build/yara
cd $(BASE)/deps/yara-$(YARA) && make
cd $(BASE)/deps/yara-$(YARA) && make install