HOMEDIR=$(HOME)

DIR=$(HOMEDIR)/stage_long/lava/Modules/Compilers/Ghc/Objects

LAVAOBJECTS=$(DIR)/Arithmetic.o $(DIR)/Combinational.o $(DIR)/ConstructiveAnalysis.o $(DIR)/Error.o $(DIR)/Fixit.o $(DIR)/Generic.o $(DIR)/IOBuffering.o $(DIR)/Lava.o $(DIR)/LavaDir.o $(DIR)/LavaRandom.o $(DIR)/MyST.o $(DIR)/Netlist.o $(DIR)/Operators.o $(DIR)/Patterns.o $(DIR)/Property.o $(DIR)/Ref.o $(DIR)/Retime.o $(DIR)/Sequent.o $(DIR)/Sequential.o $(DIR)/SequentialCircuits.o $(DIR)/SequentialConstructive.o $(DIR)/Signal.o $(DIR)/Smv.o $(DIR)/Test.o $(DIR)/UnsafeCoerce.o $(DIR)/Verification.o $(DIR)/Vhdl.o $(DIR)/Vis.o

GHC=ghc

GHCOPTS=-package lang -O

bxd_sup.o: bxd_sup.c
	gcc -c bxd_sup.c

Bxd.hi Bxd.o: Bxd.hs
	$(GHC) $(GHCOPTS) -c Bxd.hs

Multiplier.hi Multiplier.o: Multiplier.hs
	$(GHC) $(GHCOPTS) -i$(DIR) -c Multiplier.hs

MultiPLE.hi MultiPLE.o: MultiPLE.hs
	$(GHC) $(GHCOPTS) -i$(DIR) -c MultiPLE.hs

Sorter.hi Sorter.o: Sorter.hs
	$(GHC) $(GHCOPTS) -i$(DIR) -c Sorter.hs

BackwardConst.hi BackwardConst.o: BackwardConst.hs Bxd.hi
	$(GHC) $(GHCOPTS) -i$(DIR) -c BackwardConst.hs

VerifyBMD.hi VerifyBMD.o: VerifyBMD.hs Bxd.hi BackwardConst.hi
	$(GHC) $(GHCOPTS) -i$(DIR) -c VerifyBMD.hs

Main.hi Main.o: Main.hs VerifyBMD.hi Bxd.hi MultiPLE.hi
	$(GHC) $(GHCOPTS) -i$(DIR) -c Main.hs

a.out: Main.o BackwardConst.o Bxd.o bxd_sup.o MultiPLE.o VerifyBMD.o
	$(GHC) $(GHCOPTS) -i$(DIR) $(LAVAOBJECTS) BackwardConst.o Main.o bxd_sup.o Bxd.o MultiPLE.o VerifyBMD.o $(HOMEDIR)/stage_long/bxd.release/libbxd.a 
