################################################################################
#
# This Makefile creates the executables "ana", "ave" and "rod" of the ANAROD
# analysis package.
#
# There is a "standard" and an "experimental" version of ANAROD. Both can be
# compiled with the same Makefile, but the macro "EXTENSIONS" should be set to
# EXTENSIONS for the "experimental" version and not be set for the "standard"
# one.
#
# The string defined in the file "version.mk" is concatenated with either
# "_standard" or "_experimental" and passed on to the compiler. It is used by
# the programs to create a version identifier.
#
# The user interface of ANAROD can operate with "ncurses" (default) or with the
# GNU "readline". If the latter is requested, the macro "READLINE" should be set
# to READLINE.
#
# This Makefile can compile ANAROD for HP-UX, SunOS, LINUX, Mac OS X and the
# CYGNUS user environment on Window-PCs (CYGWIN). The versions for the different
# operating systems are stored in different subdirectories. For details, see
# below.
#
# Targets of this Makefile are:
#
# - all               (default) to make all executables ("ana", "ave" and "rod")
# - ana               to make only "ana"
# - ave               to make only "ave"
# - rod               to make only "rod"
#
# - clean             to clean everything that was created by the Makefile
# - clean_ana         to clean only the "ana" specific parts
# - clean_ave         to clean only the "ave" specific parts
# - clean_rod         to clean only the "rod" specific parts
#
# - depend            to create a list of dependencies for the ANAROD package,
#                     using the program "makedepend"
#
####### Note: the targets mentioned below are only available at the ESRF.
#
# - dist              to make a binary distribution file. This is a g-zipped
#                     tar file with the executables "ana", "ave", "rod", and the
#                     information files (see explanation below). For CYGWIN,
#                     additionally create a "zip" archive with the same files.
# - distclean         to remove the binary distribution file
#
# - source-dist       to make a source distribution file. This is a g-zipped tar
#                     file with
#                     - all the sources for "ana", "ave" and "rod" with the
#                       exception of those of "lsqfit"
#                     - the "pgplot" libraries (for the standard version only)
#                     - the binary file for "lsqfit"
#                     - all auxiliary files needed (see explanation below)
#                     - the "Makefile" and the dummy include file for the ESRF-
#                       internal targets (file "dum_targ.mk" copied to
#                       "esrf_targ.mk" in the distribution file)
#                     - all information files (see explanation below)
#                     For CYGWIN, additionally create a "zip" archive with the
#                     same files.
# - source-distclean  to remove the source distribution file
#
# - install-sware     to install the ANAROD executables "ana", "ave" and "rod"
#                     on the ESRF computers. The installation is done into the
#                     default directory contained in the macro INSTDIR. This
#                     should be used to replace an old version of the ANAROD
#                     executables with a new one.
# - install-sware-new to install a second version of the ANAROD executables on
#                     the ESRF computers. The installation is done into the
#                     default directory contained in the macro INSTDIR, but the
#                     executables are named  "ana_new", "ave_new" and "rod_new".
#                     This could e.g. be used to make a preliminary version of
#                     the ANAROD executables available.
#
################################################################################
# Update: 07/04/2006 R. Wilcke (wilcke@esrf.fr)
#                    updated the comments on the ESRF-internal targets;
#                    add "README_MAC.txt" to the INFOFILS for MACOSX;
#                    define macro RMDIR for command "rmdir", with special option
#                    for LINUX and CYGWIN;
#                    define macro GREP for command "grep", with special path for
#                    for SUNOS to allow use of "-e" option.
# Update: 24/03/2006 R. Wilcke (wilcke@esrf.fr)
#                    get the ESRF-internal targets from the include file
#                    "esrf_targ.mk".
# Update: 23/03/2006 R. Wilcke (wilcke@esrf.fr)
#                    correct and streamline code for the source distribution
#                    target.
# Update: 20/03/2006 R. Wilcke (wilcke@esrf.fr)
#                    get the version number from the include file "version.mk";
#                    replace installation host and directory by macros INSTHOST
#                    and INSTDIR;
#                    create macro INFOFILS for the information files;
#                    use implicit pattern rules instead of static pattern rules
#                    to make the "ana", "ave" and "rod" object files from the
#                    "C" source, and add a rule for "C++" source files.
# Update: 23/02/2006 R. Wilcke (wilcke@esrf.fr)
#                    add statements for MACOSX; streamline code for binary and
#                    source distribution targets.
# Update: 27/04/2004 R. Wilcke (wilcke@esrf.fr)
#                    remove "Wall" flag from CFLAGS (too many warnings).
# Update: 25/03/2002 O. Svensson (svensson@esrf.fr)
#                    Removed cygwin1.dll from auxilary files.
# Update: 31/01/2002 C.J.Walker <walker@esrf.fr>
#                    Use $(CC) rather than call gcc explicitly
# Update: 28/11/2001 O. Svensson (svensson@esrf.fr)
#                    Fixed problem with readline for HPUX (patch from
#                    Chris Walker).
# Update: 26/11/2001 O. Svensson (svensson@esrf.fr)
#                    Updated version to 1.1
#                    Added CFLAGS += -I../standard/src/include/curses 
#                    which contains the curses.h for the SUN and HPUX versions
#                    since curses.h has been removed from src/include
# Update: 11/01/2001 O. Svensson (svensson@esrf.fr)
#                    Added new targets "source-dist" and "source-distclean".
# Update: 10/01/2001 O. Svensson (svensson@esrf.fr)
#                    Removed the creation of the library MEFIPL_LIB
#                    (libMenuFitPlot.a) and replaced it with individual
#                    object files MENU_OBJ, PLOT_OBJ and LSQ_OBJ.
# Update: 21/12/2000 O. Svensson (svensson@esrf.fr)
#                    Increased version number for standard version to 1.0.
# Update: 01/12/2000 O. Svensson (svensson@esrf.fr)
#                    Turned on optimisation (-O2), added new targets
#                    "install-sware" and "install-sware-new" which are
#                    useful for installing new versions at the ESRF,
#                    (can presently only be run by user "svensson".)
#                    Fixed "depend" target, however the output appened
#                    to the makefile cannot be used directly:
#                    * "$(DIRNAM)/src" must be changed to $(DIRNAM)
#                    * "bin/$(DIRNAM)/../standard/src/" must be changed to
#                       "../standard/bin/$(DIRNAM)/".
#                    * lsqfit/lsqfit.o must be changed to lsqfit.o
#                    * plot/PGmyplot.o must be changed to PGmyplot.o
#                    * menu/menu.tab.c must be changed to menu.tab.c
#                    Forced the compilation of ana.c, ave.c and rod.c when
#                    linking in order to have the correct compilation date 
#                    displayed by the programs.
# Update: 28/09/2000 R. Wilcke (wilcke@esrf.fr)
#                    rename (again!) target "clean_dist" to "distclean".
# Update: 27/09/2000 R. Wilcke (wilcke@esrf.fr)
#                    Make target "rod" also dependent on "$(RUN_DIR)";
#                    modify some lines (SUN specific setup, "dist" and
#                    "dist-clean" targets) to make the "experimental" and
#                    "standard" Makefile as identical as possible;
#                    added -L../standard/lib/$(DIRNAM) to GRAPHICAL_LFLAGS in
#                    order to find cpgplot.a and pgplot.a;
#                    remove target "clean_full" and change target "clean" to do
#                    what "clean_full" used to do;
#                    rename target "dist-clean" to "clean_dist".
# Update: 18/07/2000 R. Wilcke (wilcke@esrf.fr)
#                    Include the version string ("experimental-x-x" or
#                    "standard-x-x") as macro VERSION in the CFLAGS options;
#                    use the Makefile in the "standard" tree to make "ave" if
#                    there is no "ave" source code in the "experimental" tree;
#                    in the "experimental" tree, create the "runtime" directory
#                    with the corresponding subdirectory for the operating
#                    system and put the auxiliary runtime files into it;
#                    create the directory for the common object files and the
#                    one for the corresponding library if necessary.
# Update: 17/07/2000 R. Wilcke (wilcke@esrf.fr)
#                    For CYGWIN, test only for the "CYGWIN" substring in the
#                    "uname" command output (avoids dependency on version).
# Update: 12/07/2000 R. Wilcke (wilcke@esrf.fr)
#                    For LINUX: added "-static" to LFLAGS and moved "-lX11"
#                    behind "-lcpgplot" and "-lpgplot".
# Update: 11/07/2000 R. Wilcke (wilcke@esrf.fr)
#                    First working version for new directory structure.
################################################################################
#
# Get the anarod VERSION number here.
#
include version.mk

