Changeset 6
- Timestamp:
- 03/24/07 07:23:28 (2 years ago)
- Files:
-
- trunk/src/Makefile.std (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/Makefile.std
r3 r6 12 12 # "config", in which case that file will override what is specified here. 13 13 # 14 # If you used to use Makefile.gtk or Makefile.lsl, then just change the below15 # SYS_gtk or SYS_lsl option to "true", and set the others to "false".14 # If you used to use Makefile.gtk or Makefile.lsl, uncomment the appropriate 15 # lines below. 16 16 # 17 17 18 18 #### Things you should, or could, change #### 19 19 20 20 21 # What systems to try. 21 22 # 22 23 # By default, this tries to compile both the X11 and "curses" terminal mode 23 # ports in the same executable. 24 25 SYS_x11 = true 26 SYS_gcu = true 27 SYS_xaw = false 28 SYS_gtk = false 29 SYS_cap = false 30 SYS_lsl = false 31 SYS_sla = false 32 SYS_vcs = false # Linux only, AFAIK 33 SYS_lfb = false # Linux only 34 SYS_xpj = false # Still experimental, and requires X11/Xaw/GTK to be enabled 24 # ports in the same executable. On Linux only, it also builds the lfb 'console' 25 # module. 26 27 # IMPORTANT: leave space between '= -D' 28 SYS_x11 = -DUSE_X11 29 SYS_gcu = -DUSE_GCU -DUSE_NCURSES 30 #SYS_xaw = -DUSE_XAW # alternate X11 library 31 #SYS_gtk = $(shell gtk-config --cflags) -DUSE_GTK 32 #SYS_sla = -DUSE_SLA -I/usr/include/slang 33 #SYS_lsl = -DUSE_LSL # Linux only 34 #SYS_vcs = -DUSE_VCS # Linux only 35 SYS_lfb = -DUSE_LFB # Linux only (see below) 36 #SYS_xpj = -DUSE_XPJ # Experimental. requires X11/Xaw/GTK to be enabled 37 35 38 36 39 # Basic compiler stuff 37 40 CC = gcc 38 CFLAGS = -Wall -O2 -g -fno-strength-reduce 41 CFLAGS = -Wall -O2 -fno-strength-reduce 42 EXE = angband # Executable name 39 43 40 44 … … 44 48 -include config 45 49 46 # Eventually we'll have a mini-config tester here, but until then... 47 48 ## Disable X11 if necessary 49 #ifneq ($(shell $(CC) -lX11 2&>/dev/null && echo -n "c"),c) 50 # SYS_x11 = false 51 #endif 52 # 53 ## Disable GCU if necessary 54 #ifneq ($(shell $(CC) -lncurses 2&>/dev/null && echo -n "c"),c) 55 # SYS_gcu = false 56 #endif 57 # 58 50 # Enable what needs enabling 51 CFLAGS += $(SYS_x11)$(SYS_gcu)$(SYS_xaw)$(SYS_gtk)$(SYS_cap)$(SYS_sla)$(SYS_xpj) 52 53 54 # Check for OS 59 55 uname = $(shell uname) 60 56 61 # Disable non-Linux ports on non-Linux 62 ifneq ($(uname),Linux) 63 SYS_lfb = false 64 65 # Enable mkstemp() also 66 else 67 CFLAGS += -DHAVE_MKSTEMP 68 endif 69 70 # Disable XPJ without X11/Xaw/GTK 71 ifeq ($(SYS_x11),false) 72 ifeq ($(SYS_gtk),false) 73 ifeq ($(SYS_xaw),false) 74 SYS_xpj = false 75 endif 76 endif 77 endif 57 # Enable linux-specific modules, if requested. 58 ifeq ($(uname),Linux) 59 CFLAGS += -DHAVE_MKSTEMP $(SYS_lsl)$(SYS_lfb)$(SYS_vcs) 60 endif 61 78 62 79 63 … … 87 71 # " -I/usr/X11R6/include", or "-L/usr/X11R6/lib" to LIBS. 88 72 # 89 ifeq ($(SYS_x11),true) 90 CFLAGS += -DUSE_X11 73 ifneq ($(SYS_x11),) 91 74 LIBS += -lX11 92 75 endif … … 97 80 # 98 81 # If this fails, try replacing "-lncurses" with "-lcurses -ltermcap", 99 # and removing "-DUSE_NCURSES" .82 # and removing "-DUSE_NCURSES" 100 83 # 101 84 # See "main-gcu.c" and "config.h" for some optional "curses" defines, … … 105 88 # You may have to add " -I/usr/include/ncurses" to CFLAGS. 106 89 # 107 ifeq ($(SYS_gcu),true) 108 CFLAGS += -DUSE_GCU -DUSE_NCURSES 90 ifneq ($(SYS_gcu),) 109 91 LIBS += -lncurses 110 92 endif … … 114 96 # Support main-xaw.c 115 97 # 116 ifeq ($(SYS_xaw),true) 117 CFLAGS += -DUSE_XAW 98 ifneq ($(SYS_xaw),) 118 99 LIBS += -lXaw -lXext -lSM -lICE -lXmu -lXt -lX11 119 100 endif … … 125 106 # Note: gtk-config adds GTK and X11 includes and libraries as appropriate. 126 107 # 127 ifeq ($(SYS_gtk),true) 128 CFLAGS += `gtk-config --cflags` -DUSE_GTK 108 ifneq ($(SYS_gtk),) 129 109 LIBS += `gtk-config --libs` 130 110 endif 131 111 132 133 #134 # Support main-cap.c135 #136 # If you want this to work on simple vt100 terminals, add " -DUSE_HARDCODE"137 # to CFLAGS.138 #139 ifeq ($(SYS_cap),true)140 CFLAGS += -DUSE_CAP141 LIBS += -ltermcap142 endif143 144 145 112 # 146 113 # Support main-lsl.c 147 114 # 148 ifeq ($(SYS_lsl),true) 149 CFLAGS += -DUSE_LSL 115 ifneq ($(SYS_lsl),) 150 116 LIBS += -lz -lvgagl -lvga 151 117 endif 152 118 153 154 #155 # Support main-vcs.c156 #157 ifeq ($(SYS_vcs),true)158 CFLAGS += -DUSE_VCS159 endif160 161 162 119 # 163 120 # Support main-sla.c 164 121 # 165 ifeq ($(SYS_sla),true) 166 CFLAGS += -DUSE_SLA -I/usr/include/slang 122 ifneq ($(SYS_sla),) 167 123 LIBS += -lslang 168 124 endif 169 125 170 171 #172 # Support main-lfb.c173 #174 ifeq ($(SYS_lfb),true)175 CFLAGS += -DUSE_LFB176 endif177 178 179 #180 # Support main-xpj.c181 #182 ifeq ($(SYS_xpj),true)183 CFLAGS += -DUSE_XPJ184 endif185 126 186 127 … … 228 169 229 170 230 ##231 ## Variation -- Support fat binaries under NEXTSTEP232 ##233 #CFLAGS = -D"USE_GCU" -arch m68k -arch i386234 #LIBS = -lcurses -ltermcap235 236 237 171 238 172 #### Targets and objects ##### 239 173 240 # Set a target here241 174 default: angband 242 175 243 # Makefile.inc contains an up-to-date set of object files to compile, so 244 # we include it 176 # Include the set of object files, and add platform files 245 177 OBJEXT=.o 246 178 include Makefile.inc 247 248 179 OBJS = $(BASEOBJS) \ 249 180 main-cap.o main-gcu.o main-x11.o main-xaw.o main.o \ … … 252 183 253 184 254 # 255 # Targets 256 # 257 258 # Build the "Angband" program 185 # Build Angband 259 186 angband: $(OBJS) 260 $(CC) $(CFLAGS) $(LDFLAGS) -o angband$(OBJS) $(LIBS)187 $(CC) $(CFLAGS) $(LDFLAGS) -o $(EXE) $(OBJS) $(LIBS) 261 188 262 189 # Install the game. 263 install: ../ angband264 265 ../ angband: angband266 cp angband ..190 install: ../$(EXE) 191 192 ../$(EXE): $(EXE) 193 cp $(EXE) ../ 267 194 268 195 # Clean up old junk
