CXX=icpc
CXXFLAGS+=-fast -openmp
Kernel_dir = ../../Kernel
Kernel_OBJ = $(Kernel_dir)/bitvector.o $(Kernel_dir)/Complement.o $(Kernel_dir)/Cube.o $(Kernel_dir)/hashtable.o $(Kernel_dir)/myExcept.o $(Kernel_dir)/mytime.o $(Kernel_dir)/orthogonalize.o $(Kernel_dir)/PLA.o $(Kernel_dir)/PLA_operations.o $(Kernel_dir)/PLA_type.o $(Kernel_dir)/SoPLA.o $(Kernel_dir)/Term.o $(Kernel_dir)/TTree.o $(Kernel_dir)/utils.o

Multilevel_dir = ../../Multilevel
Multilevel_OBJ = $(Multilevel_dir)/Blif.o $(Multilevel_dir)/Network.o $(Multilevel_dir)/Node.o $(Multilevel_dir)/Signal.o

Asynch_DIMS_dir = ../../Apps/Asynch_DIMS
Asynch_DIMS_OBJ = $(Asynch_DIMS_dir)/Asynch_DIMS.o

Blif2Bench_dir = ../../Apps/Blif2Bench
Blif2Bench_OBJ = $(Blif2Bench_dir)/Blif2Bench.o

BOOM_dir = ../../Apps/BOOM
BOOM_OBJ = $(BOOM_dir)/AuraCover.o $(BOOM_dir)/BoomAlg.o $(BOOM_dir)/CD_search.o $(BOOM_dir)/Cover.o $(BOOM_dir)/CovMatrix.o $(BOOM_dir)/Expand.o $(BOOM_dir)/FC_Min.o $(BOOM_dir)/HeurCover.o $(BOOM_dir)/LagBaBCover.o $(BOOM_dir)/Reduce.o

GetInfo_dir = ../../Apps/GetInfo
GetInfo_obj = $(GetInfo_dir)/GetInfo.o

#Asynch_Multilevel_dir = ../../Apps/Asynch_Multilevel
#Asynch_Multilevel_obj = $(Asynch_Multilevel_dir)/Asynch_Multilevel.o

BlowupNetwork_dir = ../../Apps/BlowupNetwork
BlowupNetwork_obj = $(BlowupNetwork_dir)/BlowupNetwork.o

BlifToBench_dir = ../../Apps/BlifToBench
BlifToBench_obj = $(BlifToBench_dir)/BlifToBench.o

GroupOutputs_dir = ../../Apps/GroupOutputs
GroupOutputs_obj = $(GroupOutputs_dir)/GroupOutputs.o

MergePLAs_dir = ../../Apps/MergePLAs
MergePLAs_obj = $(MergePLAs_dir)/MergePLAs.o

Negate_dir = ../../Apps/Negate
Negate_obj = $(Negate_dir)/Negate.o

Ortho_dir = ../../Apps/Ortho
Ortho_obj = $(Ortho_dir)/Ortho.o

Parity_dir = ../../Apps/Parity
Parity_obj = $(Parity_dir)/Parity.o

Resynth_dir = ../../Apps/Resynth
Resynth_obj = $(Resynth_dir)/Resynth.o $(Resynth_dir)/Resynthesis.o

Resynth_order_dir = ../../Apps/Resynth_order
Resynth_order_obj = $(Resynth_order_dir)/Resynth_order.o

SL_Partition_dir = ../../Apps/SL_Partition
SL_Partition_obj = $(SL_Partition_dir)/SL_Partition.o

Split_dir = ../../Apps/Split
Split_obj = $(Split_dir)/Split.o

Split_outputs_dir = ../../Apps/Split_outputs
Split_outputs_obj = $(Split_outputs_dir)/Split_outputs.o

Strip_udc_dir = ../../Apps/Strip_udc
Strip_udc_obj = $(Strip_udc_dir)/Strip_udc.o

Swap_dir = ../../Apps/Swap
Swap_obj = $(Swap_dir)/Swap.o

Test_dir = ../../Apps/Test
Test_obj = $(Test_dir)/Test.o

all:	boom

boom:		$(Kernel_OBJ) $(BOOM_OBJ) $(BOOM_dir)/BOOM.cpp
		$(CXX) $(CXXFLAGS) -pthread -o bin/boom $(Kernel_OBJ) $(BOOM_OBJ) $(BOOM_dir)/BOOM.cpp

Asynch_DIMS:	$(Kernel_OBJ) $(Asynch_DIMS_OBJ) $(Multilevel_OBJ)
		$(CXX) $(CXXFLAGS) -o bin/Asynch_DIMS $(Kernel_OBJ) $(Asynch_DIMS_OBJ) $(Multilevel_OBJ)

BlifToBench:	$(BlifToBench_obj) $(Kernel_OBJ) $(Multilevel_dir)/Blif.o
		$(CXX) $(CXXFLAGS) -o bin/BlifToBench $(BlifToBench_obj) $(Kernel_OBJ) $(Multilevel_dir)/Blif.o

