!INCLUDE <Win32.mak>

cflags=$(cflags) /I $(KRB5SDK)\inc\krb5 /I $(KRB5SDK)\inc\krb5\gssapi /I . /D_CRT_SECURE_NO_DEPRECATE /DWIN32_LEAN_AND_MEAN

rcflags=$(rcflags) /I .

remctl.exe: remctl.obj getopt.obj messages.obj asprintf.obj winsock.obj xmalloc.obj remctl.lib remctl.res
	link $(ldebug) $(lflags) /LIBPATH:$(KRB5SDK)\lib\$(CPU) /out:$@ $** ws2_32.lib advapi32.lib

remctl.lib: remctl.dll

remctl.dll: api.obj client-v1.obj client-v2.obj error.obj open.obj network.obj asprintf.obj concat.obj gss-tokens.obj gss-errors.obj inet_aton.obj inet_ntop.obj tokens.obj messages.obj winsock.obj xmalloc.obj libremctl.res
	link $(ldebug) $(lflags) /LIBPATH:$(KRB5SDK)\lib\$(CPU) /dll /out:$@ /export:remctl /export:remctl_new /export:remctl_open /export:remctl_close /export:remctl_command /export:remctl_commandv /export:remctl_error /export:remctl_output $** gssapi32.lib ws2_32.lib advapi32.lib

{client\}.c{}.obj::
	$(cc) $(cdebug) $(cflags) $(cvars) /c $<

{util\}.c{}.obj::
	$(cc) $(cdebug) $(cflags) $(cvars) /c $<

{portable\}.c{}.obj::
	$(cc) $(cdebug) $(cflags) $(cvars) /c $<

{client\}.rc{}.res::
	$(rc) $(rcflags) $(rcvars) $<

clean:
	-del *.obj *.exe *.pdb *.ilk *.exp *.lib *.dll *.res
