#
# /emx/samples/som_idl/makefile
#

wps:            flag
flag:           flag.dll

#
# Flag (Workplace Shell sample)
#
############################################################
# The IBM Programmer's Toolkit for OS/2 3.0 is required!!! #
############################################################
#
# Building and installing the Flag sample:
#
# 1. Include the path name of the Toolkit headers and libraries in
#    the INCLUDE, SMINCLUDE, C_INCLUDE_PATH, and LIBRARY_PATH environment
#    variables:
#
#       set include=c:\toolkit3\h;c:\toolkit3\som\include;c:\emx\include
#       set sminclude=c:\toolkit3\idl;c:\toolkit3\h;c:\toolkit3\som\include;.
#       set c_include_path=c:/emx/include;c:/toolkit3/h;c:/toolkit3/som/include
#	set library_path=c:/emx/lib;c:/toolkit3/som/lib
#
# 2. If there is an extra blank after the backslash intended for continuation
#    in line 339 (#define USERWORD_FROM_PREC) of toolkit3\h\wpobject.h,
#    delete that blank
#
# 3. Type "dmake flag" to build flag.dll
#
# 4. Type "..\flag install" to register the Flag class of flag.dll
#
# 5. Type "..\flag create FlagTest" to create a Flag object named FlagTest
#    on the desktop
#
# Removing the Flag class:
#
# 1. Delete all Flag objects
#
# 2. Type "flag uninstall" to deregister the Flag class
#
# 3. Reboot to unload flag.dll.  You don't need this step when using
#    OS/2 3.0 or later.  Moreover, you don't need this step unless you
#    want to overwrite or delete flag.dll
#
CFLAGS=-I. -Zdll -Zomf -Zno-rte -Zc++-comments

flag.ih: flag.idl
	sc -maddstar -mnoint -s"h;ih;def" -p flag.idl

flag.res: ../flag.rc ../flag.ico flag.ih
	rc -r -I . ..\flag.rc
	-del flag.res
	-move ..\flag.res

flag.obj: ../flag.c flag.ih flag.h flag.idl
	gcc -c $(CFLAGS) ../flag.c

flagdlg.obj: ../flagdlg.c flag.ih
	gcc -c $(CFLAGS) ../flagdlg.c

flag.dll: flag.obj flagdlg.obj flag.res flag.def
	gcc -s $(CFLAGS) flag.obj flagdlg.obj -lsomtk flag.def flag.res

clean:
	-del flag.dll
	-del flag.obj flagdlg.obj flag.res
	-del flag.def flag.h flag.ih