BlowupNetwork:	$(BlowupNetwork_obj) $(Kernel_OBJ) $(Multilevel_OBJ)
		$(CXX) $(CXXFLAGS) -o bin/BlowupNetwork $(BlowupNetwork_obj) $(Kernel_OBJ) $(Multilevel_OBJ)

GetInfo:	$(GetInfo_obj) $(Kernel_OBJ) $(Multilevel_dir)/Blif.o
		$(CXX) $(CXXFLAGS) -o bin/GetInfo $(GetInfo_obj) $(Kernel_OBJ) $(Multilevel_dir)/Blif.o

#Asynch_Multilevel:	$(Asynch_Multilevel_obj) $(Kernel_OBJ) $(Multilevel_OBJ)
#		$(CXX) $(CXXFLAGS) -o bin/Asynch_Multilevel $(Asynch_Multilevel_obj) $(Kernel_OBJ) $(Multilevel_OBJ)

GroupOutputs:	$(GroupOutputs_obj) $(Kernel_OBJ) $(BOOM_OBJ)
		$(CXX) $(CXXFLAGS) -o bin/GroupOutputs $(GroupOutputs_obj) $(Kernel_OBJ) $(BOOM_OBJ)

MergePLAs:	$(MergePLAs_obj) $(Kernel_OBJ)
		$(CXX) $(CXXFLAGS) -o bin/MergePLAs $(MergePLAs_obj) $(Kernel_OBJ)

Negate:		$(Negate_obj) $(Kernel_OBJ) $(Multilevel_OBJ)
		$(CXX) $(CXXFLAGS) -o bin/Negate $(Negate_obj) $(Kernel_OBJ) $(Multilevel_OBJ)

Ortho:		$(Ortho_obj) $(Kernel_OBJ)
		$(CXX) $(CXXFLAGS) -o bin/Ortho $(Ortho_obj) $(Kernel_OBJ)

Parity:		$(Parity_obj) $(Kernel_OBJ) $(Multilevel_OBJ)
		$(CXX) $(CXXFLAGS) -o bin/Parity $(Parity_obj) $(Kernel_OBJ) $(Multilevel_OBJ)

Resynth:	$(Resynth_obj) $(Kernel_OBJ) $(Multilevel_OBJ)
		$(CXX) $(CXXFLAGS) -o bin/Resynth $(Resynth_obj) $(Kernel_OBJ) $(Multilevel_OBJ)

Resynth_order:$(Resynth_order_obj) $(Kernel_OBJ) $(Multilevel_OBJ)
		$(CXX) $(CXXFLAGS) -o bin/Resynth_order $(Resynth_order_obj) $(Kernel_OBJ) $(Multilevel_OBJ)

SL_Partition:	$(SL_Partition_obj) $(Kernel_OBJ)
		$(CXX) $(CXXFLAGS) -o bin/SL_Partition $(SL_Partition_obj) $(Kernel_OBJ)

Split:		$(Split_obj) $(Kernel_OBJ)
		$(CXX) $(CXXFLAGS) -o bin/Split $(Split_obj) $(Kernel_OBJ)

Split_outputs:	$(Split_outputs_obj) $(Kernel_OBJ)
		$(CXX) $(CXXFLAGS) -o bin/Split_outputs $(Split_outputs_obj) $(Kernel_OBJ)

Strip_udc:	$(Strip_udc_obj) $(Kernel_OBJ)
		$(CXX) $(CXXFLAGS) -o bin/Strip_udc $(Strip_udc_obj) $(Kernel_OBJ)

Swap:		$(Swap_obj) $(Kernel_OBJ)
		$(CXX) $(CXXFLAGS) -o bin/Swap $(Swap_obj) $(Kernel_OBJ)

Test:		$(Test_obj) $(Kernel_OBJ)
		$(CXX) $(CXXFLAGS) -o bin/Test $(Test_obj) $(Kernel_OBJ)

clean:
	rm -f $(Asynch_DIMS_dir)/*.o
#	rm -f $(Asynch_Multilevel_dir)/*.o
	rm -f $(BlifToBench_dir)/*.o
	rm -f $(BlowupNetwork_dir)/*.o
	rm -f $(BOOM_dir)/*.o
	rm -f $(GetInfo_dir)/*.o
	rm -f $(GroupOutputs_dir)/*.o
	rm -f $(Kernel_dir)/*.o
	rm -f $(MergePLAs_dir)/*.o
	rm -f $(Multilevel_dir)/*.o
	rm -f $(Negate_dir)/*.o
	rm -f $(Ortho_dir)/*.o
	rm -f $(Parity_dir)/*.o
	rm -f $(Resynth_dir)/*.o
	rm -f $(Resynth_order_dir)/*.o
	rm -f $(SL_Partition_dir)/*.o
	rm -f $(Split_dir)/*.o
	rm -f $(Split_outputs_dir)/*.o
	rm -f $(Strip_udc_dir)/*.o
	rm -f $(Swap_dir)/*.o
	rm -f $(Test_dir)/*.o
	rm -f bin/boom
