/**********************************************************************
 * Imakefile - Imakefile for the xball program
 *
 * Copyright 1993, David Nedde
 *
 * Permission to use, copy, modify, and distribute this software
 * and its documentation for any purpose and without fee is granted
 * provided that the above copyright notice appears in all copies.
 * It is provided "as is" without express or implied warranty.
 **********************************************************************/

/**/# MOTIF  -> Have Motif Widgets
/**/# ATHENA -> Have Athena Widgets

#define MOTIF   
/**/#define ATHENA     


           DELAY = -DDELAY=100       # DELAY ranges from -18 to whatever
/**/#    GRAVITY = -DGRAVITY=8       # Default gravity
/**/# ELASTICITY = -DELASTICY=90     # Default elasticity
          USLEEP = -DHAVE_USLEEP      # Uncomment if usleep installed...
       MYDEFINES = $(DELAY) $(USLEEP)
     # CDEBUGFLAGS = -g


M_SRCS = act_area.c
M_OBJS = act_area.o
M_INCS = act_area.h

A_SRCS = filemenu.c
A_OBJS = filemenu.o
A_INCS =

#ifdef MOTIF

         DEFINES = -DMOTIF $(MYDEFINES)
/**/#   MYLDLIBS = -lPW    # Uncomment if you get regcmp and regex undefined
          LDLIBS = -lXm -lXmu -lXt -lX11 $(MYLDLIBS)

TOOL_SRCS = $(M_SRCS)
TOOL_OBJS = $(M_OBJS)
TOOL_INCS = $(M_INCS)

#endif


#ifdef ATHENA

/****** For filemenu *****/
#if defined(SunArchitecture) && OSMajorVersion >= 4
        PREDEFINES = -DSUNOS4
#endif
#ifdef UltrixArchitecture
#ifdef MipsArchitecture
        PREDEFINES = -DBSD -DMIPS
#else
        PREDEFINES = -DBSD
#endif
#endif

#define IHaveSubdirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'

        SUBDIRS = X11/Xaw_d
LOCAL_LIBRARIES = -lXaw_d
        DEFINES = -DATHENA $(MYDEFINES)
       INCLUDES = -I.
      LDOPTIONS = -LX11/Xaw_d
         LDLIBS = -lXaw_d -lXaw -lXt -lXmu -lXext -lX11

MakeSubdirs($(SUBDIRS))

TOOL_SRCS = $(A_SRCS)
TOOL_OBJS = $(A_OBJS)
TOOL_INCS = $(A_INCS)

#endif

 LINTOPTS = -abhuvz -D_NO_PROTO $(DEFINES)


COMM_SRCS = \
	color_l.c \
	demo.c \
	file_sel.c \
	help.c \
	item.c \
	items.c \
	list.c \
	menu.c \
	misc.c \
	miscx.c \
	room.c \
	scrollbar.c \
	sim.c \
	table.c \
	xball.c \
	xball_sys.c

COMM_OBJS = \
	color_l.o \
	demo.o \
	file_sel.o \
	help.o \
	item.o \
	items.o \
	list.o \
	menu.o \
	misc.o \
	miscx.o \
	room.o \
	scrollbar.o \
	sim.o \
	table.o \
	xball.o \
	xball_sys.o

COMM_INCS = \
	color_l.h \
	demo.h \
	fallback.h \
	file_sel.h \
	help.h \
	intf.h \
	item.h \
	items.h \
	list.h \
	menu.h \
	misc.h \
	miscx.h \
	names.h \
        patchlevel.h \
	room.h \
	scrollbar.h \
	sim.h \
	table.h \
	xball_sys.h

SRCS = $(COMM_SRCS) $(TOOL_SRCS)
OBJS = $(COMM_OBJS) $(TOOL_OBJS)
INCS = $(COMM_INCS) $(TOOL_INCS)

ComplexProgramTarget(xball)

CLASS            = XBall
APP_DEFAULTS_SRC = $(CLASS).ad

InstallAppDefaults($(CLASS))


fallback.h: $(APP_DEFAULTS_SRC)
	gen_fallback $(APP_DEFAULTS_SRC) > $@


DEMOS = demo1 demo2 demo3 demo4 demo5 demo6 demo7 demo8 demo9 demo10 \
        demo11 demo12 demo13 demo14

BITMAPS = \
	good_bitmaps \
	on.xbm \
	off.xbm \
	man.xbm \
	stipple.xbm \
	xball.xbm \
	xball-a.xbm \
	xball-b.xbm \
	xball-l.xbm \
	xball-x.xbm \
	sgi.xbm

MISC = \
	gen_fallback \
	run_demos \
        xball.man \
	README

DRAWING_A_DIRS = \
	X11 \
	X11/Xaw_d

DRAWING_A = \
	X11/Xaw_d/DrawingA.c \
	X11/Xaw_d/DrawingA.h \
	X11/Xaw_d/DrawingAP.h \
	X11/Xaw_d/DrawingA.doc \
	X11/Xaw_d/Imakefile \
	X11/Xaw_d/Makefile.std \
	X11/Xaw_d/Makefile \
        X11/Xaw_d/demo.c \
	X11/Xaw_d/README \
	Imakefile \
	Makefile.std \
	Makefile \
	Make.motif \
	Make.athena

DIST = \
	$(DRAWING_A) \
	$(COMM_SRCS) \
	$(COMM_INCS) \
	$(M_SRCS) \
	$(M_INCS) \
	$(A_SRCS) \
	$(A_INCS) \
	$(APP_DEFAULTS_SRC) \
	$(MISC) \
	$(BITMAPS) \
	$(DEMOS)

shar:
	makekit -s75k -p $(DRAWING_A_DIRS) $(DIST)

tar:
	tar cvf - $(DIST) | compress -v > xball.tar.Z
