/* Imakefile for X11 Xconq. */

#include "../Local.config"

/*
 * ComplexProgramTarget_4 - generate rules for compiling and linking the
 * program specified by $(OBJS4) and $(SRCS4) and installing the program and
 * man page.  It should be used to build the fourth program in Imakefiles 
 * describing more than one program.
 */
#ifdef IhaveXPM
#ifndef ComplexProgramTarget_4
#define	ComplexProgramTarget_4(program,locallib,syslib)			@@\
ProgramTargetHelper(program,SRCS4,OBJS4,DEPLIBS4,locallib,syslib)
#endif /* ComplexProgramTarget_4 */
#endif /* IhaveXPM */

XCOMM Common defines

DEFINES = -DUNIX -DIMFLIB=\"$(XC_X11LIBDIR)\" 

#ifdef IhaveXPM
EXTRA_DEFINES = -DHAVE_XPM -DHAVE_SELFILE
#else  /* IhaveXPM */
EXTRA_DEFINES = -DHAVE_SELFILE
#endif /* IhaveXPM */

INCLUDES = -I. -I../kernel

LOCAL_LIBRARIES = XawClientLibs

CONQLOW_LIBRARIES = ../kernel/libconqlow.a

CONQ_LIBRARIES = ../kernel/libconq.a $(CONQLOW_LIBRARIES)

SRCS1 = xconq.c

OBJS1 =	xconq.o \
	xinit.o \
	xmap.o \
	xdraw.o \
	xcmd.o \
	xprint.o \
	xdesign.o \
	xhelp.o \
	ximf.o \
	xcloseup.o

XUTOBJ = ximf.o \
	 xutil.o

OBJS2 = xshowimf.o $(XUTOBJ)
OBJS3 = x2imf.o $(XUTOBJ)
OBJS4 = imf2x.o $(XUTOBJ)

#ifdef IhaveXPM
PROGRAMS = xconq x2imf imf2x xshowimf Xconq-color.ad XShowimf-color.ad
#else  /* IhaveXPM */
PROGRAMS = xconq x2imf xshowimf
#endif /* IhaveXPM */

ComplexProgramTarget_1(xconq, $(CONQ_LIBRARIES), $(LOCAL_LIBRARIES) -lm)

#ifdef IhaveXPM
ComplexProgramTarget_2(xshowimf, $(CONQLOW_LIBRARIES) ../SelFile/libXgnu.a, -lXpm $(LOCAL_LIBRARIES))
ComplexProgramTarget_3(x2imf, $(CONQLOW_LIBRARIES), -lXpm $(LOCAL_LIBRARIES))
ComplexProgramTarget_4(imf2x, $(CONQLOW_LIBRARIES), -lXpm $(LOCAL_LIBRARIES))
#else  /* IhaveXPM */
ComplexProgramTarget_2(xshowimf, $(CONQLOW_LIBRARIES) ../SelFile/libXgnu.a, $(LOCAL_LIBRARIES))
ComplexProgramTarget_3(x2imf, $(CONQLOW_LIBRARIES), $(LOCAL_LIBRARIES))
#endif /* IhaveXPM */

install:: 
	chown $(GAMEUID) $(BINDIR)/xconq
	chgrp $(GAMEGRP) $(BINDIR)/xconq
	chmod $(GAMEPERM) $(BINDIR)/xconq

Xconq-color.ad: Xconq-co.ad
	cp Xconq-co.ad Xconq-color.ad

XShowimf-color.ad: XShowimf-co.ad
	cp XShowimf-co.ad XShowimf-color.ad

InstallAppDefaults(Xconq)
InstallAppDefaults(Xconq-color)
InstallAppDefaults(XShowimf)
InstallAppDefaults(XShowimf-color)
