CC              = cc
LD              = cc

## everything standard
#MOTIF_INC_DIR   = /usr/include
#X11_INC_DIR     = /usr/include
#MOTIF_LIB_DIR   = /usr/lib
#X11_LIB_DIR     = /usr/lib
#CPPFLAGS        = -I$(MOTIF_INC_DIR) -I$(X11_INC_DIR)
#XLIBS           = -lXm -lXt -lX11
#SYSLIBS         = -lm
###

## sco sysv3.4
#MOTIF_INC_DIR   = /usr/include
#X11_INC_DIR     = /usr/include
#MOTIF_LIB_DIR   = /usr/lib
#X11_LIB_DIR     = /usr/lib
#CPPFLAGS        = -I$(MOTIF_INC_DIR) -I$(X11_INC_DIR) -DSCO
#XLIBS           = -lXm -lXt -lX11 -lXext -lXmu -lrpc -lsocket -lintl
#SYSLIBS         = -lm
###

## ibm aix
#MOTIF_INC_DIR   = /usr/include
#X11_INC_DIR     = /usr/include
#MOTIF_LIB_DIR   = /usr/lib
#X11_LIB_DIR     = /usr/lib
#CPPFLAGS        = -I$(MOTIF_INC_DIR) -I$(X11_INC_DIR)
#XLIBS           = -lXm -lXt -lX11
#SYSLIBS         = -lm
###

## dec osf1
#MOTIF_INC_DIR   = /usr/include
#X11_INC_DIR     = /usr/include
#MOTIF_LIB_DIR   = /usr/shlib
#X11_LIB_DIR     = /usr/shlib
#CPPFLAGS        = -I$(MOTIF_INC_DIR) -I$(X11_INC_DIR)
#XLIBS           = -lXm -lXt -lX11
#SYSLIBS         = -lform -lm
###

## novell sysv4
#CFLAGS          = -D_NO_PROTO
#MOTIF_INC_DIR   = /usr/X/include
#X11_INC_DIR     = /usr/X/include
#MOTIF_LIB_DIR   = /usr/X/lib
#X11_LIB_DIR     = /usr/X/lib
#CPPFLAGS        = -I$(MOTIF_INC_DIR) -I$(X11_INC_DIR) -Ddrem=remainder
#XLIBS           = -lXm -lXt -lXimp -lX11 -lnsl -lsocket  -lgen -lresolv
#SYSLIBS         = -lform -lm
###

## ncr sysv4
#MOTIF_INC_DIR   = /usr/include
#X11_INC_DIR     = /usr/include
#MOTIF_LIB_DIR   = /usr/lib
#X11_LIB_DIR     = /usr/lib
#CPPFLAGS        = -I$(MOTIF_INC_DIR) -I$(X11_INC_DIR) -Ddrem=remainder
#XLIBS           = -lXm -lXt -lX11 -lnsl -lsocket -lgen -lresolv
#SYSLIBS         = -lform -lm
###

## nec sysv4
#MOTIF_INC_DIR   = /usr/include
#X11_INC_DIR     = /usr/include
#MOTIF_LIB_DIR   = /usr/lib
#X11_LIB_DIR     = /usr/lib
#CPPFLAGS        = -I$(MOTIF_INC_DIR) -I$(X11_INC_DIR) -Ddrem=remainder
#XLIBS           = -lXm -lXt -lX11 -lnsl -lsocket -lgen -lresolv
#SYSLIBS         = -lform -lm
###

## sg irix
#MOTIF_INC_DIR   = /usr/include
#X11_INC_DIR     = /usr/include
#MOTIF_LIB_DIR   = /usr/lib
#X11_LIB_DIR     = /usr/lib
#CPPFLAGS        = -D_NO_PROTO -I$(MOTIF_INC_DIR) -I$(X11_INC_DIR) -Ddrem=remainder
#XLIBS           = -lXm -lXt -lX11 -lgen
#SYSLIBS         = -lm
###

# solaris 2.x
MOTIF_INC_DIR   = /usr/dt/include
X11_INC_DIR     = /usr/openwin/include
MOTIF_LIB_DIR   = /usr/dt/lib -R/usr/dt/lib
X11_LIB_DIR     = /usr/openwin/lib -R/usr/openwin/lib
CPPFLAGS        = -I$(MOTIF_INC_DIR) -I$(X11_INC_DIR) -Ddrem=remainder
XLIBS           = -lXm -lXt -lX11
SYSLIBS         = -lform -lm
.SCCS_GET:

##

## hp-ux 9.x
#MOTIF_INC_DIR   = /usr/include/Motif1.2
#X11_INC_DIR     = /usr/include/X11R5
#MOTIF_LIB_DIR   = /usr/lib/Motif1.2
#X11_LIB_DIR     = /usr/lib/X11R5
#CPPFLAGS        = -I$(MOTIF_INC_DIR) -I$(X11_INC_DIR)
#XLIBS           = -lXm -lXt -lX11
#SYSLIBS         = -lm
###

## qnx
#MOTIF_INC_DIR   = /usr/include 
#X11_INC_DIR     = /usr/include/X11
#MOTIF_LIB_DIR   = /usr/lib/X11
#X11_LIB_DIR     = /usr/lib/X11
#CPPFLAGS        = -I$(MOTIF_INC_DIR) -I$(X11_INC_DIR)
#XLIBS           =  N 128k -L/usr/lib/X11 -lXaw -lXmu -lXt_s -lX11_s -lXqnx_s -lXext -lsocket
#SYSLIBS         = -lm
###

CFLAGS          = -O
LDFLAGS         = -L$(MOTIF_LIB_DIR) -L$(X11_LIB_DIR)

LIBS            = $(XLIBS) $(SYSLIBS)


all:  mcalc MCalc

.c.o:
	rm -f $@
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $<

mcalc.o:        scientific.xc
	$(CC) -c $(CPPFLAGS) $(CFLAGS) mcalc.c

mcalc:          mcalc.o
	rm -f $@
	$(LD) -o $@ mcalc.o $(LDFLAGS) $(LIBS)

MCalc:          mcalc.res scientific.res
	cat mcalc.res scientific.res >MCalc


clean::
	rm -f mcalc mcalc.o
