/* $Id$ */

/*========================================================================
 *  Copyright 1996, 1997, 1998  Michael J. Hammel
 *========================================================================
 *              FILE NAME: Imakefile
 *            DESCRIPTION: imake configuration file for lightning-d directory
 *  SOFTWARE DEPENDENCIES: X11, gtk, gdk
 *                  NOTES: set tabstops=3 for readibility
 *
 * SPECIAL CONSIDERATIONS:
 * If you unfamiliar with Imakefile's you should note that imake (the
 * program which process Imakefile's and turns them into Makefile's) allows
 * both traditional C comments along with another comment type, the XCOMM
 * comment.  If you see "XCOMM" at the front of a line then it has been
 * commented out.  Normally you wouldn't mix comment types, but I think
 * it makes the source more readable if you do.
 *========================================================================
 *
 * MODIFICATION HISTORY:
 * $Log$
 *========================================================================*/

#include "../config.h"
#include "../gfxmuse.tmpl"

/*========================================================================
 * Directories
 */
BINDIR    = ../bin-d		/* where the executable goes */
MANDIR    = ../man-d		/* where man pages go */
LIBDIR    = ../lib-d		/* where app specific libs are located */

/*========================================================================
 * Include files
 */
PRJHDR    = ../hdrs-d	/* Project level header files */
PRGHDR    = hdrs-d		/* Program level header files */
DBGHDR    = ../debug-d	/* Debug header files */

PROJECTHDRS = -I. $(PKGINCS) -I$(PRJHDR) -I$(PRGHDR) -I$(DBGHDR)

/* This puts the include directories in the right place at compile time */
EXTRA_INCLUDES  = $(PROJECTHDRS) 


/*========================================================================
 * Libraries - note that the ordering is important!
 */
#ifdef DEBUGOFF
DEBUG_LIB        = 
#else
DEBUG_LIB        = $(LIBDIR)/libgmdbg.a
#endif

/*
 * DEPLIBS is defined to be all the X libraries on the system by the 
 * default Imake.rules, but we're not expecting those to change often in
 * our environment.  So we change it here to be our project specific
 * libraries so that the build process will rebuild the executable if the only
 * thing thats changed is the underlying project libraries.  IE, DEPLIBS
 * is used by ComplexProgramTarget() to determine what the make rule will be.
 */
DEPLIBS = $(LIBDIR)/libgfxm.a $(DEBUG_LIB)

/*
 * Prefix the following with "G", just to prevent them from interferring
 * with variables defined by the system imake files.
 */
GGIMPLIBS = -lgimpui -lgimp $(XINPUT)
GGTKLIBS = -lgtk -lgdk -lglib
GXLIBS = -lX11 -lXext 
GLIBS  = $(PKGLIBS) $(GGIMPLIBS) $(GGTKLIBS) $(GXLIBS) -lm


/* This puts all the libraries in the right place at link time */
LOCAL_LIBRARIES  = $(DEPLIBS) $(GLIBS)

/*========================================================================
 * Modified clean command to remove cscope files, if any.
 */
RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut  *.Dat *.out

/*========================================================================
 * Options needed when just building the object modules
 */
OBJECTOPTIONS = -c

/*========================================================================
 * Source files
 */
SRCS = 	\
			lightning.c 

/*========================================================================
 * Object files - path relative to current directory
 */
OBJS = 	\
			lightning.o 

/*========================================================================
 * program name
 */
PROG = gfxlightning

/*========================================================================
 * Let imake take care of most of this
 */
ComplexProgramTarget($(PROG))

/*========================================================================
 * Give ourselves the chance to compile each object seperately
 */
SpecialObjectRule(lightning.o, lightning.c lightning.h, $(OBJECTOPTIONS))
