#
#
#*********************************************************************
#
# File:         Makefile
#
# Project:      Device Servers with sun-rpc
#
# Description:  Makefile for the graphical application xdevmenu
#		(note: this Makefile has only been tested on Linux so far)
#
# Author(s):     Andy Gotz
#
# Original:      October 1999
#
#
# Copyleft (c) 1999 by European Synchrotron Radiation Facility,
#                      Grenoble, France
#
#                      All Rights Reserved
#
#**********************************************************************

#---------------------------------------------------------------------
# Home Directories
#
#
#       The variables DSHOME is passed to the Makefile
#       as input argument or via the environment.
#
# external variable DSHOME
DS_HOME =       $(DSHOME)

ifdef linux
LIB_HOME     =  $(DS_HOME)/lib/linux/x86
INSTALL_HOME =  $(DS_HOME)/system/bin/linux/x86
MOTIF_HOME   =  /usr/local/Lesstif/Motif1.2
X11_HOME     =  /usr/X11R6
endif


#---------------------------------------------------------------------
# All necessary compiler flags 
#

INCLDIRS =      -I$(DS_HOME)/include \
		-I$(MOTIF_HOME)/include \
		-I$(X11_HOME)/include

#                       Libraries
LIBDIRS =       -L$(LIB_HOME) \
		-L$(MOTIF_HOME)/lib \
		-L$(X11_HOME)/lib
ifdef linux
LFLAGS = 	$(LIBDIRS) -lascapi -ltcapi \
		-ldsapi -ldbapi -ldsxdr \
		-lXm -lXt -lX11 -lm -ldl
endif # linux

ifdef linux
CFLAGS = 	-DEBUG -Dlinux $(INCLDIRS) -c
endif

#---------------------------------------------------------------------
# All Files needed for the Server and the client
#
#               all include files
INCL     =	xdev_const.h xdev_gui.h xdev_dev.h

#               source files
SRC	 =	xdev_bxutil.c \
		xdev_creation.c \
		xdev_main.c \
		xdev_cb.c \
		xdev_gui.c \
		xdev_dev.c 

#               object files
OBJS =		xdev_bxutil.o \
		xdev_creation.o \
		xdev_main.o \
		xdev_cb.o \
		xdev_gui.o \
		xdev_dev.o


#---------------------------------------------------------------------
# What has to be made
#
#		Names of executables in the home directory
APPLI	 = 	xdevmenu

#---------------------------------------------------------------------
# build appli
#

all:		$(APPLI)

$(APPLI):  	$(OBJS) 
		$(CC) -o $(APPLI) $(OBJS) $(LFLAGS)

clean:	
		-rm -f $(OBJS)


clobber:	clean
		-rm -f $(APPLI)

#
#
