2
## 05_makefile_logic.dpatch by Aaron Lehmann <aaronl@vitelus.com>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Move some of the logical burden to make
8
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
12
-patch) patch -f --no-backup-if-mismatch -p1 < $0;;
13
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
15
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
21
--- nethack-3.4.3/sys/unix/Makefile.src~ 2003-12-22 01:54:52.000000000 -0800
22
+++ nethack-3.4.3/sys/unix/Makefile.src 2003-12-22 01:55:01.000000000 -0800
26
# CFLAGS = -O2 -fomit-frame-pointer -I../include
27
-# LFLAGS = -L/usr/X11R6/lib
28
+LFLAGS = -L/usr/X11R6/lib
29
# OR compile backwards compatible a.out format
30
# CFLAGS = -O2 -b i486-linuxaout -fomit-frame-pointer -I../include
31
# LFLAGS = -b i486-linuxaout -L/usr/X11R6/lib
33
# directories. The ones given below is the usual spot for linux systems.
34
# The paths are for glibconfig.h and gnomesupport.h respectively.
36
-GNOMEINC=-I/usr/lib/glib/include -I/usr/lib/gnome-libs/include -I../win/gnome
37
+GNOMEINC=$(shell gnome-config --cflags gnomeui)
39
# flags for debugging:
40
# CFLAGS = -g -I../include
42
-CFLAGS = -O -I../include
45
# The Qt and Be window systems are written in C++, while the rest of
46
# NetHack is standard C. If using Qt, uncomment the LINK line here to get
47
# the C++ libraries linked in.
48
-CXXFLAGS = $(CFLAGS) -I. -I$(QTDIR)/include
50
+CXXFLAGS = $(CFLAGS) -I. -I$(QTDIR)/include/qt3
53
# For cross-compiling, eg. with gcc on Linux (see also CC further up):
55
# ../win/BeOS/NHMenuWindow.cpp ../win/BeOS/NHMapWindow.cpp tile.c
56
#WINBEOBJ = winbe.o NHWindow.o NHMenuWindow.o NHMapWindow.o tile.o
58
+# Files for the lisp port
59
+WINLISPSRC = ../win/lisp/winlisp.c tile.c
60
+WINLISPOBJ = winlisp.o tile.o
64
-WINSRC = $(WINTTYSRC)
65
-WINOBJ = $(WINTTYOBJ)
66
+ifeq ($(WIN),console)
67
+ WINSRC = $(WINTTYSRC)
68
+ WINOBJ = $(WINTTYOBJ)
69
+ WINLIB = $(WINTTYLIB)
72
+ WINSRC = $(WINTTYSRC) $(WINX11SRC)
73
+ WINOBJ = $(WINTTYOBJ) $(WINX11OBJ)
74
+ WINLIB = $(WINTTYLIB) $(WINX11LIB)
75
+ CFLAGS += -I/usr/X11R6/include -DX11_GRAPHICS
78
+ WINSRC = $(WINTTYSRC) $(WINGNOMESRC)
79
+ WINOBJ = $(WINTTYOBJ) $(WINGNOMEOBJ)
80
+ WINLIB = $(WINTTYLIB) $(WINGNOMELIB)
81
+ CFLAGS += -DGNOME_GRAPHICS
84
+ WINSRC = $(WINTTYSRC) $(WINQTSRC)
85
+ WINOBJ = $(WINTTYOBJ) $(WINQTOBJ)
86
+ WINLIB = $(WINTTYLIB) $(WINQTLIB)
87
+ CFLAGS += -DQT_GRAPHICS
90
+ WINSRC = $(WINLISPSRC)
91
+ WINOBJ = $(WINLISPOBJ)
92
+ WINLIB = $(WINLISPLIB)
93
+ CFLAGS += -DLISP_GRAPHICS -DDEFAULT_WINDOW_SYS=\"lisp\"
96
# on some systems the termcap library is in -ltermcap or -lcurses
97
# on 386 Xenix, the -ltermlib tputs() seems not to work; use -lcurses instead
99
# WINTTYLIB = -ltermcap
100
# WINTTYLIB = -lcurses
101
# WINTTYLIB = -lcurses16
102
-# WINTTYLIB = -lncurses
103
-WINTTYLIB = -ltermlib
104
+WINTTYLIB = -lncurses
105
+# WINTTYLIB = -ltermlib
108
# If USE_XPM is defined in config.h, you will also need -lXpm here.
109
-WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11
110
+WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11 -lm
111
# WINX11LIB = -lXaw -lXmu -lXt -lX11
112
# WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11 -lm
113
# WINX11LIB = -lXaw -lXmu -lXpm -lXext -lXt -lX11 -lSM -lICE -lm # BSD/OS 2.0
116
-WINQTLIB = -L$(QTDIR)/lib -lqt
117
+WINQTLIB = -L$(QTDIR)/lib -lqt-mt
119
# libraries for KDE (with Qt)
120
WINKDELIB = -lkdecore -lkdeui -lXext
122
# libraries for Gnome
123
-WINGNOMELIB = -lgnomeui -lgnome -lart_lgpl -lgtk -lgdk -lpopt
124
+WINGNOMELIB = $(shell gnome-config --libs gnomeui)
126
# libraries for Gem port
127
WINGEMLIB = -le_gem -lgem
132
-WINLIB = $(WINTTYLIB)
134
# any other strange libraries your system needs (for Sysunix only -- the more
135
# specialized targets should already be right)
138
GENCSRC = monstr.c vis_tab.c #tile.c
140
# all windowing-system-dependent .c (for dependencies and such)
141
-WINCSRC = $(WINTTYSRC) $(WINX11SRC) $(WINGNOMESRC) $(WINGEMSRC)
142
+WINCSRC = $(WINTTYSRC) $(WINX11SRC) $(WINGNOMESRC) $(WINGEMSRC) $(WINLISPSRC)
143
# all windowing-system-dependent .cpp (for dependencies and such)
144
WINCXXSRC = $(WINQTSRC) $(WINBESRC)
147
$(CC) $(CFLAGS) -c ../win/gem/load_img.c
148
gr_rect.o: ../win/gem/gr_rect.c ../include/gr_rect.h
149
$(CC) $(CFLAGS) -c ../win/gem/gr_rect.c
150
+winlisp.o: ../win/lisp/winlisp.c $(HACK_H) ../include/winlisp.h \
151
+ ../include/func_tab.h ../include/dlb.h ../include/patchlevel.h
152
+ $(CC) $(CFLAGS) -c ../win/lisp/winlisp.c
153
tile.o: tile.c $(HACK_H)
154
qt_win.o: ../win/Qt/qt_win.cpp $(HACK_H) ../include/func_tab.h \
155
../include/dlb.h ../include/patchlevel.h ../include/tile2x11.h \
157
weapon.o: weapon.c $(HACK_H)
158
were.o: were.c $(HACK_H)
159
wield.o: wield.c $(HACK_H)
160
-windows.o: windows.c $(HACK_H) ../include/wingem.h ../include/winGnome.h
161
+windows.o: windows.c $(HACK_H) ../include/wingem.h ../include/winGnome.h \
162
+ ../include/winlisp.h
163
wizard.o: wizard.c $(HACK_H) ../include/qtext.h ../include/epri.h
164
worm.o: worm.c $(HACK_H) ../include/lev.h
165
worn.o: worn.c $(HACK_H)