#*******************************************************************************
# E.S.O. - VLT project
#
# "@(#) $Id: Makefile,v 1.5 2005/01/31 21:45:25 dfugate Exp $"
#
# Makefile of ........
#
# who       when        what
# --------  ----------  ----------------------------------------------
# epozna    2000-10-09  created
# eallaert  2000-10-17  adapted for Linux/Solaris, upgraded to 2.037
# epozna    2001-08-28  VLTSW20010358:added flag -D__EXTENSIONS__ on SunOS
#                       removed fortran wrapper routins (f77_wrap1 f77_wrap2)
#                       (module updated to 2.204)
# epozna    2002-03-22  VLTSW20010752 - install include files
# epozna    2002-03-25  update to 2.401

#*******************************************************************************
# This Makefile follows VLT Standards (see Makefile(5) for more).
#*******************************************************************************
# REMARKS
#    None
#------------------------------------------------------------------------

PLATFORM := $(shell uname)
#
# user definable C-compilation flags
#USER_CFLAGS = 
USER_CFLAGS := -g -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MATH_H=1 \
	-DHAVE_LIMITS_H=1 -DHAVE_FTRUNCATE=1 -DHAVE_LONGLONG=1  -DHAVE_SHMEM_SERVICES=1 \
	-DHAVE_NET_SERVICES=1
ifeq ($(PLATFORM),HP-UX)
    USER_CFLAGS += -DPG_PPU -Dappendus
endif
ifeq ($(PLATFORM),SunOS)
    USER_CFLAGS += -Dg77Fortran -DHAVE_FLOCK_T=1 -D__EXTENSIONS__
endif
ifeq ($(PLATFORM),Linux)
    USER_CFLAGS += -Dg77Fortran -D_XOPEN_SOURCE
endif
OPTIMIZE = 2

#
# additional include and library search paths
#USER_INC = 
#USER_LIB = 

# undef DEBUG
# MODULE CODE DESCRIPTION:
# ------------------------
# As a general rule:  public file are "cleaned" and "installed"  
#                     local (_L) are not "installed".

#
# C programs (public and local)
# -----------------------------
EXECUTABLES     = 
EXECUTABLES_L   = 



#
# <brief description of xxxxx program>
xxxx_OBJECTS   =
xxxx_LDFLAGS   = 
xxxx_LIBS      =

#
# special compilation flags for single c sources
#yyyyy_CFLAGS   = 

#
# Includes (.h) files (public only)
# ---------------------------------
INCLUDES        =  drvrsmem.h     f77_wrap.h     grparser.h     region.h    \
                   eval_defs.h    fitsio.h                      ricecomp.h  \
		   cfortran.h     eval_tab.h     fitsio2.h      longnam.h   \
		   compress.h     group.h        pctype.h
	           # imcompress.h does not exist in  2.401
#
# Libraries (public and local)
# ----------------------------
LIBRARIES       = cfitsio
LIBRARIES_L     = 

#
# <brief description of lllll library>
cfitsio_OBJECTS   =   buffers cfileio checksum compress drvrfile drvrmem \
		     drvrnet drvrsmem editcol edithdu eval_f eval_l eval_y  \
		     fitscore getcol getcolb getcold getcole \
		     getcoli getcolj getcolk getcoll getcols  \
		     getcolui getcoluj getcoluk getkey  grparser histo \
		     imcompress  iraffits \
		     modkey pliocomp putcol putcolb putcold putcole putcoli \
		     putcolj putcolk putcoll putcols putcolu     \
		     putcolui putcoluj putcoluk putkey quantize region ricecomp \
		     scalnull   swapproc \
		     wcssub wcsutil imcopy group 
                # not required:    f77_wrap1 f77_wrap2 cookbook windumpexts
		#                  speed iter_a iter_b iter_c 
	        #                   vmsieee fitscopy listhead smem
		# 
		# note: imcopy group compillation warning


# Scripts (public and local)
# ----------------------------
SCRIPTS         =
SCRIPTS_L       =

#
# TCL scripts (public and local)
# ------------------------------
TCL_SCRIPTS     =
TCL_SCRIPTS_L   =
 
#
# <brief description of tttttt tcl-script>
tttttt_OBJECTS  =
tttttt_TCLSH    = 
tttttt_LIBS     = 

#
# TCL libraries (public and local)
# ------------------------------
TCL_LIBRARIES   =
TCL_LIBRARIES_L =

#
# <brief description of tttlll library>
tttlll_OBJECTS  = 

#
# UIF panels (public and local)
# ----------------------------
PANELS   =
PANELS_L = 

#
# man pages to be done
# --------------------
MANSECTIONS =
MAN1 =
MAN3 =
MAN5 =
MAN7 =
MAN8 =

#
# local man pages
# ---------------
MANl =

#
# ASCII file to be converted into Framemaker-MIF
# --------------------
ASCII_TO_MIF = 

#
# INS_ROOT files to be installed
#-------------------------------
INS_ROOT_FILES =
INS_ROOT_DIR   =

#
# other files to be installed
#----------------------------
INSTALL_FILES =

#
# list of all possible C-sources (used to create automatic dependencies)
# ------------------------------
CSOURCENAMES = \
	$(foreach exe, $(EXECUTABLES) $(EXECUTABLES_L), $($(exe)_OBJECTS)) \
	$(foreach lib, $(LIBRARIES) $(LIBRARIES_L), $($(lib)_OBJECTS))

#
#>>>>> END OF standard rules

#
# CHOSE PLATFORM
# --------------
# Default is UNIX, for VxVorks application next line MUST BE UNCOMMENTED
#MAKE_VXWORKS = on   

#
# INCLUDE STANDARDS
# -----------------
MAKEDIRTMP := $(shell searchFile include/acsMakefile)
ifneq ($(MAKEDIRTMP),\#error\#)
   MAKEDIR := $(MAKEDIRTMP)/include
   include $(MAKEDIR)/acsMakefile
endif



#
# TARGETS
# -------
all:	do_all
	@echo " . . . 'all' done" 

clean : clean_all 
	@echo " . . . clean done"

man   : do_man 
	@echo " . . . man page(s) done"

install : install_all
	@echo " . . . installation done"

testprog: 

#___oOo___
