• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1ifndef BASE_NAME
2BASE_NAME	=	x86disasm
3endif
4
5ifndef SWIG
6SWIG		=	swig	# apt-get install swig !
7endif
8
9ifndef GCC
10GCC		=	gcc
11endif
12
13ifndef CC_FLAGS
14CC_FLAGS	=	-c -fPIC
15endif
16
17ifndef LD_FLAGS
18LD_FLAGS	=	-shared -L.. -ldisasm
19endif
20
21INTERFACE_FILE	=	libdisasm_oop.i
22
23SWIG_INTERFACE	=	../$(INTERFACE_FILE)
24
25# PERL rules
26PERL_MOD	=	blib/arch/auto/$(BASE_NAME)/$(BASE_NAME).so
27PERL_SHADOW	=	$(BASE_NAME)_wrap.c
28PERL_SWIG	=	$(BASE_NAME).pl
29PERL_OBJ	=	$(BASE_NAME)_wrap.o
30PERL_INC	=	`perl -e 'use Config; print $$Config{archlib};'`/CORE
31PERL_CC_FLAGS	=	`perl -e 'use Config; print $$Config{ccflags};'`
32
33#====================================================
34# TARGETS
35
36all: swig-perl
37
38dummy: swig-perl install uninstall clean
39
40swig-perl: $(PERL_MOD)
41
42$(PERL_MOD): $(PERL_OBJ)
43	perl Makefile.PL
44	make
45	#$(GCC) $(LD_FLAGS) $(PERL_OBJ) -o $@
46
47$(PERL_OBJ): $(PERL_SHADOW)
48	$(GCC) $(CC_FLAGS) $(PERL_CC_FLAGS) -I$(PERL_INC) -o $@ $<
49
50$(PERL_SHADOW): $(SWIG_INTERFACE)
51	swig -perl -shadow -o $(PERL_SHADOW) -outdir . $<
52
53# ==================================================================
54install: $(PERL_MOD)
55	make install
56
57# ==================================================================
58uninstall:
59
60# ==================================================================
61clean:
62	rm $(PERL_MOD) $(PERL_OBJ)
63	rm $(PERL_SHADOW)
64	rm -rf Makefile blib pm_to_blib
65
66