##################################################################
##
## Starfield Generator Makefile
##
## $Id: Makefile.osf,v 1.2 2004-09-17 17:36:25 moralejo Exp $
##   
##################################################################

# @T \newpage

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

CXX      = cxx

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

WARNINGS = -Wall

CXXFLAGS =  ${WARNINGS} ${INCLUDES}

LIBS     = -L${ROOTSYS}/lib -L/usr/local/lib -L/usr/lib  -lm 


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

.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.
