package Dy

use Fd    v4r12
use Xform v0r9999p1
use root  v3r10p2

tag OSF1_lib OSF1 VEGA
tag Linux-i686_lib Linux VEGA
tag Linux-i686-rh9_lib Linux VEGA


setup_script set_alias

# The includes
include_dirs $(DYROOT)/src $(DYROOT)/src/mysiesta $(DYROOT)/src/xform \
             $(DYROOT)/src/userfct $(ROOTROOT)/root/include 

private
macro constituents "dyincpath VViewerSelectorDict UserFctDict VDyPlotDict URZoomSeveralDict Wrapper_checkDict Dy dataDisplay" \
  VEGA "dyincpath VViewerSelectorDict UserFctDict VDyPlotDict URZoomSeveralDict Wrapper_checkDict DataDisplay"

# A special compilation macro for the vega version
macro lib_DataDisplay_cppflags "-DUSE_VEGA -DNOCM"
macro lib_DataDisplay_cflags " " \
	OSF1	"-pthread -DUSE_VEGA -DNOCM" \
	Linux	"-DUSE_VEGA -DNOCM"

macro DataDisplaylinkopts " "\
	OSF1	"-lmach -lrt -pthread -shared -Wl,-expect_unresolved,*,-soname,"

macro c_silent ""
macro lib_silent ""
macro link_silent ""

# For finding M_PI, we must not be in ANSI mode on Linux
# To remove the "-ansi -pedantic" option
macro_remove cflags "" \
  alpha   "-ansi -pedantic" \
  RIO806X "-ansi -pedantic" \
  Linux   "-ansi -pedantic"

# The link libraries
# For root

macro cflags "" \
	Linux " -fPIC "

macro_prepend RPATH "" OSF1  "$(DYROOT)/$(Dy_tag):"

macro+ Dy_linkopts "-L$(DYROOT)/$(Dy_tag) -lDy -L$(FDROOT)/$(tag) -lFd -L$(ROOTLIBPATH) \
  -lCore -lCint -lHist -lGraf -lGraf3d -lMatrix -lGpad -lPostscript -lGui "
# For finding the shared libraries
macro+ Dy_linkopts "" \
  OSF1  "-Wl,-rpath,$(RPATH) " \
  Linux "-Wl,-rpath,$(DYROOT)/$(Dy_tag) "


# The compilation options (we trick them a bit because of C++ style comments)
macro_append cflags    "" OSF1 " -O3 -arch ev5 -nostdnew "  Linux-i686-rh9 " "  Linux-i686 " "


# The default rootcint flag and the specific flag for URZoomSeveralDict
macro rootcint_flags " -p -D__cplusplus "
macro URZoomSeveralDict_rootcint_flags "-D__CINT__"

make_fragment DyIncpath -header=DyIncpath_header \
  -trailer=DyIncpath_trailer

# The rootcint constructions
document rootcint VViewerSelectorDict -s=mysiesta VViewerSelector.h \
   VViewerSelectorCint.h VViewerSelector_LinkDef.h 
document rootcint VDyPlotDict -s=mysiesta VDyPlot.h
document rootcint URZoomSeveralDict -s=mysiesta URZoomSeveral.cc \
  URZoomSeveral_LinkDef.h
document rootcint Wrapper_checkDict Wrapper_fl_check_forms.cc    \
  Wrapper_LinkDef.h
document rootcint UserFctDict -s=userfct AddVect.C DivVect.C \
  HighPassFilter.C Integrator.C LowPassFilter.C MultVect.C SubVect.C \
  AddVect.h DivVect.h HighPassFilter.h Integrator.h LowPassFilter.h MultVect.h SubVect.h \
  UserFct_LinkDef.h 

# A special macro to get around a problem with threads on Linux
macro+ otherSources "" \
  OSF1 "-s=../src jmThread.c"\
  Linux " -s=../src jmThread.c"

document DyIncpath dyincpath configTemplate=../src/dyincpath.in



public

library Dy LINKMACRO=$(cpplink) -no_prototypes  \
  DyUtil.c DyXform.c DyVar.c DyCm.c DyDd.c DyConfig.c DyDump.c DyFiles.c            \
  DyHelp.c DyPlot.c DyVisu.c fselector.c DyXformUser.c          \
  -s=mysiesta UArrayL.c UFrameL.c UJobL.c UMathL.c URPlot.c USignalL.c  \
  URootAccess.cc URootProcess.cc VDyPlot.cc VViewerSelector.cc VViewerSelectorCint.cc \
  $(otherSources)                                                          \
  -s=../$(Dy_tag) VDyPlotDict.cc URZoomSeveralDict.cc Wrapper_checkDict.cc \
  VViewerSelectorDict.cc UserFctDict.cc \
  -s=xform cmservers.c dumpdata.c getdd.c inputfile.c mainbrowser.c        \
  plot1d.c mainpanel.c plot2d.c plotaudio.c plotgenepar.c plotfft.c        \
  plotffttime.c plot1dtime.c plotrawtime.c plottrfct.c plottime.c userfuncbrowser.c plotraw.c

# The application
application dataDisplay LINKMACRO=$(cpplink) -no_prototypes dataDisplay.c

library DataDisplay LINKMACRO=$(cpplink) -no_prototypes dataDisplay.c  \
  DyUtil.c DyXform.c DyVar.c DyCm.c DyDd.c DyConfig.c DyDump.c DyFiles.c            \
  DyHelp.c DyPlot.c DyVisu.c fselector.c DyXformUser.c          \
  -s=mysiesta UArrayL.c UFrameL.c UJobL.c UMathL.c URPlot.c USignalL.c  \
  URootAccess.cc URootProcess.cc VDyPlot.cc VViewerSelector.cc VViewerSelectorCint.cc \
  $(otherSources)                                                          \
  -s=../$(Dy_tag) VDyPlotDict.cc URZoomSeveralDict.cc Wrapper_checkDict.cc \
  VViewerSelectorDict.cc UserFctDict.cc \
  -s=xform cmservers.c dumpdata.c getdd.c inputfile.c mainbrowser.c        \
  plot1d.c mainpanel.c plot2d.c plotaudio.c plotgenepar.c plotfft.c        \
  plotffttime.c plot1dtime.c plotrawtime.c plottrfct.c plottime.c userfuncbrowser.c plotraw.c \
  -s=shm_nocm FdShm.c
