##################################################################
#
# 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: domingo $ 
# $Date: 2001-05-16 12:02:20 $
#
##################################################################
# @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}/CORRunHeader.cxx \
	${INCLUDE_COR}/CORRunEnd.cxx \
	${INCLUDE_COR}/COREventHeader.cxx \
	${INCLUDE_COR}/COREventEnd.cxx \
	${INCLUDE_COR}/CORParticle.cxx \
	maxisingle.cxx      

HEADERS = \
	${INCLUDE_COR}/CORRunHeader.hxx \
 	${INCLUDE_COR}/CORRunEnd.hxx \
	${INCLUDE_COR}/COREventHeader.hxx \
	${INCLUDE_COR}/COREventEnd.hxx \
	${INCLUDE_COR}/CORParticle.hxx \
	maxisingle.hxx

OBJS = \
	${INCLUDE_COR}/CORRunHeader.o \
        ${INCLUDE_COR}/CORRunEnd.o \
	${INCLUDE_COR}/COREventHeader.o \
	${INCLUDE_COR}/COREventEnd.o \
	${INCLUDE_COR}/CORParticle.o \
	maxisingle.o     

PROGRAM=maxisingle

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

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/CORRunHeader.o: ../../Detector/include-CORSIKA/CORRunHeader.hxx
../../Detector/include-CORSIKA/CORRunHeader.o: /usr/include/stdlib.h
../../Detector/include-CORSIKA/CORRunHeader.o: /usr/include/standards.h
../../Detector/include-CORSIKA/CORRunHeader.o: /usr/include/getopt.h
../../Detector/include-CORSIKA/CORRunHeader.o: /usr/include/sys/types.h
../../Detector/include-CORSIKA/CORRunHeader.o: /usr/include/mach/machine/vm_types.h
../../Detector/include-CORSIKA/CORRunHeader.o: /usr/include/sys/select.h
../../Detector/include-CORSIKA/CORRunHeader.o: /usr/include/math.h
../../Detector/include-CORSIKA/CORRunHeader.o: ../../Detector/include-CORSIKA/COREventHeader.hxx
../../Detector/include-CORSIKA/CORRunEnd.o: ../../Detector/include-CORSIKA/CORRunEnd.hxx
../../Detector/include-CORSIKA/CORRunEnd.o: /usr/include/stdlib.h
../../Detector/include-CORSIKA/CORRunEnd.o: /usr/include/standards.h
../../Detector/include-CORSIKA/CORRunEnd.o: /usr/include/getopt.h
../../Detector/include-CORSIKA/CORRunEnd.o: /usr/include/sys/types.h
../../Detector/include-CORSIKA/CORRunEnd.o: /usr/include/mach/machine/vm_types.h
../../Detector/include-CORSIKA/CORRunEnd.o: /usr/include/sys/select.h
../../Detector/include-CORSIKA/CORRunEnd.o: /usr/include/math.h
../../Detector/include-CORSIKA/CORRunEnd.o: ../../Detector/include-CORSIKA/COREventHeader.hxx
../../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/COREventEnd.o: ../../Detector/include-CORSIKA/COREventEnd.hxx
../../Detector/include-CORSIKA/COREventEnd.o: /usr/include/stdlib.h
../../Detector/include-CORSIKA/COREventEnd.o: /usr/include/standards.h
../../Detector/include-CORSIKA/COREventEnd.o: /usr/include/getopt.h
../../Detector/include-CORSIKA/COREventEnd.o: /usr/include/sys/types.h
../../Detector/include-CORSIKA/COREventEnd.o: /usr/include/mach/machine/vm_types.h
../../Detector/include-CORSIKA/COREventEnd.o: /usr/include/sys/select.h
../../Detector/include-CORSIKA/COREventEnd.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
maxisingle.o: /usr/include/stdlib.h /usr/include/standards.h
maxisingle.o: /usr/include/getopt.h /usr/include/sys/types.h
maxisingle.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
maxisingle.o: /usr/include/stdio.h /usr/include/sys/seek.h
maxisingle.o: /usr/include/va_list.h /usr/include/sys/limits.h
maxisingle.o: /usr/include/sys/machine/machlimits.h
maxisingle.o: /usr/include/sys/syslimits.h
maxisingle.o: /usr/include/sys/machine/machtime.h
maxisingle.o: /usr/include/sys/rt_limits.h
maxisingle.o: ../../Detector/include-CORSIKA/COREventHeader.hxx
maxisingle.o: /usr/include/math.h
maxisingle.o: ../../Detector/include-CORSIKA/COREventEnd.hxx
maxisingle.o: ../../Detector/include-CORSIKA/CORParticle.hxx
maxisingle.o: ../../Detector/include-CORSIKA/CORRunHeader.hxx
maxisingle.o: ../../Detector/include-CORSIKA/CORRunEnd.hxx
