root/trunk/src/Makefile.std

Revision 171, 4.2 kB (checked in by takkaria, 3 years ago)
  • Dump squelch and autoinscribe settings as part of the options dump.
  • Make version numbers more centralised
  • Nuke MAINTAINER define, update bugs address
  • Property svn:mime-type set to text/plain
  • Property svn:eol-style set to LF
Line 
1 # File: Makefile.std
2 # Standard makefile for Angband.
3 #
4 # This makefile probably requires GNU make.
5 #
6 # This makefile is intended for use with Unix machines running X11, gtk or
7 # (n)curses.  You can choose which you want to compile for below.
8 #
9 # You can also place your alterations to a file in the src/ directory called
10 # "config", in which case that file will override what is specified here.
11 #
12
13 #### Things you should, or could, change ####
14
15
16 # What systems to try.
17 #
18 # By default, this tries to compile both the X11 and "curses" terminal mode
19 # ports in the same executable.  On Linux only, it also builds the lfb 'console'
20 # module.
21
22
23 # Recent, known-to-work ports
24
25 # Support X11 (main-x11.c)
26 # You may have to add various X11 include/library directories to the
27 # "CFLAGS", if your machine places files in a weird location, for example
28 # " -I/usr/X11R6/include", or "-L/usr/X11R6/lib" to LIBS.
29 SYS_x11 = -DUSE_X11 -lX11
30
31 # Support curses console mode (main-gcu.c)
32 # If this fails, try the alternate below
33 SYS_gcu = -DUSE_GCU -DUSE_NCURSES -lncurses
34 #SYS_gcu = -DUSE_GCU -lcurses -ltermcap
35
36 # Support Xaw motif (main-xaw.c)
37 #SYS_xaw = -DUSE_XAW -lXaw -lXext -lSM -lICE -lXmu -lXt -lX11
38
39 # Support the GTK2 graphical tookit (main-gtk.c)
40 SYS_gtk = -DUSE_GTK $(shell pkg-config gtk+-2.0 --libs --cflags)
41
42 # Support SDL frontend
43 #SYS_sdl = -DUSE_SDL $(shell sdl-config --cflags) $(shell sdl-config --libs) -lSDL_ttf
44
45
46
47
48 ## Support SDL_mixer for sound
49 #SOUND_sdl = -DSOUND_SDL $(shell sdl-config --cflags) $(shell sdl-config --libs) -lSDL_mixer
50
51
52
53 # Basic compiler stuff
54 CC = gcc
55 CFLAGS = -Wall -O2 -Wno-unused-parameter
56
57
58 # Add additional search directives here
59 # Example: -I/usr/X11R6/include -I/usr/include/ncurses
60 INCLUDES =
61 # Example: -L/usr/X11R6/lib
62 LIBS =
63
64
65 # Version info
66 EXE = angband
67
68
69
70 #### Things you probably shouldn't change, unless there is a problem ####
71
72 # Import user prefs
73 # If you don't want to edit this file, put your module redefinitions
74 # and build flags in "./config"
75 -include config
76
77
78 # Extract CFLAGS and LIBS from the system definitions
79 MODULES = $(SYS_x11) $(SYS_gcu) $(SYS_xaw) $(SYS_gtk) $(SYS_sdl) $(SOUND_sdl)
80 CFLAGS += $(patsubst -l%,,$(MODULES)) $(INCLUDES)
81 LIBS += $(patsubst -D%,,$(patsubst -I%,, $(MODULES)))
82
83
84 # Extract system we're running on
85 uname = $(shell uname -s)
86
87 # Enable linux-specific modules, if requested.
88 ifeq ($(uname),Linux)
89   CFLAGS += -DHAVE_MKSTEMP
90 endif
91
92
93 # Object definitions
94 X11OBJS = maid-x11.o main-x11.o main-xaw.o main-gtk.o
95 MAINOBJS = main.o main-gcu.o main-sdl.o snd-sdl.o $(X11OBJS)
96 OBJS = $(BASEOBJS) $(MAINOBJS)
97
98
99
100
101 #### Targets and objects #####
102
103 # By default, copy the executable to ../ so that you don't find
104 # yourself debugging a stale copy.
105 default: install
106
107 # Makefile.inc contains an up-to-date set of object files to compile, so
108 # we include it
109 OBJEXT=.o
110 include Makefile.inc
111
112
113 #
114 # Targets
115 #
116
117 # Build the "Angband" program
118 $(EXE): $(OBJS)
119         $(CC) $(CFLAGS) $(LDFLAGS) -o $(EXE) $(OBJS) $(LIBS)
120
121 # Install the game.
122 install: ../$(EXE)
123
124
125 ../$(EXE): $(EXE)
126         cp $(EXE) ..
127
128 # Clean up old junk
129 clean:
130         -rm -f *.o $(EXE)
131
132 # make a distribution
133 DIRS = lib/apex lib/bone lib/data lib/edit lib/file lib/help lib/info \
134        lib/pref lib/save lib/user lib/xtra/sound lib/xtra/graf lib/xtra/font
135
136 TMPDIR = ./$(EXE)-$(VERSION)
137 dist:
138         @-rm -rf $(TMPDIR)
139         @echo making directories...
140         @for i in $(DIRS) ; do mkdir -p $(TMPDIR)/$$i ; done
141         @echo copying files...
142         @cp ../lib/edit/*.txt $(TMPDIR)/lib/edit
143         @cp ../lib/file/*.txt $(TMPDIR)/lib/file
144         @cp ../lib/help/*.txt ../lib/help/*.hlp $(TMPDIR)/lib/help
145         @cp ../lib/pref/*.prf $(TMPDIR)/lib/pref
146         @cp ../lib/xtra/font/*.txt $(TMPDIR)/lib/xtra/font
147         @echo attempting to install sound and graphics
148         @-cp ../lib/xtra/sound/*.wav $(TMPDIR)/lib/xtra/sound
149         @-cp ../lib/xtra/graf/*.bmp $(TMPDIR)/lib/xtra/graf
150         @cp ../changes.txt ../readme.txt $(TMPDIR)
151         @cp $(EXE) $(TMPDIR)
152         tar czf ../$(EXE)-$(VERSION).tar.gz $(TMPDIR)
153         rm -rf $(TMPDIR)
154
155
156 #  Verify module arguments
157 args:
158         @echo CFLAGS = $(CFLAGS)
159         @echo LIBS = $(LIBS)
160
161
162 # Generate dependencies automatically
163 depend:
164         makedepend -D__MAKEDEPEND__ $(SRCS)
165
166
167 # Some file dependencies
168 %.o: %.c
169         $(CC) $(CFLAGS) -o $@ -c $<
170
171 # X11 dependencies
172 $(X11OBJS) : $(INCS) maid-x11.h main.h
173
174 # Basic dependencies for main-xxx.c, main.c
175 $(MAINOBJS) : main.h $(INCS)
176
177
Note: See TracBrowser for help on using the browser.