#
# "$Id: Makefile,v 1.49 2005/01/25 20:11:22 matthiaswm Exp $"
#
# FLUID makefile for the Fast Light Tool Kit (FLTK).
#
# Copyright 1998-2003 by Bill Spitzak and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
#
# Please report all bugs and problems to "fltk-bugs@fltk.org".
#

#
# Include common definitions...
#

include ../makeinclude


#
# Files for this directory...
#

CPPFILES = \
	about_panel.cxx \
	alignment_panel.cxx \
	code.cxx \
	coding_style.cxx \
	coding_style_func.cxx \
	factory.cxx \
	file.cxx \
	Fl_Function_Type.cxx \
	Fl_Group_Type.cxx \
	Fl_Menu_Type.cxx \
	Fl_Type.cxx \
	fluid.cxx \
	Fluid_Image.cxx \
	Fluid_Plugins.cxx \
	Fl_Widget_Type.cxx \
	Fl_Window_Type.cxx \
	function_panel.cxx \
	widget_panel.cxx

CFILES	=

OBJECTS = $(CPPFILES:.cxx=.o) $(CFILES:.cxx=.o)
TARGETS	= fluid$(EXEEXT) $(FLUID)


#
# Make everything...
#

all:		$(TARGETS)


#
# Clean old files...
#

clean:
	$(RM) *.bck
	$(RM) *.o
	$(RM) core*
	$(RM) $(TARGETS)


#
# Make dependencies, excluding standard include directories...
#

depend:
	$(MAKEDEPEND) -fmakedepend -I.. $(CPPFILES) $(CFILES)


#
# Include automatically generated dependencies...
#

include makedepend


#
# Build FLUID...
#

fluid$(EXEEXT): $(OBJECTS) ../lib/$(LIBPREFIX)fltk$(LIBSUFFIX) \
		../lib/$(LIBPREFIX)fltk_images$(LIBSUFFIX)
	echo Linking $@...
	$(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LINKFLTKIMG) $(LDLIBS)
	$(POSTBUILD) $@ ../FL/mac.r


#
# Build shared FLUID...
#

fluid-shared$(EXEEXT): $(OBJECTS) ../src/$(DSOPREFIX)fltk$(DSOSUFFIX) \
		../images/$(DSOPREFIX)fltk_images$(DSOSUFFIX)
	echo Linking $@...
	$(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LINKSHARED) $(LIBS)
	$(POSTBUILD) $@ ../FL/mac.r


#
# Install everything...
#

install:
	echo "Installing FLUID in $(bindir)..."
	-$(MKDIR) $(bindir)
	$(CP) $(FLUID) $(bindir)/fluid$(EXEEXT)
	$(STRIP) $(bindir)/fluid$(EXEEXT)
	$(bindir)/fltk-config --post $(bindir)/fluid$(EXEEXT)
	$(CHMOD) 755 $(bindir)/fluid$(EXEEXT)


uninstall:
	$(RM) $(bindir)/fluid


#
# Note: The rebuild target can only be used if you have the original .fl
#       files.  This is normally only used by the FLTK maintainers...
#

rebuild:
	./fluid$(EXEEXT) -c about_panel.fl
	./fluid$(EXEEXT) -c alignment_panel.fl
	./fluid$(EXEEXT) -c function_panel.fl
	./fluid$(EXEEXT) -c widget_panel.fl
	./fluid$(EXEEXT) -c coding_style.fl


#
# End of "$Id: Makefile,v 1.49 2005/01/25 20:11:22 matthiaswm Exp $".
#
