rabbitizer/rust/Makefile
Anghelo Carvajal fb8c1edbd7
Rust bindings (#17)
* Generate bindings for enums

* Add .gitignore Cargo didn't automatically made

* Actually build the files into the library

* `pub` in `mod` to fix warning

* instruction struct

* Instruction rust binding

* Add InstrId::ALL_MAX

* link C library to rust

* Publish crate CI

* test

* config bindings

* add getters for registers

* add names methods for register enums

* get_operand_type

* feedback from simon

* Forgot to add new file to python setup.py

* get_operands_slice

* add stuff to cargo.toml
2022-12-18 15:15:39 -03:00

43 lines
906 B
Makefile

# Build options can be changed by modifying the makefile or by building with 'make SETTING=value'.
DEBUG ?= 1
ifeq ($(DEBUG),0)
CARGO_ARGS += --release
endif
RS_TABLE_GEN := ../tools/rs_table_gen.sh
IINC := -I ../include
TABLE_DIRS := $(shell find src -type d)
TABLE_TEMPLATES := $(foreach dir,$(TABLE_DIRS),$(wildcard $(dir)/*.tablers.template))
TABLE_GENERATED := $(TABLE_TEMPLATES:%.tablers.template=%.rs)
TABLE_DEP_FILES := $(TABLE_GENERATED:%.rs=%.tablers.d)
all: $(TABLE_GENERATED)
make -C ..
cargo build $(CARGO_ARGS)
distclean:
$(RM) -rf $(TABLE_GENERATED)
.PHONY: all distclean
.DEFAULT_GOAL := all
.SECONDARY:
%.rs: %.tablers.template
cpp -P $(IINC) -M -MM -MMD -MP -MF $(@:.rs=.tablers.d) $<
$(RS_TABLE_GEN) $< $@
-include $(TABLE_DEP_FILES)
# Print target for debugging
print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true