.
[make.git] / NMakefile.template
blobf546074fb334832675de09eb3ac1f04095369ce8
1 # NOTE: If you have no `make' program at all to process this makefile, run
2 # `build_w32.bat' instead.
4 # Copyright (C) 1988, 89, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
5 # This file is part of GNU Make.
7 # GNU Make is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
12 # GNU Make is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Make; see the file COPYING.  If not, write to
19 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22 #       NMakefile for GNU Make
25 LINK = link
26 CC = cl
28 OUTDIR=.
29 MAKEFILE=NMakefile
30 SUBPROC_MAKEFILE=NMakefile
32 CFLAGS_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES
33 CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb
34 CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/ 
36 LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
37         /INCREMENTAL:no /PDB:WinRel/make.pdb /MACHINE:I386 /OUT:WinDebug/make.exe
38 LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\
39         /INCREMENTAL:no /MACHINE:I386 /OUT:WinRel/make.exe
41 all: subproc Release Debug
44 # Make sure we build the subproc library first. It has it's own
45 # makefile. To be portable to Windows 95, we put the instructions
46 # on how to build the library into a batch file. On NT, we could
47 # simply have done foo && bar && dog, but this doesn't port.
49 subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib
51 w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib:
52         subproc.bat $(SUBPROC_MAKEFILE)
54 Release: 
55         nmake /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe
56 Debug: 
57         nmake /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe
59 clean:
60         rmdir /s /q WinDebug WinRel
62 $(OUTDIR):
63         if not exist .\$@\nul mkdir .\$@
65 LIBS = kernel32.lib user32.lib advapi32.lib
67 OBJS = \
68         $(OUTDIR)/ar.obj \
69         $(OUTDIR)/arscan.obj \
70         $(OUTDIR)/commands.obj \
71         $(OUTDIR)/default.obj \
72         $(OUTDIR)/dir.obj \
73         $(OUTDIR)/expand.obj \
74         $(OUTDIR)/file.obj \
75         $(OUTDIR)/function.obj \
76         $(OUTDIR)/getloadavg.obj \
77         $(OUTDIR)/getopt.obj \
78         $(OUTDIR)/getopt1.obj \
79         $(OUTDIR)/implicit.obj \
80         $(OUTDIR)/job.obj \
81         $(OUTDIR)/main.obj \
82         $(OUTDIR)/misc.obj \
83         $(OUTDIR)/read.obj \
84         $(OUTDIR)/remake.obj \
85         $(OUTDIR)/remote-stub.obj \
86         $(OUTDIR)/rule.obj \
87         $(OUTDIR)/signame.obj \
88         $(OUTDIR)/variable.obj \
89         $(OUTDIR)/version.obj \
90         $(OUTDIR)/vpath.obj \
91         $(OUTDIR)/glob.obj \
92         $(OUTDIR)/fnmatch.obj \
93         $(OUTDIR)/dirent.obj \
94         $(OUTDIR)/pathstuff.obj
96 $(OUTDIR)/make.exe: $(OUTDIR) $(OBJS)
97         $(LINK) @<<
98                 $(LDFLAGS) $(LIBS) $(OBJS)
101 .c{$(OUTDIR)}.obj:
102         $(CC) $(CFLAGS) /c $<
103         
104 $(OUTDIR)/ar.obj : ar.c make.h filedef.h dep.h
105 $(OUTDIR)/arscan.obj : arscan.c make.h
106 $(OUTDIR)/commands.obj : commands.c
107 $(OUTDIR)/default.obj : default.c make.h rule.h dep.h filedef.h job.h commands.h variable.h
108 $(OUTDIR)/dir.obj :  dir.c make.h
109 $(OUTDIR)/expand.obj : expand.c make.h filedef.h job.h commands.h variable.h
110 $(OUTDIR)/file.obj : file.c make.h dep.h filedef.h job.h commands.h variable.h
111 $(OUTDIR)/function.obj : function.c make.h filedef.h variable.h dep.h job.h commands.h
112 $(OUTDIR)/getloadavg.obj : getloadavg.c
113 $(OUTDIR)/getopt.obj : getopt.c
114 $(OUTDIR)/getopt1.obj : getopt1.c getopt.h
115 $(OUTDIR)/implicit.obj : implicit.c make.h rule.h dep.h filedef.h
116 $(OUTDIR)/job.obj : job.c make.h job.h filedef.h commands.h variable.h
117 $(OUTDIR)/main.obj : main.c make.h dep.h filedef.h variable.h job.h commands.h getopt.h
118 $(OUTDIR)/misc.obj : misc.c make.h dep.h
119 $(OUTDIR)/read.obj : read.c make.h dep.h filedef.h job.h commands.h variable.h glob/glob.h
120 $(OUTDIR)/remake.obj : remake.c make.h filedef.h job.h commands.h dep.h
121 $(OUTDIR)/remote-stub.obj : remote-stub.c make.h filedef.h job.h commands.h
122 $(OUTDIR)/rule.obj : rule.c make.h dep.h filedef.h job.h commands.h variable.h rule.h
123 $(OUTDIR)/signame.obj : signame.c signame.h
124 $(OUTDIR)/variable.obj : variable.c make.h dep.h filedef.h job.h commands.h variable.h
125 $(OUTDIR)/version.obj : version.c
126 $(OUTDIR)/vpath.obj : vpath.c make.h filedef.h variable.h
127 $(OUTDIR)/glob.obj : glob/glob.c
128         $(CC) $(CFLAGS) /c $?
129 $(OUTDIR)/fnmatch.obj : glob/fnmatch.c
130         $(CC) $(CFLAGS) /c $?
131 $(OUTDIR)/dirent.obj : w32/compat/dirent.c
132         $(CC) $(CFLAGS) /c $?
133 $(OUTDIR)/pathstuff.obj : w32/pathstuff.c
134         $(CC) $(CFLAGS) /c $?