##################################################################
#
# makefile
#
# @file        makefile 
# @title       Simulation of the camera and trigger logic
# @author      J C Gonz\'alez
# @email       gonzalez@mppmu.mpg.de
# @date        Fri Mar 12 11:51:11 MET 1999
#
#_______________________________________________________________
#
# Created: Fri Mar 12 11:51:11 MET 1999
# Author:  Jose Carlos Gonzalez
# Purpose: Makefile for the compilation of the camera program
# Notes:   
#    
#---------------------------------------------------------------
#
# $RCSfile: Makefile,v $
# $Revision: 1.1.1.1 $
# $Author: harald $ 
# $Date: 1999-11-18 09:39:14 $
#
##################################################################
# @maintitle

# @code

INCLUDEMK = config.mk.${OSTYPE}
include ${INCLUDEMK}

# @endcode

# @code 

# common flags
INCLUDES = -I${INCLUDE}      \
	   -I${INCLUDE_COR}  \
	   -I${INCLUDE_ROOT}  \
	   -I${INCLUDE_SIMO} \
           -I/usr/include  -I/usr/include/g++

RANLIB  = -L${RANLIBDIR} -lranlib

# what is needed for ROOT is declared in config.mk file


# special flags

osf_FORLIBS = -lUfor -lfor -lutil -lots -lm 
linux_FORLIBS = -lm 
generic_FORLIBS = -lm 

FORLIBS = ${${SYSTEM}_FORLIBS}

# compilation and linking flags

CXXFLAGS  = -D__${SYSTEM}__ ${INCLUDES} ${OPTIM} ${DEBUG}
CFLAGS    = ${CXXFLAGS}
FFLAGS    = ${CXXFLAGS}
LIBS      = ${RANLIB} ${ROOTLIBS} ${ROOTGLIBS} ${GLIBS} ${FORLIBS} 
#LIBS      = ${CERNLIB} ${RANLIB} ${FORLIBS} 

#------------------------------------------------------------------------------

#.SILENT:

.SUFFIXES: .c .cxx .C .c++ .h .hxx .H .h++ .o .so .f

SRCS = \
	${INCLUDE_COR}/COREventHeader.cxx \
	${INCLUDE_COR}/CORParticle.cxx \
	${INCLUDE_COR}/CORStatfile.cxx \
	MSimone.cxx \
	simone.cxx      

HEADERS = \
	COREventHeader.hxx \
	CORParticle.hxx \
	CORStatfile.hxx \
	MSimone.hxx \
	simone.h

OBJS = \
	${INCLUDE_COR}/COREventHeader.o \
	${INCLUDE_COR}/CORParticle.o \
	${INCLUDE_COR}/CORStatfile.o \
	MSimone.o \
	simone.o      

PROGRAM=simone

############################################################

all: ${PROGRAM}

depend:
	@makedepend $(SRCS) -fMakefile 2> /dev/null

doc: reflector-doc

reflector-doc: 
	@echo "Generating documentation for camera . . . "
	$(DOCUM) -latex -o reflector.tex \
	reflector.cxx reflector.h \
	readparam.cxx readparam.h \
	atm.cxx atm.h
	latex "\nonstopmode\input{reflector.tex}" && \
	makeindex reflector && \
	latex "\nonstopmode\input{reflector.tex}" && \
	latex "\nonstopmode\input{reflector.tex}"
	@echo "Files reflector.tex and reflector.dvi generated."

rate: 
	@echo "Rating documentation inside code . . . "
	$(RATE) \
	reflector.cxx reflector.h \
	readparam.cxx readparam.h \
	atm.cxx atm.h

${PROGRAM}: $(OBJS)
	@echo "Linking..." $@
	$(CXX) $(CXXFLAGS) $(OBJS) $(LIBS) -o $@
	@echo "done."

.cxx.o:	
	@echo "Compiling " $<
	$(CXX) $(CXXFLAGS) -c $< -o $@

.c.o:	
	@echo "Compiling " $<
	$(CC) $(CFLAGS) -c $< -o $@

.f.o:	
	@echo "Compiling " $<
	$(F77) $(FFLAGS) -c $< -o $@

