#correct CALCHEP (CalcHEP directory) if it needs

CALCHEP=$(CURDIR)/..

.PHONY : all clean extlib

ifneq ($(MAKECMDGOALS),clean)

ifeq (,$(wildcard $(CALCHEP)/FlagsForMake))
$(error "Can not find FlagsForMake file.  It should be disposed in the\
 CalcHEP directory. Check variable CALCHEP in Makefile and   FlagsForMake\
 in CALCHEP directory. FlagsForMake appears in result of CalcHEP installation") 
endif

#read compiler options ..
include $(CALCHEP)/FlagsForMake

endif



mLibOBJ =  nmssm.o 

all: nmhdecay_slha.exe mLib.a extlib

mLib.a(nmssm.o): nmssm_path.h

nmssm_path.h:
	echo \#define WORK \"$(CURDIR)\" > nmssm_path.h

mLib.a:mLib.a($(mLibOBJ))
	$(RANLIB) mLib.a
	rm -f mLibOBJ

nmhdecay_slha.exe :nmhdecay_slha.f
	$(FC) $(FFLAGS) -o nmhdecay_slha.exe  nmhdecay_slha.f

extlib:
	./updateExtLib

clean: 
	rm -f *.o  mLib.a   nmhdecay_slha.exe nmssm_path.h 
	./updateExtLib 0
