SHELL = /bin/sh
# decide on compiler and flags depending on host
CC = g++
CFLAGS=-fPIC -pthread
ALL_CFLAGS = -Wall -O6 $(CFLAGS) $(PAM_BIT)


LIBS = $(PAM_YODA)/lib/libyoda.so `root-config --cflags --glibs`
INCS =-I `root-config --incdir`  -I$(PAM_INC) -I$(PAM_YODA)/include/yoda/ -I./ 
EXE = header.exe physend.exe
# pattern rule to compile object files from C files
# might not work with make programs other than GNU make
%.o : %.cpp Makefile
	$(CC) $(ALL_CFLAGS) $(INCS) -c $< -o $@  

all: $(EXE)

OBJS = RunHeaderToXML.o
header.exe: $(OBJS) Makefile
	$(CC) $(ALL_CFLAGS) $(INCS) $(OBJS) $(LIBS) -o RunHeaderToXML

OBJS1 = PhysEndRunToXML.o
physend.exe: $(OBJS1) Makefile
	$(CC) $(ALL_CFLAGS) $(INCS) $(OBJS1) $(LIBS) -o PhysEndRunToXML


.PHONY : clean
clean:
	rm -f *.o *.exe
