#
# makefile for building NEF featureDLL example
#
# Copyright (c) 1999 Paul Kourochka
#
# How to contact the author:  Paul Kourochka, 2:464/52@fidonet
#                             nefpk@nefpk.8m.com
#                             Murmanskaja str, 2-28
#                             49098 Dniepropetrovsk
#                             Ukraine
#

incl=.

help :
	@echo usage: make target [incl=.h-pathes [compiler options]]
	@echo    or  make clean
	@echo where target one of:
	@echo     wat_os2    WATCOM C/32 compiler for OS/2
	@echo     wat_nt     WATCOM C/32 compiler for NT
	@echo     emx_os2    GNU emx C compiler for OS/2
	@echo     vac_os2    IBM VisualAge C compiler for OS/2
	@echo     bor_nt     Borland C compiler for NT
	@echo Note: add `-c' switch for WATCOM's WMAKE

clean :
	-del feature.obj
	-del feature.dll


# common WATCOM options for OS/2 and NT
watcom_cf=-bd -5r -zp1 -ox -fpi87 -fp5 -dFEATEXPORT=__export -i$(incl)
watcom_lf=caseexact, eliminate, description ' NEF/pk FeatureDLL example, (c) 1991-1998 Alberto Pasquale, 1999 Paul Kourochka'

##### WATCOM C/32 Compiler, target: OS/2, host: DOS, OS/2, NT (11.0b)
#
# wmake -c wat_os2
# or: wmake -c wat_os2 incl=\WATCOM\h;\WATCOM\h\os2
# or: wmake -c wat_os2 incl=\WATCOM\h;\TOOLKIT\H
# or: wmake -c wat_os2 "incl=. -br"		# using dynamic version of RTL
wat_os2 :
	wcc386 -bt=os2 $(watcom_cf) feature.c
	wlink system os2v2 dll initinstance terminstance f feature, clib3r(lmaino32) option manyautodata, $(watcom_lf)


##### WATCOM C/32 Compiler, target: NT, host: DOS, OS/2, NT (11.0b)
#
# wmake -c wat_nt
# or: wmake -c wat_nt incl=\WATCOM\h;\WATCOM\h\nt
# or: wmake -c wat_nt "incl=. -br"		# using dynamic version of RTL
wat_nt :
	wcc386 -bt=nt $(watcom_cf) feature.c
	wlink system nt_dll initinstance terminstance f feature option nostdcall, $(watcom_lf)


##### GNU/emx C compiler, target: OS/2, host: OS/2 (2.7.2.1)
# requires C header files from IBM Toolkit for OS/2 Warp 3 or 4
#
# make emx_os2
# or: make emx_os2 incl=\TOOLKIT\H
# or: make emx_os2 incl=\WATCOM\h\os2
emx_os2 :
	gcc -Wall -O3 -Zcrtdll -Zdll -Zomf -mprobe -lwrap -s -D__OS2__ -D_Seg16= -D_System= -I$(incl) feature.c feature.def -o feature.dll


##### IBM VisualAge C compiler, target: OS/2, host: OS/2 (3)
# requires C header files from IBM Toolkit for OS/2 Warp 3 or 4
#
# nmake vac_os2
# or: nmake vac_os2 incl=\IBMCPP\INCLUDE;\TOOLKIT\H
# or: nmake vac_os2 "incl=. /Gd"		# using dynamic version of RTL
vac_os2 :
	icc /Ge- /Sp1 /Ss /G5 /Gl /O /Oi10 /I$(incl) feature.c feature.def


##### Borland C compiler, target: NT, host: NT (5.4)
# As usually Borland C compiler has a lot of stupid bugs.  I cannot override
# $(incl) from MAKE's command line.  Uncomment or rewrite $(incl) below
# if need.  Or use nmake/dmake/GNU make instead of Borland's MAKE.
#incl=\CBuilder4\include -L\CBuilder4\lib
#incl=. -WR					# using dynamic version of RTL
#
# make bor_nt
bor_nt :
	bcc32 -5 -a- -d -ff -k- -O2 -Oc -Oi -OS -Ov -vi -WD -w-par -D__NT__ -DFEATEXPORT=__export -I$(incl) feature.c