#
# Uncomment "READLINE" if the "readline" package is to be used for user I/O.
#
# READLINE = READLINE
#
# Define "EXTENSIONS" if "anarod" is to be compiled with extensions
# ("experimental" version).
#
ifeq (experimental,$(findstring experimental,$(PWD)))
EXTENSIONS = EXTENSIONS
endif

#
# Define some commands that might need customization on different systems.
#
AR = ar ru
CC = gcc
CP = cp -p
CXX = g++
GREP = grep
MAKE = gmake
RANLIB = ranlib
RM = rm -rf
RMDIR = rmdir
RSH = rsh
SHELL = /bin/sh

#
# Define where the package is to be installed.
# The values given are the default values at the ESRF. Note that INSTHOST must
# be able to write to INSTDIR (this directory is read-only on most ESRF
# computers).
#
INSTHOST = scisoft8
INSTDIR = /sware/exp/anarod

#
# There should normally not be any need to change values below this line.
#
################################################################################
#
# The VERSION number together with the version type ("standard" or
# "experimental") is passed on to the compiler with the "-D" option.
# The backslashes and quotes (\") are necessary to pass it as a string.
#
VERSION := $(notdir $(shell pwd))_$(VERSION)
CFLAGS := -O2 -DVERSION=\"$(VERSION)\" -DPGPLOT
#SDIS_NAM := anarod_src_$(VERSION)

