summaryrefslogtreecommitdiff
path: root/src/arch/arm/v7/opdefs/Makefile.am
blob: 8a799b16396c743fdc90c4fa4f41c8e5427cf4eb (plain)
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

include ../../../../../tools/d2c.mk


D2C_BIN = ../../../../../tools/d2c

D2C_OUTDIR = $(PWD)/..

D2C_ARCH = armv7
D2C_HEADER = _ARCH_ARM_V7

D2C_ENCODINGS =							\
	-e a=								\
	-e t=thumb_

D2C_MACROS =											\
    -M SetFlags=g_armv7_instruction_define_setflags		\
    -M Condition=g_arm_instruction_set_cond				\
    -M Register=translate_armv7_register				\
    -M "ExpandImmC32=g_imm_operand_new_from_value(MDS_32_BITS_UNSIGNED, "

ARMV7_DEFS = 							\
	mov_A88104.d						\
	subs_B9320.d


all: $(ARMV7_DEFS:.d=.g) untabify_disass fix_includes_in_c finish_disass

fix_includes_in_c:
	find ../opcodes -name '*c' -exec sed -i 's/##INCLUDES##/\n#include "..\/instruction.h"\n#include "..\/..\/instruction.h"\n#include "..\/helpers.h"\n#include "..\/..\/..\/..\/common\/bconst.h"\n\n/' {} \;

finish_disass: $(D2C_OUTDIR)/opcodes/opcodes.h
	sed -i 's/##INCLUDES##/#include\ <stdint.h>\n\n#include "..\/..\/..\/instruction.h"/' $<
	if ! grep -q 'endif' $<; then echo -en "\n\n#endif  /* _ARCH_ARM_V7_OPCODES_OPCODES_H */\n" >> $< ; fi

clean:
	rm -f $(ARMV7_DEFS:.d=.g) $(D2C_OUTDIR)/opcodes/*c $(D2C_OUTDIR)/opcodes/opcodes.h