/itexToMML

To download this project, use:
bzr branch http://golem.ph.utexas.edu/~distler/code/itexToMML/
1 by Jacques Distler
Initial commit.
1
#YACC=yacc
2
YACC=bison -y  -v
3
LEX=flex -P$(YYPREFIX) -olex.yy.c
43 by Jacques Distler
itex2MML 1.3.19: Ruby 1.9 Compatibility
4
SWIG=swig
5
RUBY=ruby
6
#RUBY=ruby19
1 by Jacques Distler
Initial commit.
7
8
RM=rm -f
9
INSTALL=install -c
10
BINDIR=/usr/local/bin
11
12
YYPREFIX=itex2MML_yy
13
14
all:    y.tab.c lex.yy.c itex2MML
15
16
y.tab.c:	itex2MML.y
17
		$(YACC) -p $(YYPREFIX) -d itex2MML.y
18
19
lex.yy.c:	itex2MML.l
20
		$(LEX) itex2MML.l
21
22
y.tab.o:	y.tab.c itex2MML.h
9 by Jacques Distler
Make target for MacOSX universal binary.
23
		$(CC) $(CFLAGS) -c -o y.tab.o y.tab.c
1 by Jacques Distler
Initial commit.
24
25
lex.yy.o:	lex.yy.c y.tab.c itex2MML.h
9 by Jacques Distler
Make target for MacOSX universal binary.
26
		$(CC) $(CFLAGS) -c -o lex.yy.o lex.yy.c
1 by Jacques Distler
Initial commit.
27
28
itex2MML:	lex.yy.o y.tab.o itex2MML.cc itex2MML.h
9 by Jacques Distler
Make target for MacOSX universal binary.
29
		$(CXX) $(CFLAGS) -o itex2MML lex.yy.o y.tab.o itex2MML.cc
30
31
universal:		
27 by Jacques Distler
Version 1.3.3
32
		CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i686 -arch ppc' make all
1 by Jacques Distler
Initial commit.
33
34
clean:		
35
		$(RM) y.tab.* lex.yy.c itex2MML *.o *.output *.so *.dll *.sl *.bundle itex2MML_ruby.c
36
37
install:	itex2MML
38
		$(INSTALL) itex2MML $(BINDIR)
39
43 by Jacques Distler
itex2MML 1.3.19: Ruby 1.9 Compatibility
40
RUBY_CFLAGS = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["CFLAGS"]')
44 by Jacques Distler
Fix Ruby bindings to work in Ruby 1.9
41
RUBY_LD = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["LDSHARED"]')
43 by Jacques Distler
itex2MML 1.3.19: Ruby 1.9 Compatibility
42
RUBYLIBDIR =$(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["libdir"]') 
43
RUBY_PREFIX =  $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["rubylibdir"]')
44
RUBY_ARCH = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["arch"]')
45
RUBYDIR = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["archdir"]')
46
RUBYHDRDIR = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["rubyhdrdir"]')
47
RUBY_SITEDIR = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["sitelibdir"]')
48
RUBY_SITEARCHDIR = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["sitearchdir"]')
49
LIBRUBYARG = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["LIBRUBYARG"]')
50
DYLIB_EXT = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["DLEXT"]')
44 by Jacques Distler
Fix Ruby bindings to work in Ruby 1.9
51
RUBY_target_os = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["target_os"]')
52
53
ifneq (, $(findstring darwin, $(RUBY_target_os)) )
54
EXTRA_CFLAGS = -DHAVE_SNPRINTF -DHAVE_STRUCT_TIMESPEC -DHAVE_STRUCT_TIMEZONE
55
LD_TARGET = MACOSX_DEPLOYMENT_TARGET=10.4
56
else
57
EXTRA_CFLAGS = ''
58
LD_TARGET = ''
59
endif
1 by Jacques Distler
Initial commit.
60
61
itex2MML_ruby.c:	itex2MML.i
43 by Jacques Distler
itex2MML 1.3.19: Ruby 1.9 Compatibility
62
			$(SWIG) -ruby -o itex2MML_ruby.c  itex2MML.i
1 by Jacques Distler
Initial commit.
63
64
itex2MML_ruby.o:	itex2MML_ruby.c
44 by Jacques Distler
Fix Ruby bindings to work in Ruby 1.9
65
			$(CC) $(RUBY_CFLAGS)  $(EXTRA_CFLAGS) -c itex2MML_ruby.c -I$(RUBYHDRDIR) -I$(RUBYDIR) -o itex2MML_ruby.o
1 by Jacques Distler
Initial commit.
66
67
y.tab_ruby.o:		y.tab.c
11 by Jacques Distler
Portability fixes for Ruby bindings [Jason Blevins].
68
			$(CC) $(RUBY_CFLAGS) -Ditex2MML_CAPTURE -c -o y.tab_ruby.o y.tab.c
69
70
lex.yy_ruby.o:	lex.yy.c y.tab.c itex2MML.h
71
		$(CC) $(RUBY_CFLAGS) -c -o lex.yy_ruby.o lex.yy.c
72
73
ruby:	itex2MML_ruby.o y.tab_ruby.o lex.yy_ruby.o
44 by Jacques Distler
Fix Ruby bindings to work in Ruby 1.9
74
	$(LD_TARGET) $(RUBY_LD) itex2MML_ruby.o y.tab_ruby.o lex.yy_ruby.o -L$(RUBYLIBDIR) $(LIBRUBYARG) -o itex2MML.$(DYLIB_EXT)
1 by Jacques Distler
Initial commit.
75
76
test_ruby:
43 by Jacques Distler
itex2MML 1.3.19: Ruby 1.9 Compatibility
77
	$(RUBY) ./itextomml.rb
1 by Jacques Distler
Initial commit.
78
79
install_ruby:	itex2MML.$(DYLIB_EXT)
80
	$(INSTALL) itex2MML.$(DYLIB_EXT) $(RUBY_SITEARCHDIR)
81
	$(INSTALL) itextomml.rb $(RUBY_SITEDIR)