# HELLO tutorial makefile

#    nmake -f iccpp210.mak os2	(makes all the OS/2 hello tutorials)

# ----- OS/2 compiler options -----------------------------------------------
OS2_CPP=icc
OS2_LINK=link386
OS2_LIBRARIAN=lib
OS2_RC=rc

OS2_CPP_OPTS=/c /D__OS2__ /O+
OS2_LINK_OPTS=/NOE /NOI /BASE:0x10000 /PM:PM
OS2_LIB_OPTS=
OS2_RC_OPTS=

OS2_OBJS=
OS2_LIBS=os2_zil.lib

.SUFFIXES : .cpp

.cpp.obj:
	$(OS2_CPP) $(OS2_CPP_OPTS) $<

# ----- Usage --------------------------------------------------------------
usage:
	@echo ...........
	@echo ...........
	@echo To make this Zinc tutorial for IBM C++ type:
	@echo nmake -f iccpp210.mak os2
	@echo ...........
	@echo ...........

# ----- Clean ---------------------------------------------------------------
clean:
	z_clean.cmd

# ----- OS/2 ----------------------------------------------------------------
os2: ohello1.exe ohello2.exe ohello3.exe ohellog.exe

ohello1.exe: hello1.obj
	$(OS2_LINK) $(OS2_LINK_OPTS) @<<zil.rsp
$(OS2_OBJS)+hello1.obj
$*,NUL,$(OS2_LIBS),ohello.def
<<
	$(OS2_RC) $(OS2_RC_OPTS) ohello.rc $*.exe

ohello2.exe: hello2.obj
	$(OS2_LINK) $(OS2_LINK_OPTS) @<<zil.rsp
$(OS2_OBJS)+hello2.obj
$*,NUL,$(OS2_LIBS),ohello.def
<<
	$(OS2_RC) $(OS2_RC_OPTS) ohello.rc $*.exe

ohello3.exe: hello3.obj hello.obj
	$(OS2_LINK) $(OS2_LINK_OPTS) @<<zil.rsp
$(OS2_OBJS)+hello3.obj+hello.obj
$*,NUL,$(OS2_LIBS),ohello.def
<<
	$(OS2_RC) $(OS2_RC_OPTS) ohello.rc $*.exe

ohellog.exe: hellog.obj
	$(OS2_LINK) $(OS2_LINK_OPTS) @<<zil.rsp
$(OS2_OBJS)+hellog.obj
$*,NUL,$(OS2_LIBS),ohello.def
<<
	$(OS2_RC) $(OS2_RC_OPTS) ohello.rc $*.exe
