1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
#
# SPDX-FileCopyrightText: Copyright (C) 1987, 1988 Chuck Simmons
# SPDX-License-Identifier: GPL-2.0+
#
# See the file COPYING, distributed with empire, for restriction
# and warranty information.
VERS=$(shell sed -n <NEWS '/^[0-9]/s/:.*//p' | head -1)
# Use -g to compile the program for debugging.
#DEBUG = -g -DDEBUG
DEBUG = -O2
# Use -p to profile the program.
#PROFILE = -p -DPROFILE
PROFILE =
LIBS = -lncurses
# You shouldn't have to modify anything below this line.
# There's a dynamic format in the object-display routines; suppress the warning
CFLAGS = $(DEBUG) $(PROFILE) -Wall -Wno-format-security
FILES = \
attack.c \
compmove.c \
data.c \
display.c \
edit.c \
empire.c \
game.c \
main.c \
map.c \
math.c \
object.c \
term.c \
usermove.c \
util.c
HEADERS = empire.h extern.h
OFILES = \
attack.o \
compmove.o \
data.o \
display.o \
edit.o \
empire.o \
game.o \
main.o \
map.o \
math.o \
object.o \
term.o \
usermove.o \
util.o
all: vms-empire
vms-empire: $(OFILES)
$(CC) $(PROFILE) -o vms-empire $(OFILES) $(LIBS)
attack.o:: extern.h empire.h
compmove.o:: extern.h empire.h
data.o:: empire.h
display.o:: extern.h empire.h
edit.o:: extern.h empire.h
empire.o:: extern.h empire.h
game.o:: extern.h empire.h
main.o:: extern.h empire.h
map.o:: extern.h empire.h
math.o:: extern.h empire.h
object.o:: extern.h empire.h
term.o:: extern.h empire.h
usermove.o:: extern.h empire.h
util.o:: extern.h empire.h
empire.6: vms-empire.xml
xmlto man vms-empire.xml
vms-empire.html: vms-empire.xml
xmlto html-nochunks vms-empire.xml
TAGS: $(HEADERS) $(FILES)
etags $(HEADERS) $(FILES)
lint: $(FILES)
lint -u -D$(SYS) $(FILES) -lcurses
# This should run clean
cppcheck:
@cppcheck --quiet --inline-suppr --suppress=missingIncludeSystem --suppress=unusedFunction --template gcc --enable=all --force *.[ch]
install: empire.6 uninstall
install -m 0755 -d $(DESTDIR)/usr/bin
install -m 0755 -d $(DESTDIR)/usr/share/man/man6
install -m 0755 -d $(DESTDIR)/usr/share/applications/
install -m 0755 -d $(DESTDIR)/usr/share/icons/hicolor/48x48/apps/
install -m 0755 -d $(DESTDIR)/usr/share/appdata
install -m 0755 vms-empire $(DESTDIR)/usr/bin/
install -m 0644 empire.6 $(DESTDIR)/usr/share/man/man6/vms-empire.6
install -m 0644 vms-empire.desktop $(DESTDIR)/usr/share/applications/
install -m 0644 vms-empire.png $(DESTDIR)/usr/share/icons/hicolor/48x48/apps/
install -m 0644 vms-empire.xml $(DESTDIR)/usr/share/appdata/
uninstall:
rm -f /usr/bin/vms-empire /usr/share/man/man6/vms-empire.6
rm -f /usr/share/applications/vms-empire.desktop
rm -f /usr/share/icons/hicolor/48x48/apps/vms-empire.png
rm -f /usr/share/appdata/vms-empire.xml
clean:
rm -f *.o TAGS vms-empire
rm -f *.6 *.html
reflow:
@clang-format --style="{IndentWidth: 8, UseTab: ForIndentation}" -i $$(find . -name "*.[ch]")
clobber: clean
rm -f vms-empire vms-empire-*.tar*
SOURCES = README HACKING NEWS control empire.6 vms-empire.xml COPYING Makefile BUGS AUTHORS $(FILES) $(HEADERS) vms-empire.png vms-empire.desktop
vms-empire-$(VERS).tar.gz: $(SOURCES)
@ls $(SOURCES) | sed s:^:vms-empire-$(VERS)/: >MANIFEST
@(cd ..; ln -s vms-empire vms-empire-$(VERS))
(cd ..; tar -czf vms-empire/vms-empire-$(VERS).tar.gz `cat vms-empire/MANIFEST`)
@(cd ..; rm vms-empire-$(VERS))
dist: vms-empire-$(VERS).tar.gz
release: vms-empire-$(VERS).tar.gz vms-empire.html
shipper version=$(VERS) | sh -e -x
refresh: vms-empire.html
shipper -N -w version=$(VERS) | sh -e -x
|