lclean:
	@echo "Cleanning..."
	@rm -f *.o core 

clean:
	@echo "Cleanning..."
	@rm -f $(OBJS) core 

mrproper: clean
	@echo "Mr.Proper in action . . ."
	@rm -f $(PROGRAM)

ctags:
	@echo "Creating CTAGS file . . ."
	@ctags -txw $(SRCS) $(HEADERS) > CTAGS

etags:
	@echo "Creating TAGS file . . ."
	@etags -C $(SRCS) $(HEADERS)

listsrc:
	@ls -m $(SRCS) $(HEADERS) | sed 's/,//g'

redo: clean all

# @endcode

# DO NOT DELETE THIS LINE -- make depend depends on it.

../../Detector/include-CORSIKA/COREventHeader.o: ../../Detector/include-CORSIKA/COREventHeader.hxx
../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/stdlib.h
../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/standards.h
../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/getopt.h
../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/sys/types.h
../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/mach/machine/vm_types.h
../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/sys/select.h
../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/math.h
../../Detector/include-CORSIKA/CORParticle.o: ../../Detector/include-CORSIKA/CORParticle.hxx
../../Detector/include-CORSIKA/CORParticle.o: /usr/include/stdlib.h
../../Detector/include-CORSIKA/CORParticle.o: /usr/include/standards.h
../../Detector/include-CORSIKA/CORParticle.o: /usr/include/getopt.h
../../Detector/include-CORSIKA/CORParticle.o: /usr/include/sys/types.h
../../Detector/include-CORSIKA/CORParticle.o: /usr/include/mach/machine/vm_types.h
../../Detector/include-CORSIKA/CORParticle.o: /usr/include/sys/select.h
../../Detector/include-CORSIKA/CORParticle.o: /usr/include/math.h
../../Detector/include-CORSIKA/CORStatfile.o: ../../Detector/include-CORSIKA/CORStatfile.hxx
../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/stdlib.h
../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/standards.h
../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/getopt.h
../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/sys/types.h
../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/mach/machine/vm_types.h
../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/sys/select.h
../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/math.h
MSimone.o: MSimone.hxx /usr/include/stdlib.h /usr/include/standards.h
MSimone.o: /usr/include/getopt.h /usr/include/sys/types.h
MSimone.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
MSimone.o: /usr/include/stdio.h /usr/include/sys/seek.h
MSimone.o: /usr/include/va_list.h /usr/include/sys/limits.h
MSimone.o: /usr/include/sys/machine/machlimits.h /usr/include/sys/syslimits.h
MSimone.o: /usr/include/sys/machine/machtime.h /usr/include/sys/rt_limits.h
MSimone.o: /usr/include/string.h /usr/include/strings.h /usr/include/unistd.h
MSimone.o: /usr/include/sys/access.h /usr/include/fcntl.h
MSimone.o: /usr/include/sys/fcntl.h /usr/include/sys/mode.h
MSimone.o: ../../Detector/include-CORSIKA/COREventHeader.hxx
MSimone.o: /usr/include/math.h
simone.o: /usr/include/stdlib.h /usr/include/standards.h
simone.o: /usr/include/getopt.h /usr/include/sys/types.h
simone.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
simone.o: ../../Detector/include-CORSIKA/COREventHeader.hxx
simone.o: /usr/include/math.h ../../Detector/include-CORSIKA/CORParticle.hxx
simone.o: ../../Detector/include-CORSIKA/CORStatfile.hxx MSimone.hxx
simone.o: /usr/include/stdio.h /usr/include/sys/seek.h /usr/include/va_list.h
simone.o: /usr/include/sys/limits.h /usr/include/sys/machine/machlimits.h
simone.o: /usr/include/sys/syslimits.h /usr/include/sys/machine/machtime.h
simone.o: /usr/include/sys/rt_limits.h /usr/include/string.h
simone.o: /usr/include/strings.h /usr/include/unistd.h
simone.o: /usr/include/sys/access.h /usr/include/fcntl.h
simone.o: /usr/include/sys/fcntl.h /usr/include/sys/mode.h
