# Makefile generated by OCamake
# http://tech.motion-twin.com
OCAMLOPT=ocamlopt
OCAMLC=ocamlc
.SUFFIXES : .ml .mli .cmo .cmi .cmx .mll .mly

ALL_CFLAGS= $(CFLAGS) -I ../extlib -I ../extc -g
LIBS=

SRC=actionScript.ml as3hl.mli as3.mli png.ml swflib.sln swf.ml swfPic.ml as3code.ml as3hlparse.ml as3parse.ml png.mli swfParser.ml

MODULES=as3code.cmx png.cmx swf.cmx actionScript.cmx as3parse.cmx swfPic.cmx as3hlparse.cmx swfParser.cmx

all: native bytecode

native: swflib.cmxa

bytecode: swflib.cma

swflib.cmxa: $(MODULES)
	$(OCAMLOPT) -o swflib.cmxa -a $(LIBS) $(MODULES)

swflib.cma: $(MODULES:.cmx=.cmo)
	$(OCAMLC) -o swflib.cma -a $(LFLAGS) $(LIBS) $(MODULES:.cmx=.cmo)

actionScript.cmx: swf.cmx

actionScript.cmo: swf.cmi

as3code.cmo: as3.cmi

as3code.cmx: as3.cmi

as3hl.cmi: as3.cmi

as3hlparse.cmo: as3parse.cmo as3hl.cmi as3code.cmo as3.cmi

as3hlparse.cmx: as3parse.cmx as3hl.cmi as3code.cmx as3.cmi

as3parse.cmo: as3code.cmo as3.cmi

as3parse.cmx: as3code.cmx as3.cmi

png.cmo: png.cmi

png.cmx: png.cmi

swf.cmo: as3.cmi

swf.cmx: as3.cmi

swfParser.cmo: swf.cmo as3parse.cmo actionScript.cmo

swfParser.cmx: swf.cmx as3parse.cmx actionScript.cmx

swfPic.cmx: swf.cmx png.cmi

clean:
	rm -f swflib.cmxa swflib.cma swflib.lib swflib.a as3.cmi as3hl.cmi
	rm -f $(MODULES) $(MODULES:.cmx=.obj) $(MODULES:.cmx=.cmi) $(MODULES:.cmx=.o) $(MODULES:.cmx=.cmo)

# SUFFIXES
.ml.cmo:
	$(OCAMLC) $(ALL_CFLAGS) -c $<

.ml.cmx:
	$(OCAMLOPT) $(ALL_CFLAGS) -c $<

.mli.cmi:
	$(OCAMLC) $(ALL_CFLAGS) $<

.mll.ml:
	ocamllex $<

.mly.ml:
	ocamlyacc $<

.PHONY: all bytecode native clean

Makefile: ;
$(SRC): ;
