| 1 |
# Windows Angband makefile for NMAKE and MS Visual C |
| 2 |
# |
| 3 |
# Debug build: NMAKE /F Makefile.nmake |
| 4 |
# Release build: NMAKE /F Makefile.nmake RELEASE=1 |
| 5 |
|
| 6 |
|
| 7 |
default: executables |
| 8 |
|
| 9 |
|
| 10 |
# tools and config |
| 11 |
CC = cl |
| 12 |
LINK = link |
| 13 |
RC = rc |
| 14 |
# _CRT_SECURE_NO_WARNINGS is to disable deprecation warnings about strtok(), |
| 15 |
# localtime(), ctime(), _open(), fopen(), mbstowcs(), and wctomb(). |
| 16 |
CFLAGS = /DWINDOWS /D_CRT_SECURE_NO_WARNINGS /W3 /GF /GA /nologo /DALLOW_BORG |
| 17 |
LFLAGS = /nologo |
| 18 |
RCFLAGS = |
| 19 |
LIBS = Msimg32.lib Gdi32.lib User32.lib Comdlg32.lib Shell32.lib Winmm.lib \ |
| 20 |
win\lib\libpng.lib win\lib\zlib.lib |
| 21 |
|
| 22 |
!if defined(RELEASE) |
| 23 |
CFLAGS = $(CFLAGS) /O2 /Os /Gs /I. /I.. /Iwin\include |
| 24 |
!else |
| 25 |
CFLAGS = $(CFLAGS) /Od /Zi /I. /I.. /Iwin\include |
| 26 |
LFLAGS = $(LFLAGS) /debug |
| 27 |
!endif |
| 28 |
|
| 29 |
|
| 30 |
# files |
| 31 |
include Makefile.src |
| 32 |
EXE = $(NAME).exe |
| 33 |
OBJS = $(ANGFILES) $(ZFILES) $(WINMAINFILES) |
| 34 |
RES = win\$(PROGNAME).res |
| 35 |
|
| 36 |
|
| 37 |
# rules |
| 38 |
.c.o: |
| 39 |
$(CC) /c /Fo$@ $(CFLAGS) $? |
| 40 |
# Handle as a special case to avoid warnings about the .o files it depends upon. |
| 41 |
buildid.o: |
| 42 |
$(CC) /c /Fo$@ $(CFLAGS) $*.c |
| 43 |
$(RES) : win\$(PROGNAME).rc |
| 44 |
$(RC) $(RCFLAGS) $** |
| 45 |
|
| 46 |
$(EXE) : $(OBJS) |
| 47 |
$(LINK) /out:$@ $(LFLAGS) $** $(LIBS) |
| 48 |
|
| 49 |
executables: ..\$(EXE) |
| 50 |
..\$(EXE) : $(EXE) |
| 51 |
copy $** $@ |
| 52 |
|
| 53 |
clean: |
| 54 |
del $(OBJS) $(RES) $(EXE) |