# Makefile for vuGui and all the related wxUtilities and wxUIElements
#
# It builds the libraries vuwxUIElements and vuwxUtilities and finally
# compiles the program vuGui.
#

#------------------------------------------------------------------------
# building libs vuwxUIElements and vuwxUtilities

srcdir = ..
include $(MAKEBUNDLE)/pre.make
include $(srcdir)/vuGui/makewx.env

SUBDIRS = wxUIElements \
          wxUtilities

include $(MAKEBUNDLE)/subdir.make

#------------------------------------------------------------------------
# building the executable vuGui

TOOL_NAME = vuGui

ifeq ($(OS),WINDOWS)
all: wxrc.o
else
all:
endif

vuGui_SOURCES = vuGui.cpp            \
                vuMainWindow.cpp     \
                vuPreviewWin.cpp     \
                vuUtilityFactory.cpp

INCLS    += $(WXINCLS) -I$(srcdir)/vuGui
CPPFLAGS += $(WXFLAGS) -DWXUSINGDLL
LIB_DIR  += $(WXLIB_DIR)
#LIBS     := $(WXLIBS) $(WXLIBFLAGS) $(LIBS)
LIBS     := $(LIBS)
LIBS	 += \
	    -lvuwxUtilities         \
            -lvuwxUIElements        \
            -lvuVolume              \
            -lvuGeneral             \
	    -lpaint                 \
	    $(WXLIBS)		    \
#            $(GLLIBS) \
            -lmpatrol               \
	    -lbfd                   \
	    -limagehlp              \

ifeq ($(OS),IRIX)
  LIBS += -lfftw
else
  LIBS += -lsfftw
endif

ifeq ($(DO_SPECTRAL),YES)
  LIBS += -lcoool  \
          -lla
endif

LIBS += $(GLLIBS)

include $(MAKEBUNDLE)/tool.make

#If compiling under windows, the wxrc.rc file is needed
ifeq ($(OS),WINDOWS)
  #vuGui_SOURCES += wxrc.o
endif

wxrc.o: $(WXDIR)/include/wx/msw/wx.rc
	windres --include-dir $(WXDIR)/include/wx/msw --include-dir $(WXDIR)/include --define __WIN32__ --define __GNUWIN32__ -o wxrc.o $(WXRCDIR)/include/wx/msw/wx.rc
