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