!include <ntwin32.mak>

C_DEFINES=-DWIN_NT -DSTDC_HEADERS -D_POSIX_SOURCE -DDIRENT -DSTACK_DIRECTION=-1 -D__STDC__ -DDF_POSIX -D_POSIX_ -DCONVERT_TO_SLASHES -UCONVERT_TO_BACKSLASHES
C_INCLUDES=-I..\include\bsd -I..\include\df

all: find.exe

..\bsdpsx\bsdpsx.lib:
	cd ..\bsdpsx
	nmake
	cd ..\find

find.obj: find.c *.h

function.obj: function.c *.h

ls.obj: ls.c *.h

main.obj: main.c *.h

misc.obj: misc.c *.h

operator.obj: operator.c *.h

option.obj: option.c *.h

fnmatch.obj: fnmatch.c *.h

findglob.obj: findglob.c *.h

glob.obj: glob.c *.h

find.exe: find.obj function.obj ls.obj main.obj misc.obj operator.obj option.obj fnmatch.obj findglob.obj glob.obj ..\bsdpsx\bsdpsx.lib
	$(link) $(linkdebug) $(psxflags) -out:$*.exe $** $(psxlibs) ..\bsdpsx\bsdpsx.lib

.c.obj:
	$(cc) $(cflags) $(psxvars) $(cvars) $(cdebug) $(C_DEFINES) $(C_INCLUDES) $*.c
