/* Makefile for Lucid Widget Library
   Copyright (C) 1994 Lucid, Inc.
   Copyright (C) 1995 Tinker Systems and INS Engineering Corp.
   Copyright (C) 1994, 1995 Board of Trustees, University of Illinois

This file is part of the Lucid Widget Library.

The Lucid Widget Library 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, or (at your option)
any later version.

The Lucid Widget 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 General Public License for more details.

You should have received a copy of the GNU General Public License
along with XEmacs; see the file COPYING.  If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.  */

/* Some people use these in paths they define.  We do not want their paths
   getting changed on them. */
#undef sparc
#undef sun
#undef unix
#undef sgi
#undef NeXT
#undef mips
#undef i386
#undef linux

srcdir=@srcdir@

SHELL=/bin/sh

CC=@CC@
CPP=@CPP@
CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@
CPPFLAGS=@CPPFLAGS@
RANLIB=@RANLIB@

RM = rm -f
AR = ar cq
@SET_MAKE@

#define NOT_C_CODE
#include "../src/config.h"

#ifdef USE_GNU_MAKE
vpath %.c @srcdir@
vpath %.h @srcdir@
#else
VPATH=@srcdir@
#endif

#ifdef ENERGIZE
EZ_OBJS =\
 energize/blpsheet.o energize/build.o energize/classbr_ps.o \
 energize/ctreebr_ps.o energize/debuggerps.o energize/editmode.o \
 energize/leb_psheet.o energize/projectdisp.o energize/projectps.o \
 energize/search.o energize/target.o
ENERGIZEP = -DENERGIZE
EZ_SUBDIR = ez_dialog
#endif

lwlib_objs=@lwlib_objs@

OBJS = lwlib.o lwlib-utils.o lwlib-config.o $(EZ_OBJS) ${lwlib_objs}

all:: $(EZ_SUBDIR) liblw.a

c_switch_general=@c_switch_general@
c_switch_window_system=@c_switch_window_system@
c_switch_all=@c_switch_all@
ld_switch_general=@ld_switch_general@
ld_switch_window_system=@ld_switch_window_system@
ld_switch_all=@ld_switch_all@
ld_libs_general=@ld_libs_general@
ld_libs_window_system=@ld_libs_window_system@
ld_libs_all=@ld_libs_all@

ALL_CFLAGS= $(CFLAGS) $(CPPFLAGS) -I. $(c_switch_all) $(ENERGIZEP)
.c.o:
	$(CC) -c $(ALL_CFLAGS) $<

liblw.a: $(OBJS)
	$(RM) $@
	$(AR) $@ $(OBJS)
	-test -n "$(RANLIB)" && $(RANLIB) $@

#ifdef ENERGIZE
ez_dialog:
	cd energize && $(MAKE) $(MFLAGS)
#endif

FRC.mostlyclean:
mostlyclean: FRC.mostlyclean
	rm -f liblw.a liblw_pure_*.a *.o
clean: mostlyclean
#ifdef ENERGIZE
	cd energize && $(MAKE) $(MFLAGS) clean
#endif
distclean: clean
	rm -f Makefile Makefile.in config.h .pure
realclean: distclean
extraclean: distclean
	-rm -f *~ \#* m/?*~ s/?*~


lwlib-config.o:	lwlib.h ../src/config.h
lwlib-Xaw.o:	lwlib.h lwlib-internal.h lwlib-Xaw.h ../src/config.h
lwlib-Xlw.o:	lwlib.h lwlib-internal.h lwlib-Xlw.h xlwmenu.h ../src/config.h
lwlib-Xm.o:	lwlib.h lwlib-internal.h lwlib-utils.h lwlib-Xm.h
lwlib-Xm.o:	../src/config.h
lwlib-utils.o:	lwlib-utils.h ../src/config.h
lwlib.o:	lwlib.h lwlib-internal.h lwlib-utils.h ../src/config.h
lwlib.o:	lwlib-Xlw.h lwlib-Xm.h lwlib-Xaw.h ../src/config.h
xlwmenu.o:	lwlib.h xlwmenu.h xlwmenuP.h ../src/config.h
xlwscrollbar.o:	lwlib.h xlwscrollbar.h xlwscrollbarP.h ../src/config.h
