###############################
# makefile for source weigths #
###############################

#This code is provided by the Pierre Auger Collaboration as it is without any warranty, for questions please contact Jonathan Biteau [biteau(at)in2p3.fr]. If this material from Pierre Auger Collaboration was helpful for your research work, we kindly request the following references to be cited in any published material: 2018ApJ...853L..29A, 2019ICRC...36..206C.

SYSTEM=$(shell uname)
CC = gcc 
CXX = g++
OPTFLAGS = #-O
DBGFLAGS = -g3 -std=c++11
WFLAGS = -D__USE_FIXED_PROTOTYPES__ -Wall
OBJ = ./

.PHONY: clean
#------------------- defs ------------------------------
INCDIR = $(shell root-config --cflags)

LIBDIR = -lm $(shell root-config --glibs)
#-------------------------------------------------------

#------- alias -----------------------------------------
execs = 1_load_weights.exe

exeobjs = $(patsubst %.exe,%.o,$(execs))

HEADERS = $(patsubst %.o,%.h,$(libobjs))
#-------------------------------------------------------

#-------- rules ----------------------------------------
# rules for the executable sources
$(OBJ)%.o:%.cc
	$(COMPILE.cc) $(DBGFLAGS) $(OPTFLAGS) $(WFLAGS) $(INCDIR) -o $@ $<
#-------------------------------------------------------

#------- targets ---------------------------------------
all :	$(execs) 
clean :
	@echo "Deleting library objects, executables and associated objects."
	@/bin/rm -f $(execs) $(libobjs) $(exeobjs)
	@/bin/rm -f *~
	@echo "Done"
#-------------------------------------------------------

#-------- specific rules -------------------------------
1_load_weights.exe : 	1_load_weights.o 
	$(CXX) -o $@ $^ $(LIBDIR)
#-------------------------------------------------------
