Debian Codegraph @

debian/patches/fix-make-clean

raw
1 --- a/Makefile
2 +++ b/Makefile
3 @@ -4,17 +4,17 @@
4 LIBDIR = $(DESTDIR)/usr/share/games/omega-rpg
5
6 ### choose your optimization level
7 -OFLAGS = -O2 -pipe
8 +CFLAGS ?= -O2 -pipe
9
10 ### One of these should be uncommented, as appropriate, unless your compiler
11 ### does it for you. You can test this by simply trying to 'make' omega -
12 ### it will fail if none of them are defined. If you do uncomment
13 ### one, make sure you comment out the other definition of CFLAGS lower down
14
15 -CFLAGS = -Wall $(OFLAGS) -DBSD # -ansi
16 -#CFLAGS = -DSYSV $(OFLAGS)
17 -#CFLAGS = -DMSDOS $(OFLAGS)
18 -#CFLAGS = -DAMIGA $(OFLAGS)
19 +OPTS = -DBSD
20 +#OPTS = -DSYSV
21 +#OPTS = -DMSDOS
22 +#OPTS = -DAMIGA
23
24 ### CPP should contain the command to run the C preprocessor.
25 #CPP = cc -E
26 @@ -58,8 +58,11 @@
27
28 all: maps.dat omega
29
30 +.c.o:
31 + $(CC) $(CFLAGS) $(CPPFLAGS) $(OPTS) $< -c -o $@
32 +
33 omega: $(CUROBJ) $(CLROBJ) $(OBJ)
34 - $(CC) $(LDFLAGS) $(OFLAGS) $(CUROBJ) $(CLROBJ) $(OBJ) $(LIBS) -o omega
35 + $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) $(CUROBJ) $(CLROBJ) $(OBJ) $(LIBS) -o omega
36 #rm date.c date.o
37
38 date.c:
39 @@ -69,7 +72,8 @@
40 cd tools; make
41 cd tools/libsrc; make maps.dat
42
43 -install: omega maps.dat $(BINDIR) $(LIBDIR)
44 +install: omega maps.dat
45 + mkdir -p $(BINDIR) $(LIBDIR)
46 cp omega $(BINDIR)/omega-rpg
47 chmod 4711 $(BINDIR)/omega-rpg
48 - cp lib/* $(LIBDIR)
49 @@ -78,7 +82,8 @@
50 chmod 0600 $(LIBDIR)/abyss.txt $(LIBDIR)/scroll[1234].txt $(LIBDIR)/maps.dat
51 chmod 0600 $(LIBDIR)/omega.hi $(LIBDIR)/omega.log $(LIBDIR)/omega.hi.backup
52
53 -install_not_suid: omega maps.dat $(BINDIR) $(LIBDIR)
54 +install_not_suid: omega maps.dat
55 + mkdir -p $(BINDIR) $(LIBDIR)
56 cp omega $(BINDIR)/omega-rpg
57 chmod 0711 $(BINDIR)/omega-rpg
58 - cp lib/* $(LIBDIR)
59 @@ -89,13 +94,13 @@
60 chmod 0600 $(LIBDIR)/omega.hi.backup
61
62 clean:
63 - rm -f $(OBJ) $(CLROBJ) clrgen.h clrgen.c genclr.o genclr omega
64 + rm -f $(OBJ) $(CLROBJ) clrgen.h clrgen.c clrgen.o genclr.o genclr test omega
65 cd tools; $(MAKE) clean
66 cd tools/libsrc; $(MAKE) clean
67 cd lib; $(MAKE) clean
68
69 distclean:
70 - rm -f $(OBJ) $(CUROBJ) $(TOOLS) $(OLIBSTUFF) clrgen.h clrgen.c genclr.o genclr omega
71 + rm -f $(OBJ) $(CUROBJ) $(TOOLS) $(OLIBSTUFF) clrgen.h clrgen.c clrgen.o genclr.o genclr test omega
72 cp lib/omega.hi.backup lib/omega.hi
73 cp lib/omega.log.backup lib/omega.log
74
75 --- a/tools/makefile
76 +++ b/tools/makefile
77 @@ -8,18 +8,19 @@
78 # and given names such as 'city.dat'; these names are the passwords which
79 # crypt is expecting.
80
81 -CC = gcc -g -Wall -O2 -ansi
82 +CC ?= gcc
83 +CFLAGS ?= -g -Wall -O2 -ansi
84
85 all: crypt decrypt makedate
86
87 crypt: crypt.c
88 - $(CC) $(CFLAGS) crypt.c bwt.c -o crypt
89 + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) crypt.c bwt.c -o crypt
90
91 decrypt: decrypt.c
92 - $(CC) $(CFLAGS) decrypt.c -o decrypt
93 + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) decrypt.c -o decrypt
94
95 makedate: makedate.c
96 - $(CC) $(CFLAGS) makedate.c -o makedate
97 + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) makedate.c -o makedate
98
99 clean:
100 rm -f crypt decrypt makedate