# Makefile
#
# Makefile for MenuBar example of tooltips system.
#
# Copyright (C) 1996  Michael Chu
# This file is part of the examples for the tooltips system for XForms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Contact information:      Michael Chu
#                           mmchu@CS.Berkeley.EDU

# Define where the XForms include files are.
XFORMS_INCLUDE_DIR = /usr/local/xforms/FORMS

# Define where the XForms library files are.
XFORMS_LIBRARY_DIR = /usr/local/xforms/FORMS

# Define where the tooltips include files are.
TOOLTIPS_INCLUDE_DIR = ../..

# Define other include directories for files.
OTHER_INCLUDE_DIR = /usr/include

# Define where the tooltips library files are.
TOOLTIPS_LIBRARY_DIR = ../..

# Define where the X11 library files are.
X_LIBRARY_DIR = /usr/X11/lib

# Comment out this line if you do not want debug information included.
DEBUG = -g -Wall -ansi -pedantic
# DEBUG = 

# Define the utilities to use for compilation.
CC        = gcc
CCOPTS    = $(DEBUG) -I$(XFORMS_INCLUDE_DIR) -I$(TOOLTIPS_INCLUDE_DIR) \
            -I$(OTHER_INCLUDE_DIR) \
            -L$(XFORMS_LIBRARY_DIR) -L$(TOOLTIPS_LIBRARY_DIR) -L$(X_LIBRARY_DIR)
RM        = rm
RMOPTS    = -rf
ECHO      = echo
ECHOOPTS  =

###########################################################################
all: menu

menu: menu.o menu_forms.o
	@$(ECHO) $(ECHOOPTS) Linking menu from components...
	@$(CC) $(CCOPTS) -o menu menu.o menu_forms.o -ltooltips -lforms \
	   -lX11 -lm

menu.o: menu.c menu_forms.h
	@$(ECHO) $(ECHOOPTS) Compiling menu.o from menu.c...
	@$(CC) $(CCOPTS) -c menu.c

menu_forms.o: menu_forms.c menu_forms.h
	@$(ECHO) $(ECHOOPTS) Compiling menu_forms.o from menu_forms.c...
	@$(CC) $(CCOPTS) -c menu_forms.c

clean:
	@$(ECHO) $(ECHOOPTS) Removing all old object files and executable...
	@$(RM) $(RMOPTS) *~ *.o menu

