########################################################################
# 
#    	MAKEFILE FOR STAND-ALONE UX CODE APPLICATION.
#
#       EXECUTABLE      is the name of the executable to be created 
#       MAIN            is the .o file containing your main() function
#       INTERFACES      is a list of the generated C code files 
#       APP_OBJS        is a (possibly empty) list of the object code
#                       files that form the non-interface portion of
#                       your application 
#
#       In the first three statements, the variables on the right 
#	of the equal sign will be replaced with their corresponding 
#       values when the makefile is automatically generated. 
#
#  	$Date: 2005-11-16 14:21:04 $ 		$Revision: 1.2 $
# 
# 051111        last modif
#########################################################################



include ../../../local/default.mk

# On HP-UX the optimizer -O causes a compilation error for ApplicWindow.o
# Local dataflow: Out of memory
C_OPT =


MAIN		= Template.o
INTERFACES	= 	ApplicWindow.o \
	file_list.o \
	Helpwindow.o 

EXECUTABLE	= ../../exec/display.exe




APPL_OBJS	=
UX_DIR		= ../../GraphLib/libsrc/$(UIMX)

LINC		= ../../incl

UX_LIBPATH	= -L../../lib

X_CFLAGS	=
MOTIF_CFLAGS	=

CFLAGS		+= $(C_OPT) $(DEBUG) $(GUI_OPT) \
		  -I$(LINC) -I$(INC) -I$(UX_DIR)/include \
		  $(X_CFLAGS) $(MOTIF_CFLAGS) -DXOPEN_CATALOG \
		  $(XMINC)    $(X11INC)

# The following object files are provided to work around a motif bug.
# They are not necessarily needed to compile your application.
LIBPATH		= $(X11_LIBPATH) $(MOTIF_LIBPATH)
XLIB		= $(LIBPATH) $(X_LIBS) $(XOPEN_LIBS)

LLIB		= $(UX_LIBPATH) -luimx -lcom -L$(LIBDIR) -lxcon -lmidas  
LIBS		= $(LIBDIR)/libxcon.a  \
		  $(LIBDIR)/libmidas.a

OBJS = $(MAIN) $(INTERFACES) $(APPL_OBJS)  

all: $(EXECUTABLE) 

$(EXECUTABLE): $(OBJS) $(LIBS)
	$(LDCC) $(OBJS) $(LLIB) $(XLIB) $(MLIB) $(SLIB) -o $(EXECUTABLE)
	$(STRIP) $(EXECUTABLE)
	@echo "done"

clean:
	$(RM) $(OBJS)

clean_exec:
	$(RM) $(EXECUTABLE)


tmp_makefile: makefile
	sed -e 's/^MAIN.*//' \
	    -e 's/^INTERFACES.*//' \
	    -e 's/^CMAIN/MAIN/' \
	    -e 's/^CINTERFACES/INTERFACES/' \
	    -e 's/\([^^]\)\.o/\1\.o/g'  \
	    -e 's/^all: tmp_makefile/all:/' makefile > tmp_makefile
	rm -f makefile
	mv tmp_makefile makefile






