LINK = link
CC = cl
OUTDIR=.
MAKEFILE=NMakefile
SUBPROC_MAKEFILE=NMakefile
CFLAGS_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H
CFLAGS_debug = $(CFLAGS_any) /Od /D DEBUG /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb
CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
/INCREMENTAL:no /PDB:WinDebug/make.pdb /MACHINE:I386 \
/OUT:WinDebug/make.exe /DEBUG
LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\
/INCREMENTAL:no /MACHINE:I386 /OUT:WinRel/make.exe
all: config.h subproc Release Debug
subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib
w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib: w32/subproc/misc.c w32/subproc/sub_proc.c w32/subproc/w32err.c
subproc.bat $(SUBPROC_MAKEFILE) $(MAKE)
if exist WinDebug\make.exe erase WinDebug\make.exe
if exist WinRel\make.exe erase WinRel\make.exe
config.h: config.h.W32
copy $? $@
Release:
$(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe
Debug:
$(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe
clean:
if exist WinDebug\nul rmdir /s /q WinDebug
if exist WinRel\nul rmdir /s /q WinRel
if exist w32\subproc\WinDebug\nul rmdir /s /q w32\subproc\WinDebug
if exist w32\subproc\WinRel\nul rmdir /s /q w32\subproc\WinRel
if exist config.h erase config.h
erase *.pdb
$(OUTDIR):
if not exist .\$@\nul mkdir .\$@
LIBS = kernel32.lib user32.lib advapi32.lib
OBJS = \
$(OUTDIR)/ar.obj \
$(OUTDIR)/arscan.obj \
$(OUTDIR)/commands.obj \
$(OUTDIR)/default.obj \
$(OUTDIR)/dir.obj \
$(OUTDIR)/expand.obj \
$(OUTDIR)/file.obj \
$(OUTDIR)/function.obj \
$(OUTDIR)/getloadavg.obj \
$(OUTDIR)/getopt.obj \
$(OUTDIR)/getopt1.obj \
$(OUTDIR)/implicit.obj \
$(OUTDIR)/job.obj \
$(OUTDIR)/main.obj \
$(OUTDIR)/misc.obj \
$(OUTDIR)/read.obj \
$(OUTDIR)/remake.obj \
$(OUTDIR)/remote-stub.obj \
$(OUTDIR)/rule.obj \
$(OUTDIR)/signame.obj \
$(OUTDIR)/variable.obj \
$(OUTDIR)/version.obj \
$(OUTDIR)/vpath.obj \
$(OUTDIR)/glob.obj \
$(OUTDIR)/fnmatch.obj \
$(OUTDIR)/dirent.obj \
$(OUTDIR)/pathstuff.obj
$(OUTDIR)/make.exe: $(OUTDIR) $(OBJS)
$(LINK) @<<
$(LDFLAGS) $(LIBS) $(OBJS)
<<
.c{$(OUTDIR)}.obj:
$(CC) $(CFLAGS) /c $<
$(OUTDIR)/glob.obj : glob/glob.c
$(CC) $(CFLAGS) /c $?
$(OUTDIR)/fnmatch.obj : glob/fnmatch.c
$(CC) $(CFLAGS) /c $?
$(OUTDIR)/dirent.obj : w32/compat/dirent.c
$(CC) $(CFLAGS) /c $?
$(OUTDIR)/pathstuff.obj : w32/pathstuff.c
$(CC) $(CFLAGS) /c $?
ar.o : \
ar.c make.h config.h \
getopt.h \
gettext.h filedef.h \
hash.h dep.h
arscan.o : \
arscan.c make.h config.h \
getopt.h \
gettext.h \
commands.o : \
commands.c make.h config.h \
getopt.h \
gettext.h dep.h \
filedef.h hash.h variable.h job.h commands.h
default.o : \
default.c make.h config.h \
getopt.h \
gettext.h rule.h \
dep.h filedef.h hash.h job.h commands.h variable.h
dir.o : \
dir.c make.h config.h \
getopt.h \
gettext.h hash.h \
expand.o : \
expand.c make.h config.h \
getopt.h \
gettext.h \
filedef.h hash.h job.h commands.h variable.h \
rule.h
file.o : \
file.c make.h config.h \
getopt.h \
gettext.h \
dep.h filedef.h hash.h job.h commands.h \
variable.h debug.h
function.o : \
function.c make.h config.h \
getopt.h \
gettext.h filedef.h \
hash.h variable.h dep.h job.h commands.h debug.h
getopt.o : \
getopt.c config.h \
getopt1.o : \
getopt1.c config.h getopt.h \
hash.o : \
hash.c make.h config.h \
getopt.h \
gettext.h hash.h
implicit.o : \
implicit.c make.h config.h \
getopt.h \
gettext.h rule.h \
dep.h filedef.h hash.h debug.h
job.o : \
job.c make.h config.h \
getopt.h \
gettext.h \
job.h debug.h filedef.h hash.h commands.h \
variable.h \
loadavg-loadavg.o : \
loadavg.c config.h \
make.h \
getopt.h \
gettext.h \
main.o : \
main.c make.h config.h \
getopt.h \
gettext.h dep.h \
filedef.h hash.h variable.h job.h commands.h rule.h debug.h \
misc.o : \
misc.c make.h config.h \
getopt.h \
gettext.h dep.h \
debug.h
read.o : \
read.c make.h config.h \
getopt.h \
gettext.h \
dep.h filedef.h hash.h \
job.h commands.h variable.h rule.h debug.h
remake.o : \
remake.c make.h config.h \
getopt.h \
gettext.h filedef.h \
hash.h job.h commands.h dep.h variable.h debug.h \
remote-stub.o : \
remote-stub.c make.h config.h \
getopt.h \
gettext.h filedef.h \
hash.h job.h commands.h
rule.o : \
rule.c make.h config.h \
getopt.h \
gettext.h dep.h \
filedef.h hash.h job.h commands.h variable.h rule.h
signame.o : \
signame.c make.h config.h \
getopt.h \
gettext.h
variable.o : \
variable.c make.h config.h \
getopt.h \
gettext.h dep.h \
filedef.h hash.h job.h commands.h variable.h rule.h
version.o : \
version.c config.h
vpath.o : \
vpath.c make.h config.h \
getopt.h \
gettext.h filedef.h \
hash.h variable.h