!include <ntwin32.mak>

YACC = yacc
SLN = copy
RMS = del

PERLDEBUG=0

!IF $(PERLDEBUG) == 0

cflags = -c -W1 -G4 -Gf -D_X86_=1
cdebug = -O2gi
lflags = $(conflags) -debug:none -debugtype:both

!ELSE

cflags = -c -W3 -G4 -D_X86_=1
cdebug = -Zi -Od
lflags = $(conflags) -debug:full -debugtype:both

!ENDIF

libs = libc.lib kernel32.lib
socklibs = wsock32.lib advapi32.lib

public = perl.exe

shellflags = 

incs =
defs = -DNT

# To use an alternate make, set  in config.sh.

MAKE = nmake

CCCMD = $(cc) -nologo $(incs) $(cflags) $(cdebug) $(defs)

obj1 = array.obj cmd.obj cons.obj consarg.obj doarg.obj doio.obj dolist.obj
obj2 = eval.obj form.obj $(mallocobj) perl.obj regcomp.obj regexec.obj
obj3 = stab.obj str.obj toke.obj util.obj dump.obj nt.obj

obj = $(obj1) $(obj2) $(obj3)

# grrr
SHELL = cmd.exe

.c.obj:
	$(CCCMD) $*.c

all: perl.exe perlglob.exe

perl.exe: perly.obj $(obj) hash.obj usersub.obj 
	$(link) $(lflags) $(obj) hash.obj perly.obj usersub.obj $(libs) $(socklibs) -out:perl.exe

perlglob.exe: perlglob.obj
	$(link) $(lflags) perlglob.obj d:\mstools\lib\setargv.obj -out:perlglob.exe $(libs)

perly.obj: perly.c perly.h $(h)
	$(CCCMD) perly.c

install: all
	./perl installperl

clean:
	del *.obj perl.exe perlglob.exe

test: perl
	- cd t && chmod +x TEST */*.t
	- cd t && (rm -f perl; $(SLN) ../perl perl) && ./perl TEST </dev/tty


$(obj): perl.h config.h nt.h

