##################################################################
#
# 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.5 $
# $Author: harald $ 
# $Date: 2000-07-25 13:48:09 $
#
##################################################################
# @maintitle

# @code

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

# @endcode

# @code 

# common flags
INCLUDES = -I${INCLUDE}      \
	   -I${INCLUDE_COR}  \
	   -I${INCLUDE_MC}   \
	   -I${INCLUDE_REFL} \
           -I/usr/include  -I/usr/include/cxx

#CERNLIBDIR = ${CERNDIR}/pro/lib/
#CERNLIB = -L${CERNLIBDIR} -lgraflib -lgrafX11 -lpacklib -lkernlib -lpawlib

RANLIB  = -L${RANLIBDIR} -lranlib

# special flags

osf_FORLIBS = -L/usr/lib -lUfor -lFutil -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} ${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 \
	${INCLUDE_MC}/MCEventHeader.cxx \
	${INCLUDE_MC}/MCCphoton.cxx \
	atm.cxx \
	attenu.f \
	readparam.cxx \
	reflector.cxx      

HEADERS = \
	COREventHeader.hxx \
	CORParticle.hxx \
	CORStatfile.hxx \
	MCEventHeader.hxx \
	MCCphoton.hxx \
	lagrange.h \
	atm.h \
	readparam.h \
	reflector.h

OBJS = \
	${INCLUDE_COR}/COREventHeader.o \
	${INCLUDE_COR}/CORParticle.o \
	${INCLUDE_COR}/CORStatfile.o \
	${INCLUDE_MC}/MCEventHeader.o \
	${INCLUDE_MC}/MCCphoton.o \
	atm.o \
	attenu.o \
	readparam.o \
	reflector.o

PROGRAM=reflector

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

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.

../include-CORSIKA/COREventHeader.o: ../include-CORSIKA/COREventHeader.hxx
../include-CORSIKA/COREventHeader.o: /usr/include/stdlib.h
../include-CORSIKA/COREventHeader.o: /usr/include/standards.h
../include-CORSIKA/COREventHeader.o: /usr/include/getopt.h
../include-CORSIKA/COREventHeader.o: /usr/include/sys/types.h
../include-CORSIKA/COREventHeader.o: /usr/include/mach/machine/vm_types.h
../include-CORSIKA/COREventHeader.o: /usr/include/sys/select.h
../include-CORSIKA/COREventHeader.o: /usr/include/math.h
../include-CORSIKA/CORParticle.o: ../include-CORSIKA/CORParticle.hxx
../include-CORSIKA/CORParticle.o: /usr/include/stdlib.h
../include-CORSIKA/CORParticle.o: /usr/include/standards.h
../include-CORSIKA/CORParticle.o: /usr/include/getopt.h
../include-CORSIKA/CORParticle.o: /usr/include/sys/types.h
../include-CORSIKA/CORParticle.o: /usr/include/mach/machine/vm_types.h
../include-CORSIKA/CORParticle.o: /usr/include/sys/select.h
../include-CORSIKA/CORParticle.o: /usr/include/math.h
../include-CORSIKA/CORStatfile.o: ../include-CORSIKA/CORStatfile.hxx
../include-CORSIKA/CORStatfile.o: /usr/include/stdlib.h
../include-CORSIKA/CORStatfile.o: /usr/include/standards.h
../include-CORSIKA/CORStatfile.o: /usr/include/getopt.h
../include-CORSIKA/CORStatfile.o: /usr/include/sys/types.h
../include-CORSIKA/CORStatfile.o: /usr/include/mach/machine/vm_types.h
../include-CORSIKA/CORStatfile.o: /usr/include/sys/select.h
../include-CORSIKA/CORStatfile.o: /usr/include/math.h
../include-MC/MCEventHeader.o: ../include-MC/MCEventHeader.hxx
../include-MC/MCEventHeader.o: /usr/include/stdlib.h /usr/include/standards.h
../include-MC/MCEventHeader.o: /usr/include/getopt.h /usr/include/sys/types.h
../include-MC/MCEventHeader.o: /usr/include/mach/machine/vm_types.h
../include-MC/MCEventHeader.o: /usr/include/sys/select.h /usr/include/math.h
../include-MC/MCEventHeader.o: ../include-CORSIKA/COREventHeader.hxx
../include-MC/MCCphoton.o: ../include-MC/MCCphoton.hxx /usr/include/stdlib.h
../include-MC/MCCphoton.o: /usr/include/standards.h /usr/include/getopt.h
../include-MC/MCCphoton.o: /usr/include/sys/types.h
../include-MC/MCCphoton.o: /usr/include/mach/machine/vm_types.h
../include-MC/MCCphoton.o: /usr/include/sys/select.h /usr/include/string.h
../include-MC/MCCphoton.o: /usr/include/strings.h /usr/include/math.h
atm.o: atm.h /usr/include/stdlib.h /usr/include/standards.h
atm.o: /usr/include/getopt.h /usr/include/sys/types.h
atm.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
atm.o: /usr/include/stdio.h /usr/include/sys/seek.h /usr/include/va_list.h
atm.o: /usr/include/sys/limits.h /usr/include/sys/machine/machlimits.h
atm.o: /usr/include/sys/syslimits.h /usr/include/sys/machine/machtime.h
atm.o: /usr/include/sys/rt_limits.h /usr/include/string.h
atm.o: /usr/include/strings.h /usr/include/math.h reflector-v.h
readparam.o: readparam.h /usr/include/stdlib.h /usr/include/standards.h
readparam.o: /usr/include/getopt.h /usr/include/sys/types.h
readparam.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
readparam.o: /usr/include/stdio.h /usr/include/sys/seek.h
readparam.o: /usr/include/va_list.h /usr/include/sys/limits.h
readparam.o: /usr/include/sys/machine/machlimits.h
readparam.o: /usr/include/sys/syslimits.h /usr/include/sys/machine/machtime.h
readparam.o: /usr/include/sys/rt_limits.h /usr/include/string.h
readparam.o: /usr/include/strings.h /usr/include/math.h /usr/include/float.h
readparam.o: /usr/include/fp_class.h /usr/include/unistd.h
readparam.o: /usr/include/sys/access.h reflector-v.h atm.h
reflector.o: reflector.h /usr/include/stdlib.h /usr/include/standards.h
reflector.o: /usr/include/getopt.h /usr/include/sys/types.h
reflector.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
reflector.o: /usr/include/stdio.h /usr/include/sys/seek.h
reflector.o: /usr/include/va_list.h /usr/include/sys/limits.h
reflector.o: /usr/include/sys/machine/machlimits.h
reflector.o: /usr/include/sys/syslimits.h /usr/include/sys/machine/machtime.h
reflector.o: /usr/include/sys/rt_limits.h /usr/include/string.h
reflector.o: /usr/include/strings.h /usr/include/stdarg.h /usr/include/math.h
reflector.o: /usr/include/dirent.h /usr/include/unistd.h
reflector.o: /usr/include/sys/access.h reflector-v.h readparam.h
reflector.o: /usr/include/float.h /usr/include/fp_class.h atm.h
reflector.o: ../include-CORSIKA/COREventHeader.hxx
reflector.o: ../include-CORSIKA/CORParticle.hxx
reflector.o: ../include-CORSIKA/CORStatfile.hxx
reflector.o: ../include-MC/MCEventHeader.hxx ../include-MC/MCCphoton.hxx
reflector.o: /usr/include/ranlib.h /usr/include/ar.h
