## ----- Install options -----
CC = CC
LINK = CC
CC_FLAGS =
LINK_FLAGS =
CPP_EXTENSION = .cpp
INCLUDE_DIRS =
LIB_DIRS = -L/usr/lib/Motif1.2 -L/usr/lib/X11R5
GUI_LIBS = -lXm -lXt -lX11
LIBS = -lm

## ----- General options -----
ZAF_INC_DIR = ../include
CF_INC_DIR = ../cf_zaf/include
ZAF_LIB_DIR = ../lib
Z_INCLUDE_DIRS = -I. -I$(ZAF_INC_DIR) $(INCLUDE_DIRS)
Z_LIB_DIRS = -L$(ZAF_LIB_DIR) $(LIB_DIRS)
Z_LIBS = -lZafMtfP -lZafMtf $(GUI_LIBS) $(LIBS)
CF_LIBS = -lcfzaf

.SUFFIXES:
.SUFFIXES: .o $(CPP_EXTENSION)

$(CPP_EXTENSION).o:
	$(CC) $(CC_FLAGS) $(Z_INCLUDE_DIRS) -I$(CF_INC_DIR) -c $<

posix: mbnum mbutton mcombo mdate mdisplay mfstr mgmgmt mgroup mhlist \
	micon minteger mprgrs mprompt mreal msclwin mscroll mspin mstatus \
	mstring mtbar mtext mtime mtree mtritm mutime mvlist

clean:
	-rm -f *.o core mbnum mbutton mcombo mdate mdisplay mfstr mgmgmt \
	mgroup mhlist micon minteger mprgrs mprompt mreal msclwin mscroll \
	mspin mstatus mstring mtbar mtext mtime mtree mtritm mutime mvlist

mbnum: bnum.o format.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ bnum.o format.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mbutton: button.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ button.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mcombo: combo.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ combo.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mdate: date.o format.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ date.o format.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mdisplay: display.o
	$(LINK) $(LINK_FLAGS) -o $@ display.o $(Z_LIB_DIRS) $(Z_LIBS)

mfstr: fstr.o format.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ fstr.o format.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mgmgmt: gmgmt.o
	$(LINK) $(LINK_FLAGS) -o $@ gmgmt.o $(Z_LIB_DIRS) $(Z_LIBS)

mgroup: group.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ group.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mhlist: hlist.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ hlist.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

micon: icon.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ icon.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

minteger: integer.o format.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ integer.o format.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mntbk: ntbk.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ ntbk.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mprgrs: prgrs.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ prgrs.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mprompt: prompt.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ prompt.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mreal: real.o format.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ real.o format.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

msclwin: sclwin.o
	$(LINK) $(LINK_FLAGS) -o $@ sclwin.o $(Z_LIB_DIRS) $(Z_LIBS)

mscroll: scroll.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ scroll.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mspin: spin.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ spin.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mstatus: status.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ status.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mstring: string.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ string.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mtable: table.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ table.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mtbar: tbar.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ tbar.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mtext: text.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ text.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mtime: time.o format.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ time.o format.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mtree: tree.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ tree.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mtritm: tritm.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ tritm.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mutime: utime.o format.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ utime.o format.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mvlist: vlist.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ vlist.o maintest.o $(Z_LIB_DIRS) $(Z_LIBS)

mchart: chart.o maintest.o
	$(LINK) $(LINK_FLAGS) -o $@ chart.o maintest.o $(Z_LIB_DIRS) $(CF_LIBS) $(Z_LIBS)

