##################################################################
##
## Starfield Generator Makefile
##
## $Id: Makefile,v 1.5 2004-10-04 11:25:01 moralejo Exp $
##   
##################################################################

# @T \newpage

# Linux

INCLUDE = ../include-GENERAL
INCLUDE_COR   = ../include-CORSIKA

CXX      = g++


INCLUDES = -I${INCLUDE} \
	   -I${INCLUDE_COR} \
	   -I${ROOTSYS}/include

WARNINGS = -Wall

CXXFLAGS =  ${WARNINGS} ${INCLUDES}

ROOTLIBS =  `root-config --libs`
LIBS     = -L${RANLIBDIR} -L/usr/local/lib -L/usr/lib -lm ${ROOTLIBS}


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

.SILENT:

.SUFFIXES: .cxx .o 

SRCS =	starfield.cxx\
	star.cxx\
	photon.cxx\
	convertcorsika.cxx\
	rand_un_gen.cxx\
	parameters.cxx\
	${INCLUDE_COR}/COREventHeader.cxx\
	${INCLUDE_COR}/CORParticle.cxx\
	${INCLUDE_COR}/CORStatfile.cxx

HEADERS = starfield.h\
	star.hxx\
	photon.hxx\
	convertcorsika.h\
	parameters.h\
	COREventHeader.hxx\
	CORParticle.hxx\
	CORStatfile.hxx\
	DllImport.h\
	RConfig.h\
	Rtypes.h\
	ranlib.h

OBJS = starfield.o\
	star.o\
	photon.o\
	convertcorsika.o\
	rand_un_gen.o\
	parameters.o\
	${INCLUDE_COR}/COREventHeader.o\
	${INCLUDE_COR}/CORParticle.o\
	${INCLUDE_COR}/CORStatfile.o

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

all: starfield

#If you type 'make depend' this will update the dependencies listed below

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

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

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

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

clean:
	@echo "Cleaning..."
	@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 . . ."
	@/usr/local/bin/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.
