| 1 |
# File: Makefile.msys2 |
| 2 |
# Makefile for compiling Angband with ncurse using the msys2 shell in Windows |
| 3 |
# |
| 4 |
# Requirements: make, mingw-w64-x86_64-gcc, mingw-w64-x86_64-ncurses |
| 5 |
# |
| 6 |
# Run the following to compile: |
| 7 |
# |
| 8 |
# cd src |
| 9 |
# make -f Makefile.msys2 |
| 10 |
# |
| 11 |
# angband.exe is copied to the project root automatically |
| 12 |
# You can double click it to run angband |
| 13 |
# |
| 14 |
# Issue when opening ncurse application in msys2 shell: |
| 15 |
# https://sourceforge.net/p/msys2/discussion/general/thread/f81f0b97/ |
| 16 |
# |
| 17 |
# Even with "export TERM=xterm" and "export TERMINFO=/mingw64/share/terminfo", |
| 18 |
# the input is not working |
| 19 |
# |
| 20 |
# To run angband from msys2 shell: |
| 21 |
# start bash |
| 22 |
# export TERM= |
| 23 |
# ./angband.exe |
| 24 |
# |
| 25 |
|
| 26 |
# Executable name and default target |
| 27 |
EXE = angband.exe |
| 28 |
all: ../$(EXE) |
| 29 |
|
| 30 |
# Include list of object files |
| 31 |
include Makefile.inc |
| 32 |
|
| 33 |
CFLAGS = -DUSE_GCU -DWIN32_CONSOLE_MODE -DUSE_NCURSES -I$(NCURSES_INC) -static -DNCURSES_STATIC -DMSYS2_ENCODING_WORKAROUND |
| 34 |
LIBS = -s $(NCURSES_LIB) |
| 35 |
IOBJS = $(BASEOBJS) main-gcu.o main.o |
| 36 |
|
| 37 |
NCURSES_INC = /mingw64/include/ncurses |
| 38 |
NCURSES_LIB = /mingw64/lib/libncurses.a |
| 39 |
|
| 40 |
CC = gcc |
| 41 |
WRES = windres |
| 42 |
WARNINGS = -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers |
| 43 |
CFLAGS += $(WARNINGS) -std=c99 -DUSE_PRIVATE_PATHS -O2 -I. |
| 44 |
|
| 45 |
# This is an issue on mingw32 on linux |
| 46 |
CFLAGS += -D_stdcall= |
| 47 |
|
| 48 |
OBJS = $(IOBJS) |
| 49 |
|
| 50 |
# |
| 51 |
# Targets |
| 52 |
# |
| 53 |
|
| 54 |
../$(EXE): $(EXE) |
| 55 |
cp $(EXE) .. |
| 56 |
|
| 57 |
$(EXE): $(OBJS) |
| 58 |
$(CC) $(CFLAGS) -o $(EXE) $(OBJS) $(LIBS) |
| 59 |
|
| 60 |
clean: |
| 61 |
rm -f ../$(EXE) $(EXE) $(OBJS) |
| 62 |
|
| 63 |
|
| 64 |
# |
| 65 |
# Rules |
| 66 |
# |
| 67 |
|
| 68 |
win/$(PROGNAME).res: win/$(PROGNAME).rc |
| 69 |
$(WRES) $< -O coff -o $@ |
| 70 |
|
| 71 |
$(OBJDIR)%.o: %.c $(INCS) |
| 72 |
$(CC) $(CFLAGS) -c -o $@ $< |