#
# Find out the operating system, and define the names of the directories
# for the object files, libraries and executables accordingly:
# - the object files will be in   bin/$(DIRNAM)
# - the libraries will be in      lib/$(DIRNAM)
# - the executables will be in    runtime/$(DIRNAM)
#
# where $(DIRNAM) is
# - HPUX   on HP-UX systems
# - SUN    on SunOS systems
# - LINUX  on LINUX systems
# - MACOSX on MacIntoshes with OS X (Darwin)
# - CYGWIN on PCs with the Cygnus user enviromnent
#
# For the object files, the location is further subdivided:
# - object files for "ana" are in                          bin/$(DIRNAM)/ana
# - object files for "ave" are in                          bin/$(DIRNAM)/ave
# - object files for "rod" are in                          bin/$(DIRNAM)/rod
# - all other object files (e.g. from "lsqfit") are in     bin/$(DIRNAM)
#
# The names of the executables are different on CYGWIN, as they must have the
# suffix ".exe". On all other operating systems, no specific suffix is needed.
#
# The executables of the ANAROD package need additional files to work. These
# are stored in the same subdirectory as the executables. For the "experimental"
# version, it is permitted that these directories initially do not exist. In
# this case, the Makefile will automatically create them and copy the additional
# files over from the "standard" version.
#
# The auxiliary files are:
# - common (i.e., for all operating systems): grfont.dat, rgb.txt
# - for HPUX, SUN, LINUX and MACOSX, in addition to common: pgxwin_server
# - for CYGWIN, in addition to common: GrWnd.exe, directory terminfo with all
#                                      subdirectories
#
# Finally, there are files with information on how to install ANAROD, its use
# and development history. These are for:
# - all systems: INSTALL.UNIX README.txt README_SRC.txt license.txt version.mk
# - MACOSX additionally: README_MAC.txt
# - CYGWIN additionally: README_GNUWIN.txt
#
ANA := ana
AVE := ave
ROD := rod
RUN_FILS := grfont.dat rgb.txt
INFOFILS := INSTALL.UNIX README.txt README_SRC.txt license.txt version.mk

OPSYS := $(shell uname)

ifeq ($(OPSYS),HP-UX)

VERSION := $(VERSION)_hpux10-20
DIRNAM = HPUX
RSH = remsh
RUN_FILS += pgxwin_server
INCLUDE_PATH += -I../standard/src/include/curses
#
# HPUX needs the -O flag for compilation, otherwise the resulting executable
# crashes. Why???
#
CFLAGS += -O 
GRAPHICAL_LFLAGS = -lcl -lf -L../standard/lib/$(DIRNAM) -lcpgplot -lpgplot \
   -lgcc -lc -lHcurses -L/usr/lib/Motif1.2/ -lXm -L/usr/lib/X11R5 -lXt -lX11 \
   -lXhp11 -lm

else
ifeq ($(OPSYS),SunOS)

VERSION := $(VERSION)_sunos5-7
DIRNAM = SUN
GREP = /usr/xpg4/bin/grep
RUN_FILS += pgxwin_server
INCLUDE_PATH += -I../standard/src/include/curses
#
# The socket and nsl libraries are only needed if EXTENSIONS are used.
#
ifdef EXTENSIONS
LFLAGS = -lsocket -lnsl
endif
GRAPHICAL_LFLAGS = -L../standard/lib/$(DIRNAM) -lcpgplot -lpgplot -lgcc -lc \
   -lm -L/usr/lib/Motif1.2/ -lXm -L/usr/lib/X11R5 -lXt -lX11 \
   -L/opt/SUNWspro/SC5.0/lib -lF77 -lM77 -lsunmath

