| 1 |
# File: Makefile.ibm |
| 2 |
# |
| 3 |
# This makefile probably requires GNU make. |
| 4 |
# |
| 5 |
# You can also place your alterations to a file in the src/ directory called |
| 6 |
# "config", in which case that file will override what is specified here. |
| 7 |
# |
| 8 |
|
| 9 |
#### Things you should, or could, change #### |
| 10 |
|
| 11 |
# Basic compiler stuff |
| 12 |
CC = i586-pc-msdosdjgpp-gcc |
| 13 |
WARNINGS = -W -Wall -Wextra -Wold-style-definition -Wmissing-declarations -Wredundant-decls -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wformat-security -Winit-self -Wmissing-include-dirs -Wundef -Wmissing-format-attribute -Wnested-externs -Wunreachable-code -Wno-unused-parameter -Wno-missing-field-initializers |
| 14 |
CFLAGS = -O2 -D'iswprint(...)=0' -D'wcschr(...)=NULL' -D'wcslen(...)=0' $(WARNINGS) |
| 15 |
|
| 16 |
# Add additional search directives here |
| 17 |
INCLUDES = -I. |
| 18 |
LIBS = -lpc |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#### Things you probably shouldn't change, unless there is a problem #### |
| 24 |
|
| 25 |
# Import user prefs |
| 26 |
# If you don't want to edit this file, put your module redefinitions |
| 27 |
# and build flags in "./config" |
| 28 |
-include config |
| 29 |
|
| 30 |
|
| 31 |
# Extract CFLAGS and LIBS from the system definitions |
| 32 |
CFLAGS += $(INCLUDES) -DUSE_IBM |
| 33 |
|
| 34 |
# Object definitions |
| 35 |
MAINOBJS = main-ibm.o main.o |
| 36 |
OBJS = $(BASEOBJS) main-ibm.o main-stats.o main.o |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
#### Targets and objects ##### |
| 42 |
|
| 43 |
# By default, copy the executable to ../ so that you don't find |
| 44 |
# yourself debugging a stale copy. |
| 45 |
default: edit install |
| 46 |
|
| 47 |
# Makefile.inc contains an up-to-date set of object files to compile, so |
| 48 |
# we include it |
| 49 |
include Makefile.inc |
| 50 |
|
| 51 |
# Version info |
| 52 |
EXE = angband.exe |
| 53 |
|
| 54 |
|
| 55 |
# |
| 56 |
# Targets |
| 57 |
# |
| 58 |
|
| 59 |
# Build the "Angband" program |
| 60 |
$(EXE): $(OBJS) |
| 61 |
@printf "%10s %-20s\n" LINK $@ |
| 62 |
@$(CC) $(CFLAGS) $(LDFLAGS) -o $(EXE) $(OBJS) $(LIBS) |
| 63 |
|
| 64 |
|
| 65 |
# Install the game. |
| 66 |
install: ../$(EXE) |
| 67 |
|
| 68 |
docs: |
| 69 |
cd ../docs && DOC_HTML_THEME=alabaster sphinx-build -M text . _build |
| 70 |
|
| 71 |
edit: |
| 72 |
@touch langinfo.h |
| 73 |
@sed -i generate.c -e 's/"dungeon_profile"/"dungeon_"/' -e 's/"room_template"/"room_tem"/' |
| 74 |
@sed -i init.c -e 's/"constants"/"constant"/' -e 's/"customize"/"customiz"/' -e 's/"player_property"/"player_p"/' |
| 75 |
@sed -i mon-init.c -e 's/"blow_effects"/"blow_eff"/' -e 's/"blow_methods"/"blow_met"/' -e 's/"monster_base"/"monster_"/' -e 's/"monster_spell"/"monster2"/' |
| 76 |
@sed -i obj-chest.c -e 's/"chest_trap"/"chest_tr"/' |
| 77 |
@sed -i obj-init.c -e 's/"activation"/"activati"/' -e 's/"object_base"/"object_b"/' -e 's/"object_property"/"object_p"/' -e 's/"projection"/"projecti"/' |
| 78 |
@sed -i player-timed.c -e 's/"player_timed"/"player_t"/' -e 's/"player timed effects"/"player_t"/' |
| 79 |
@sed -i ui-entry.c -e 's/"ui_entry_base"/"uientryb"/' |
| 80 |
@sed -i ui-entry-renderers.c -e 's/"ui_entry_renderer"/"uientryr"/' |
| 81 |
|
| 82 |
../$(EXE): $(EXE) |
| 83 |
cp $(EXE) .. |
| 84 |
|
| 85 |
# Clean up old junk |
| 86 |
clean: |
| 87 |
-rm -f $(OBJS) $(EXE) |
| 88 |
-rm -f ../lib/data/*.raw |
| 89 |
|
| 90 |
# make a distribution |
| 91 |
DIRS = lib/gamedata lib/customiz lib/help lib/screens lib/fonts lib/tiles/old \ |
| 92 |
lib/sounds lib/icons lib/user lib/save lib/scores lib/info lib/archive \ |
| 93 |
docs |
| 94 |
|
| 95 |
TMPDIR = ./angband |
| 96 |
dist: |
| 97 |
@-rm -rf $(TMPDIR) |
| 98 |
@echo making directories... |
| 99 |
@for i in $(DIRS) ; do mkdir -p $(TMPDIR)/$$i ; done |
| 100 |
@echo copying files... |
| 101 |
@cp ../docs/_build/text/*.txt $(TMPDIR)/docs 2>/dev/null || true |
| 102 |
@cp ../lib/customize/*.prf $(TMPDIR)/lib/customiz |
| 103 |
@cp ../lib/gamedata/*.txt $(TMPDIR)/lib/gamedata |
| 104 |
@cd $(TMPDIR)/lib/gamedata ; for i in *.txt ; do iconv -f UTF-8 -t CP437//TRANSLIT $$i -o $$i.new ; mv $$i.new $$i ; done |
| 105 |
@mv $(TMPDIR)/lib/gamedata/activation.txt $(TMPDIR)/lib/gamedata/activati.txt |
| 106 |
@mv $(TMPDIR)/lib/gamedata/blow_effects.txt $(TMPDIR)/lib/gamedata/blow_eff.txt |
| 107 |
@mv $(TMPDIR)/lib/gamedata/blow_methods.txt $(TMPDIR)/lib/gamedata/blow_met.txt |
| 108 |
@mv $(TMPDIR)/lib/gamedata/chest_trap.txt $(TMPDIR)/lib/gamedata/chest_tr.txt |
| 109 |
@mv $(TMPDIR)/lib/gamedata/constants.txt $(TMPDIR)/lib/gamedata/constant.txt |
| 110 |
@mv $(TMPDIR)/lib/gamedata/dungeon_profile.txt $(TMPDIR)/lib/gamedata/dungeon_.txt |
| 111 |
@mv $(TMPDIR)/lib/gamedata/monster_base.txt $(TMPDIR)/lib/gamedata/monster_.txt |
| 112 |
@mv $(TMPDIR)/lib/gamedata/monster_spell.txt $(TMPDIR)/lib/gamedata/monster2.txt |
| 113 |
@mv $(TMPDIR)/lib/gamedata/old_class.txt $(TMPDIR)/lib/gamedata/old_clas.txt |
| 114 |
@mv $(TMPDIR)/lib/gamedata/object_base.txt $(TMPDIR)/lib/gamedata/object_b.txt |
| 115 |
@mv $(TMPDIR)/lib/gamedata/object_property.txt $(TMPDIR)/lib/gamedata/object_p.txt |
| 116 |
@mv $(TMPDIR)/lib/gamedata/player_property.txt $(TMPDIR)/lib/gamedata/player_p.txt |
| 117 |
@mv $(TMPDIR)/lib/gamedata/player_timed.txt $(TMPDIR)/lib/gamedata/player_t.txt |
| 118 |
@mv $(TMPDIR)/lib/gamedata/projection.txt $(TMPDIR)/lib/gamedata/projecti.txt |
| 119 |
@mv $(TMPDIR)/lib/gamedata/room_template.txt $(TMPDIR)/lib/gamedata/room_tem.txt |
| 120 |
@mv $(TMPDIR)/lib/gamedata/ui_entry_base.txt $(TMPDIR)/lib/gamedata/uientryb.txt |
| 121 |
@mv $(TMPDIR)/lib/gamedata/ui_entry_renderer.txt $(TMPDIR)/lib/gamedata/uientryr.txt |
| 122 |
@cp ../lib/help/*.txt $(TMPDIR)/lib/help |
| 123 |
@cp ../lib/screens/*.txt $(TMPDIR)/lib/screens |
| 124 |
@echo attempting to install sound and graphics |
| 125 |
@cp ../lib/tiles/old/*.prf $(TMPDIR)/lib/tiles/old |
| 126 |
@iconv -f UTF-8 -t CP437//TRANSLIT -o $(TMPDIR)/changes.txt ../changes.txt |
| 127 |
@cp ../README.md $(TMPDIR) |
| 128 |
@cp $(EXE) $(TMPDIR) |
| 129 |
zip -r ../angband.zip $(TMPDIR) |
| 130 |
rm -rf $(TMPDIR) |
| 131 |
|
| 132 |
|
| 133 |
# Verify module arguments |
| 134 |
args: |
| 135 |
@echo CFLAGS = $(CFLAGS) |
| 136 |
@echo LIBS = $(LIBS) |
| 137 |
|
| 138 |
|
| 139 |
# Generate dependencies automatically |
| 140 |
depend: |
| 141 |
makedepend -D__MAKEDEPEND__ $(SRCS) |
| 142 |
|
| 143 |
|
| 144 |
# Some file dependencies |
| 145 |
%.o: %.c |
| 146 |
@printf "%10s %-20s\n" CC $< |
| 147 |
@$(CC) $(CFLAGS) -o $@ -c $< |
| 148 |
|
| 149 |
|
| 150 |
# Basic dependencies for main-xxx.c, main.c |
| 151 |
$(MAINOBJS) : main.h $(HEADERS) |
| 152 |
|
| 153 |
# fake Dependency |
| 154 |
doc/index.html: $(HEADERS) |
| 155 |
doxygen doc/doxygen.conf |