File: Makefile

package info (click to toggle)
unicorn-engine 2.1.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,912 kB
  • sloc: ansic: 379,830; python: 9,213; sh: 9,011; java: 8,609; ruby: 4,241; pascal: 1,805; haskell: 1,379; xml: 490; cs: 424; makefile: 348; cpp: 298; asm: 64
file content (55 lines) | stat: -rw-r--r-- 1,265 bytes parent folder | download | duplicates (2)
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
# Unicorn Engine
# By Nguyen Anh Quynh & Dang Hoang Vu, 2015
DIFF = diff

SAMPLE_SOURCE = $(wildcard ../samples/*.c)
SAMPLE = $(SAMPLE_SOURCE:../samples/%.c=%)
SAMPLE := $(SAMPLE:mem_apis=)
SAMPLE := $(SAMPLE:sample_batch_reg=)
SAMPLE := $(SAMPLE:sample_x86_32_gdt_and_seg_regs=)
SAMPLE := $(SAMPLE:shellcode=)

UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Linux)
ENV_VARS = LD_PRELOAD=librt.so LD_LIBRARY_PATH=../ DYLD_LIBRARY_PATH=../
else
ENV_VARS = LD_LIBRARY_PATH=../ DYLD_LIBRARY_PATH=../ LIBUNICORN_PATH=$(TRAVIS_BUILD_DIR)
endif


.PHONY: build install python c clean check test

build:
	$(MAKE) -C python gen_const
	$(MAKE) -C go gen_const
	$(MAKE) -C java gen_const
	$(MAKE) -C ruby gen_const
	python3 const_generator.py dotnet
	python3 const_generator.py pascal
	python3 const_generator.py zig

install: build
	$(MAKE) -C python install
	$(MAKE) -C java install

test: $(SAMPLE:%=%.py.test)

c:
	$(MAKE) -C ../samples
python:
	$(MAKE) -C python
%.c.txt: c
	$(ENV_VARS) ../samples/$(@:%.c.txt=%) > $@
%.py.txt: python
	$(ENV_VARS) python3 python/$(@:%.txt=%) > $@

%.py.test: %.c.txt %.py.txt
	$(DIFF) -u $(@:%.py.test=%.c.txt) $(@:%.py.test=%.py.txt)

clean:
#	rm -rf *.txt
	$(MAKE) -C python clean
	$(MAKE) -C java clean

check:
	make -C python check