else
ifeq ($(OPSYS),Linux)

VERSION := $(VERSION)_linux
DIRNAM = LINUX
MAKE = make
RMDIR = rmdir --ignore-fail-on-non-empty
RUN_FILS += pgxwin_server
LFLAGS = -static
#
# "pthread" library has to be linked BEFORE "c" library, otherwise there are
# doubly and inconsistently defined routines.
#
GRAPHICAL_LFLAGS = -L../standard/lib/$(DIRNAM) -lcpgplot -lpgplot \
   -L/usr/X11R6/lib -lX11 -lg2c -lpthread -lc

else
ifeq ($(OPSYS),Darwin)

VERSION := $(VERSION)_darwin
DIRNAM = MACOSX
MAKE = make
RUN_FILS += pgxwin_server
INFOFILS += README_MAC.txt
LFLAGS = -dynamic -framework Foundation -framework AppKit
CFLAGS += -dynamic
GRAPHICAL_LFLAGS = -L../standard/lib/$(DIRNAM) -lcpgplot -lpgplot \
   -L/sw/lib -lpng -laquaterm -L/usr/X11R6/lib -lX11 -lg2c -lgcc -lc
CURSES_LFLAGS = -L/sw/lib -L/sw/lib/ncurses
               
else
ifeq ($(findstring CYGWIN,$(OPSYS)),CYGWIN)

VERSION := $(VERSION)_cygwin
DIRNAM = CYGWIN
MAKE = make
RMDIR = rmdir --ignore-fail-on-non-empty
ANA := $(ANA).exe
AVE := $(AVE).exe
ROD := $(ROD).exe
RUN_FILS += GrWnd.exe terminfo
INFOFILS += README_GNUWIN.txt
GRAPHICAL_LFLAGS = -L../standard/lib/$(DIRNAM) -lcpgplot -lpgplot -lg2c \
   -lgcc -lm -Wl,--subsystem,console -lGrWin -mwindows

else
VERSION := $(VERSION)_undefined
endif      # Cygwin
endif      # Darwin
endif      # Linux
endif      # SunOS
endif      # HP-UX
#
# The user interface can operate with the GNU "readline" library, or with the
# "ncurses" library. Define the macros for compilation and the library path
# accordingly.
#
ifdef READLINE
READLINE_CFLAGS = -DREADLINE -I/opt/readline/include -I/usr/local/include \
   -I/sw/include/readline
READLINE_LFLAGS = -L/opt/readline/lib -L/usr/local/lib -L/sw/lib \
   -lreadline -lncurses
else
READLINE_CFLAGS =
READLINE_LFLAGS =
endif

CURSES_LFLAGS += -L../standard/lib/$(DIRNAM) -lncurses

ifdef EXTENSIONS
EXTENSIONS_CFLAGS = -DEXTENSIONS
endif

INCLUDE_PATH += $(addprefix -I../standard/src/, plot menu include)

CFLAGS += -c $(INCLUDE_PATH) $(READLINE_FLAGS) $(READLINE_CFLAGS) \
   $(EXTENSIONS_CFLAGS)

