unicorn/bindings/Makefile

54 lines
1.2 KiB
Makefile
Raw Normal View History

2015-08-21 07:04:50 +00:00
# Unicorn Engine
# By Nguyen Anh Quynh & Dang Hoang Vu, 2015
DIFF = diff
2015-08-21 07:04:50 +00:00
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=)
2015-08-21 07:04:50 +00:00
2016-12-26 07:54:46 +00:00
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Linux)
ENV_VARS = LD_PRELOAD=librt.so LD_LIBRARY_PATH=../ DYLD_LIBRARY_PATH=../
2016-12-26 07:54:46 +00:00
else
ENV_VARS = LD_LIBRARY_PATH=../ DYLD_LIBRARY_PATH=../ LIBUNICORN_PATH=$(TRAVIS_BUILD_DIR)
2016-12-26 07:54:46 +00:00
endif
.PHONY: build install python c clean check test
2015-08-21 07:04:50 +00:00
build:
$(MAKE) -C python gen_const
$(MAKE) -C go gen_const
$(MAKE) -C java gen_const
$(MAKE) -C ruby gen_const
python const_generator.py dotnet
2015-08-21 07:04:50 +00:00
install: build
$(MAKE) -C python install
$(MAKE) -C java install
test: $(SAMPLE:%=%.py.test)
2015-08-21 07:04:50 +00:00
c:
$(MAKE) -C ../samples
python:
$(MAKE) -C python
%.c.txt: c
$(ENV_VARS) ../samples/$(@:%.c.txt=%) > $@
%.py.txt: python
$(ENV_VARS) python python/$(@:%.txt=%) > $@
2015-08-21 07:04:50 +00:00
%.py.test: %.c.txt %.py.txt
2017-02-26 08:52:06 +00:00
$(DIFF) -u $(@:%.py.test=%.c.txt) $(@:%.py.test=%.py.txt)
2015-08-21 07:04:50 +00:00
clean:
# rm -rf *.txt
$(MAKE) -C python clean
$(MAKE) -C java clean
2015-08-21 07:04:50 +00:00
check:
make -C python check