CC	= g++
LD	= g++

BINARIES = glissando
HEADERS = functions.h distrib.h
SOURCES = glissando.cpp functions.cpp
OBJECTS  = $(SOURCES:.cpp=.o) 
MAKES = Makefile_basic Makefile_aux Makefile_files Makefile_gauss Makefile_inter Makefile_retr
OTHER = interpolation.cpp retrieve.cpp
INPUTS =  in input.dat input_O16.dat input_30_40.dat input_aux.dat input_minbias_LHC.dat input_snap.dat input_S_Pb.dat input_p_Pb.dat input_d_Pb.dat input_full.dat 
SCRIPTS = info.C centrality.C centrality2.C epsilon.C epsilon_b.C size.C mult.C dxdy.C density.C core_mantle.C profile2.C fitr.C corr.C wounding_profile.C overlay.C fourier.C tilted.C label.C 
MATH = profile_folding.nb
REFMAN = latex/refman.pdf

CPPOPT = -Wno-deprecated `root-config --cflags` 

# description of the preprocessor parameters:
# _gauss_=1    - use Gaussian wounding profile, =0 - use the hard-sphere profile
# _files_=1    - read the nuclear distributions from external files, =0 - generate randomly
# _profile_=1  - generate the nucleon profile and NN correlation data, =0 - do not
# _weight_=1   - generate data for the NN collision (wounding) profiles and for the 
#                plot of the weight (RDS) ditributions, 0 - do not 
# _rapidity_=1 - generate the data for the rapidity distributions, =0 - do not

COPTD = -D_gauss_=0 -D_files_=0 -D_profile_=0 -D_weight_=0 -D_rapidity_=0
COPT = -c -g -O3 -w ${CPPOPT} ${COPTD}
LLIB = `root-config --libs` -L$(ROOTSYS)/lib -lm -lgcc

all:	$(BINARIES)
	rm *.o

glissando: $(OBJECTS)			
	$(LD) $(LOPT) -o $(EE) glissando $(OBJECTS) $(LLIB)

glissando.o: glissando.cpp functions.h distrib.h 
	$(CC) -o $@ $< $(COPT)

functions.o: functions.cpp functions.h distrib.h
	$(CC) -o $@ $< $(COPT)

package: $(SOURCES) $(HEADERS) $(MAKES) $(OTHER) $(INPUTS) $(SCRIPTS) $(MATH) $(REFMAN) install run
	tar zcvf glissando_2_071.tar.gz $^
