-O3 for a program from 1981 is ridiculous.
[rogue-pphs.git] / Makefile
1 #
2 # Makefile for rogue
3 # %W% (Berkeley) %G%
4 #
5 # Rogue: Exploring the Dungeons of Doom
6 # Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman
7 # All rights reserved.
8 #
9 # See the file LICENSE.TXT for full copyright and licensing information.
10 #
11
12 DISTNAME=rogue3.6.3
13 PROGRAM=rogue36
14
15 O=o
16
17 HDRS= rogue.h machdep.h
18
19 OBJS1 = vers.$(O) armor.$(O) chase.$(O) command.$(O) daemon.$(O) daemons.$(O) \
20 fight.$(O) init.$(O) io.$(O) list.$(O) main.$(O) mdport.$(O) \
21 misc.$(O) monsters.$(O) move.$(O) newlevel.$(O) options.$(O)
22 OBJS2 = pack.$(O) passages.$(O) potions.$(O) rings.$(O) rip.$(O) rooms.$(O) \
23 save.$(O) scrolls.$(O) state.$(O) sticks.$(O) things.$(O) \
24 weapons.$(O) wizard.$(O) xcrypt.$(O)
25 OBJS = $(OBJS1) $(OBJS2)
26
27 CFILES= vers.c armor.c chase.c command.c daemon.c daemons.c fight.c \
28 init.c io.c list.c main.c mdport.c misc.c monsters.c move.c newlevel.c \
29 options.c pack.c passages.c potions.c rings.c rip.c rooms.c \
30 save.c scrolls.c state.c sticks.c things.c weapons.c wizard.c xcrypt.c
31
32
33 MISC_C=
34 DOCSRC= rogue.6 rogue.r
35 DOCS = $(PROGRAM).doc $(PROGRAM).cat $(PROGRAM).html readme36.html
36 MISC = Makefile $(MISC_C) LICENSE.TXT $(PROGRAM).sln $(PROGRAM).vcproj $(DOCS)\
37 $(DOCSRC)
38
39 CC = gcc
40 ROPTS =
41 COPTS = -g
42 CFLAGS= $(COPTS) $(ROPTS)
43 LIBS = -lcurses
44 RM = rm -f
45 LD = $(CC)
46 LDOUT = -o
47
48 .SUFFIXES: .obj
49
50 .c.obj:
51 $(CC) $(CFLAGS) /c $*.c
52
53 $(PROGRAM)$(EXE): $(HDRS) $(OBJS)
54 $(LD) $(LDFLAGS) $(OBJS) $(LIBS) $(LDOUT)$@
55
56 clean:
57 $(RM) $(OBJS1)
58 $(RM) $(OBJS2)
59 $(RM) core $(PROGRAM) $(PROGRAM).exe $(DISTNAME).tar $(DISTNAME).tar.gz
60 $(RM) $(DISTNAME).zip
61
62 dist.src:
63 make clean
64 tar cf $(DISTNAME)-src.tar $(CFILES) $(HDRS) $(MISC) $(DOCS)
65 gzip -f $(DISTNAME)-src.tar
66
67 dist.irix:
68 @$(MAKE) clean
69 @$(MAKE) CC=cc CFLAGS="-woff 1116 -O3" $(PROGRAM)
70 # tbl rogue.r | nroff -ms | colcrt - > $(PROGRAM).doc
71 # nroff -man rogue.6 | colcrt - > $(PROGRAM).cat
72 tar cf $(DISTNAME)-irix.tar $(PROGRAM) LICENSE.TXT $(DOCS)
73 gzip -f $(DISTNAME)-irix.tar
74
75 dist.aix:
76 @$(MAKE) clean
77 @$(MAKE) CC=xlc CFLAGS="-qmaxmem=16768 -O3 -qstrict" $(PROGRAM)
78 # tbl rogue.r | nroff -ms | colcrt - > $(ROGUE).doc
79 # nroff -man rogue.6 | colcrt - > $(ROGUE).cat
80 tar cf $(DISTNAME)-aix.tar $(PROGRAM) LICENSE.TXT $(DOCS)
81 gzip -f $(DISTNAME)-aix.tar
82
83 dist.linux:
84 @$(MAKE) clean
85 @$(MAKE) $(PROGRAM)
86 # groff -P-c -t -ms -Tascii rogue.r | sed -e 's/.\x08//g' > $(PROGRAM).doc
87 # groff -man rogue.6 | sed -e 's/.\x08//g' > $(PROGRAM).cat
88 tar cf $(DISTNAME)-linux.tar $(PROGRAM) LICENSE.TXT $(DOCS)
89 gzip -f $(DISTNAME)-linux.tar
90
91 dist.interix:
92 @$(MAKE) clean
93 @$(MAKE) COPTS="-ansi" $(PROGRAM)
94 # groff -P-b -P-u -t -ms -Tascii rogue.r > $(PROGRAM).doc
95 # groff -P-b -P-u -man -Tascii rogue.6 > $(PROGRAM).cat
96 tar cf $(DISTNAME)-interix.tar $(PROGRAM) LICENSE.TXT $(DOCS)
97 gzip -f $(DISTNAME)-interix.tar
98
99 dist.cygwin:
100 @$(MAKE) --no-print-directory clean
101 @$(MAKE) COPTS="-I/usr/include/ncurses" --no-print-directory $(PROGRAM)
102 # groff -P-c -t -ms -Tascii rogue.r | sed -e 's/.\x08//g' > $(PROGRAM).doc
103 # groff -P-c -man -Tascii rogue.6 | sed -e 's/.\x08//g' > $(PROGRAM).cat
104 tar cf $(DISTNAME)-cygwin.tar $(PROGRAM).exe LICENSE.TXT $(DOCS)
105 gzip -f $(DISTNAME)-cygwin.tar
106
107 #
108 # Use MINGW32-MAKE to build this target
109 #
110 dist.mingw32:
111 @$(MAKE) --no-print-directory RM="cmd /c del" clean
112 @$(MAKE) --no-print-directory COPTS="-I../pdcurses" LIBS="../pdcurses/pdcurses.a" $(PROGRAM)
113 cmd /c del $(DISTNAME)-mingw32.zip
114 zip $(DISTNAME)-mingw32.zip $(PROGRAM).exe LICENSE.TXT $(DOCS)
115
116 #
117 # Seperate doc targets for DJGPP prevent strange SIGSEGV in groff
118 # in that environment.
119 #
120 doc.djgpp:
121 groff -t -ms -Tascii rogue.r | sed -e 's/.\x08//g' > $(PROGRAM).doc
122
123 cat.djgpp:
124 groff -man -Tascii rogue.6 | sed -e 's/.\x08//g' > $(PROGRAM).cat
125
126 dist.djgpp:
127 @$(MAKE) --no-print-directory clean
128 @$(MAKE) --no-print-directory LDFLAGS="-L$(DJDIR)/LIB" \
129 LIBS="-lpdcur" $(PROGRAM)
130 # @$(MAKE) --no-print-directory doc.djgpp
131 # @$(MAKE) --no-print-directory cat.djgpp
132 rm -f $(DISTNAME)-djgpp.zip
133 zip $(DISTNAME)-djgpp.zip $(PROGRAM) LICENSE.TXT $(DOCS)
134
135 #
136 # Use NMAKE to build this target
137 #
138 dist.win32:
139 @$(MAKE) /NOLOGO O="obj" RM="-del" clean
140 @$(MAKE) /NOLOGO O="obj" CC="@CL" LD="link" LDOUT="/OUT:" EXE=".exe"\
141 LIBS="/NODEFAULTLIB:LIBC ..\pdcurses\pdcurses.lib shell32.lib user32.lib Advapi32.lib" \
142 COPTS="-nologo -D_CRT_SECURE_NO_DEPRECATE -I..\pdcurses \
143 -Ox -wd4033 -wd4716" $(PROGRAM).exe
144 -del $(DISTNAME)-win32.zip
145 zip $(DISTNAME)-win32.zip $(PROGRAM).exe LICENSE.TXT $(DOCS)