LFLAGS += -lm $(READLINE_LFLAGS) $(CURSES_LFLAGS) 
#
# Determine the source file names and the corresponding object file names for
# "ana", "ave" and "rod".
#
# "ana" and "rod" are always in the same directory tree (i.e., "standard" or
# "experimental") as the Makefile. For "ave", there might or might not be an
# experimental version. If there is one, it is taken. If there is none (the
# directory "experimental/src/ave" does not contain any C-source files), then
# the version in "standard" is taken.
#
ANA_SRC_FILES := $(wildcard src/ana/*.c)
ANA_OBJECTS := $(patsubst %.c, %.o, $(notdir $(ANA_SRC_FILES)))

AVE_SRC_FILES := $(wildcard src/ave/*.c)
ifeq ($(AVE_SRC_FILES),)
AVE_DIR := ../standard
AVE_SRC_FILES := $(wildcard $(AVE_DIR)/src/ave/*.c)
else
AVE_DIR := .
endif
AVE_OBJECTS := $(patsubst %.c, %.o, $(notdir $(AVE_SRC_FILES)))

ROD_SRC_FILES := $(wildcard src/rod/*.c src/rod/*.cpp)
ROD_OBJECTS := $(addsuffix .o, $(basename $(notdir $(ROD_SRC_FILES))))

ANA_OBJ_DIR = bin/$(DIRNAM)/ana
AVE_OBJ_DIR = $(AVE_DIR)/bin/$(DIRNAM)/ave
ROD_OBJ_DIR = bin/$(DIRNAM)/rod

ANA_OBJ_FILES = $(addprefix $(ANA_OBJ_DIR)/, $(ANA_OBJECTS))
AVE_OBJ_FILES = $(addprefix $(AVE_OBJ_DIR)/, $(AVE_OBJECTS))
ROD_OBJ_FILES = $(addprefix $(ROD_OBJ_DIR)/, $(ROD_OBJECTS))
#
# Define the source file names and the corresponding object file names for the
# modules that are common for "ana", "ave" and "rod":
# - the fitting package "lsqfit"
# - the plotting package "PGmyplot"
# - the user interface "menu"
#
# "PGmyplot" and "menu" will always be in the "standard" directory tree.
#
# For "lsqfit" directory, the same rule applies as above explained for "ave".
# Also, add "lsqfit.o" to the list of "lsqfit" objects if it is not there (this
# is the case for the "source-distributed" ANAROD, see remark in target
# "source-dist").
#
PLOT_OBJ := $(addprefix ../standard/bin/$(DIRNAM)/, PGmyplot.o)
MENU_OBJ := $(addprefix ../standard/bin/$(DIRNAM)/, menu.tab.o) 

LSQ_SRC_FILES := $(wildcard src/lsqfit/*.c)
ifeq ($(LSQ_SRC_FILES),)
LSQ_DIR := ../standard
LSQ_SRC_FILES := $(wildcard $(LSQ_DIR)/src/lsqfit/*.c)
else
LSQ_DIR := .
endif
LSQ_OBJECTS := $(patsubst %.c, %.o, $(notdir $(LSQ_SRC_FILES)))
LSQ_OBJ_DIR = $(LSQ_DIR)/bin/$(DIRNAM)/lsqfit
LSQ_OBJ_FILRM := $(addprefix $(LSQ_OBJ_DIR)/, $(LSQ_OBJECTS))
LSQ_OBJECTS := $(sort lsqfit.o $(LSQ_OBJECTS))
LSQ_OBJ_FILES := $(addprefix $(LSQ_OBJ_DIR)/, $(LSQ_OBJECTS))

COMM_OBJ := $(PLOT_OBJ) $(MENU_OBJ) $(LSQ_OBJ_FILES)

#
# Define the name of the runtime directory, where the executables and the
# auxiliary files are stored.
#
# The name is "runtime/$(DIRNAM)", where DIRNAM has the same value as explained
# above.
#
RUN_DIR = runtime/$(DIRNAM)

#
# Define the names of the binary and source distribution directories.
#
BDIS_NAM := anarod_$(VERSION)
SDIS_NAM := anarod_src_$(VERSION)
SDIS_DIR := $(SDIS_NAM)/$(notdir $(shell pwd))
SRC_DIRS := $(filter-out %CVS,$(wildcard src/*))

#
# Make all executables ("ana", "ave" and "rod"). This is the default.
#
all:   ana ave rod

#
# Make each individual executable and store them in the runtime directory.
#
# "ana" and "rod" will always be in the same directory tree as the Makefile.
# "ave" will be in the "experimental" tree if an "experimental" version of the
# "ave" sources was used, otherwise the Makefile in the "standard" tree will be
# called to make "ave" there.
#
ana:   $(RUN_DIR) $(RUN_DIR)/ana

ifeq ($(AVE_DIR),../standard)
ave:
	(cd $(AVE_DIR); $(MAKE) ave)
else
ave:   $(RUN_DIR) $(RUN_DIR)/ave
endif

rod:   $(RUN_DIR) $(RUN_DIR)/rod

$(RUN_DIR)/ana: $(ANA_OBJ_DIR) $(ANA_OBJ_FILES) $(COMM_OBJ)
	$(CC) -o $@ $(ANA_OBJ_FILES) $(COMM_OBJ) $(LFLAGS) $(GRAPHICAL_LFLAGS)

$(RUN_DIR)/ave: $(AVE_OBJ_DIR) $(AVE_OBJ_FILES) $(MENU_OBJ)
	$(CC) -o $@ $(AVE_OBJ_FILES) $(MENU_OBJ) $(LFLAGS) 

$(RUN_DIR)/rod: $(ROD_OBJ_DIR) $(ROD_OBJ_FILES) $(COMM_OBJ)
	$(CXX) -o $@ $(ROD_OBJ_FILES) $(COMM_OBJ) $(LFLAGS) $(GRAPHICAL_LFLAGS)

#
# Make the runtime file directory if it does not yet exist (this is only
# allowed for the "experimental" tree), and copy the auxiliary files that
# are needed for ANAROD from the standard tree to the experimental one.
#
$(RUN_DIR):
	mkdir -p $(RUN_DIR)
	(cd ../standard/$(RUN_DIR); $(CP) -R $(RUN_FILS) $(PWD)/$(RUN_DIR)) 

#
# Make the object file directories if they do not yet exist.
#
$(ANA_OBJ_DIR) $(AVE_OBJ_DIR) $(ROD_OBJ_DIR):
	mkdir -p $@

#
# Make the required object files for "ana", "ave" and "rod" from either their
# "C" (suffix ".c") or their "C++" (suffix ".cpp") source files.
#
bin/$(DIRNAM)/%.o: src/%.c ../standard/src/menu/menu.h
	$(CC) $(CFLAGS) $< -o $@

bin/$(DIRNAM)/%.o: src/%.cpp ../standard/src/menu/menu.h
	$(CXX) $(CFLAGS) $< -o $@

#
# Make the required common object files, and create the required directory for
# the object files if necessary. For "menu", also make the "C" file from the
# "yacc" input file. 
#
$(LSQ_OBJ_FILRM): $(LSQ_DIR)/bin/$(DIRNAM)/%.o : $(LSQ_DIR)/src/%.c
	mkdir -p $(LSQ_OBJ_DIR)
	$(CC) $(CFLAGS) $< -o $@

$(PLOT_OBJ):	../standard/src/plot/PGmyplot.c
	mkdir -p ../standard/bin/$(DIRNAM)
	$(CC) $(CFLAGS) $< -o $@

$(MENU_OBJ):	../standard/src/menu/menu.tab.c
	mkdir -p ../standard/bin/$(DIRNAM)
	$(CC) $(CFLAGS) $< -o $@

../standard/src/menu/menu.tab.c:	../standard/src/menu/menu.y
	bison -o $@ $<;

#
# Clean up all files that can be made by "make". Several variations exist:
# - target "clean_ana" cleans only the "ana" specific files
# - target "clean_ave" cleans only the "ave" specific files
# - target "clean_rod" cleans only the "rod" specific files
# - target "clean" cleans all the files created by the Makefile (including the
#   common files and the corresponding library). Note, however, that "lsqfit.o"
#   will be kept if there is no "lsqfit.c".
# 
clean: clean_ana clean_ave clean_rod
	$(RM) $(PLOT_OBJ) $(MENU_OBJ) $(LSQ_OBJ_FILRM) \
	   ../standard/src/menu/menu.tab.c

clean_ana:
	$(RM) $(ANA_OBJ_FILES) $(RUN_DIR)/$(ANA)

clean_ave:
	$(RM) $(AVE_OBJ_FILES) $(AVE_DIR)/$(RUN_DIR)/$(AVE)

clean_rod:
	$(RM) $(ROD_OBJ_FILES) $(RUN_DIR)/$(ROD)

#
# Get the ESRF-internal targets.
#
# Note: for a source distribution, this file will be replaced by a dummy.
#
include esrf_targ.mk

#
# make depend: The output appened to the makefile cannot be used directly:
#   * "$(DIRNAM)/src" must be changed to $(DIRNAM)
#   * "bin/$(DIRNAM)/../standard/src/" must be changed to
#     "../standard/bin/$(DIRNAM)/".
#   * lsqfit/lsqfit.o must be changed to lsqfit.o
#   * plot/PGmyplot.o must be changed to PGmyplot.o
#   * menu/menu.tab.c must be changed to menu.tab.c
#
depend:
	makedepend -p "bin/\$$(DIRNAM)/" -Y -- $(CFLAGS) $(READLINE_FLAGS) \
	   $(INCLUDE_PATH) $(ANA_SRC_FILES) $(AVE_SRC_FILES) $(ROD_SRC_FILES) \
	   $(LSQ_SRC_FILES) ../standard/src/plot/PGmyplot.c \
	   ../standard/src/menu/menu.tab.c

# DO NOT DELETE THIS LINE - makedepend depends on it.
