#
# /emx/samples/som_oidl/makefile
#

wps:            flag
flag:           flag.dll

#
# Flag (Workplace Shell sample)
#
############################################################
# The IBM Programmer's Toolkit for OS/2 2.1 is required!!! #
############################################################
#
# Building and installing the Flag sample:
#
# 1. Include the path name of the Toolkit headers in the INCLUDE,
#    SMINCLUDE and C_INCLUDE_PATH environment variables:
#
#       set include=c:\toolkt21\c\os2h;c:\emx\include
#       set sminclude=c:\toolkt21\sc
#       set c_include_path=c:/emx/include;c:/toolkt21/c/os2h
#
# 2. Set the SMEMIT environment variable to tell SC what files to emit:
#
#       set smemit=h;ih;ph;psc;cs2;def
#
# 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. -DOIDL -Zdll -Zomf -Zno-rte -Zc++-comments

flag.ih: flag.csc
	sc -r flag.csc

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

flag.obj: ../flag.c flag.ih
	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 flag.def flag.res

clean:
	-del flag.dll
	-del flag.obj flagdlg.obj flag.res
	-del flag.cs2 flag.def flag.h flag.ih flag.ph flag.psc flag.sc
