Changeset 3

Show
Ignore:
Timestamp:
03/23/07 20:58:08 (2 years ago)
Author:
takkaria
Message:

Overhaul the makefile system a little.

Add "Makefile.inc", which contains a set of object file definitions and

dependencies which can be shared amongst as many makefiles as possible.

Rewrite "Makefile.std" to be much more user- and developer- friendly.

Other changes:

  • std, osx, con, cyg, dos, ibm, lcc all use Makefile.inc.
  • gtk, lsl, ros removed. (gtk+lsl were pointless, ros was nonfunctional)

Closes #2.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/Makefile.am

    r2 r3  
    3535  main-ibm.c main-lsl.c main-mac.c main-sla.c \ 
    3636  main-xxx.c main-crb.c \ 
    37   Makefile.ros Makefile.ami Makefile.bcc Makefile.cyg \ 
    38   Makefile.dos Makefile.emx Makefile.gtk Makefile.ibm \ 
    39   Makefile.lcc Makefile.lsl Makefile.std Makefile.wat \ 
     37  Makefile.ami Makefile.bcc Makefile.cyg \ 
     38  Makefile.dos Makefile.emx Makefile.ibm \ 
     39  Makefile.lcc Makefile.std Makefile.wat \ 
    4040  Makefile.win Makefile.mpw Makefile.osx \ 
    4141  angband.rc angband.ico readdib.c readdib.h \ 
  • trunk/src/Makefile.con

    r1 r3  
    1111PDCURSES_LIB = ../../pdcurses/lib/pdcurses.a 
    1212 
    13 SRCS = \ 
    14   z-util.c z-virt.c z-form.c z-rand.c z-term.c \ 
    15   variable.c tables.c util.c cave.c \ 
    16   object1.c object2.c monster1.c monster2.c \ 
    17   xtra1.c xtra2.c spells1.c spells2.c \ 
    18   melee1.c melee2.c save.c files.c \ 
    19   cmd1.c cmd2.c cmd3.c cmd4.c cmd5.c cmd6.c \ 
    20   squelch.c store.c birth.c load.c \ 
    21   wizard1.c wizard2.c obj-info.c \ 
    22   generate.c dungeon.c init1.c init2.c randart.c \ 
    23   main-gcu.c main.c 
    24  
    25 OBJS = \ 
    26   z-util.o z-virt.o z-form.o z-rand.o z-term.o \ 
    27   variable.o tables.o util.o cave.o \ 
    28   object1.o object2.o monster1.o monster2.o \ 
    29   xtra1.o xtra2.o spells1.o spells2.o \ 
    30   melee1.o melee2.o save.o files.o \ 
    31   cmd1.o cmd2.o cmd3.o cmd4.o cmd5.o cmd6.o \ 
    32   squelch.o store.o birth.o load.o \ 
    33   wizard1.o wizard2.o obj-info.o \ 
    34   generate.o dungeon.o init1.o init2.o randart.o \ 
    35   main-gcu.o main.o \ 
    36   script.o use-obj.o x-spell.o 
    37  
     13OBJEXT=.o 
     14include Makefile.inc 
     15OBJS = $(BASEOBJS) main-gcu.o main.o 
    3816 
    3917CC = gcc 
    40  
    4118CFLAGS = -Wall -W -pedantic -O2 -D"USE_GCU" -DWIN32_CONSOLE_MODE -I$(PDCURSES_INCLUDE_DIR) 
    4219LIBS = $(PDCURSES_LIB) 
     
    7148 
    7249 
    73 # 
    74 # Hack -- some file dependencies 
    75 # 
    76 HDRS = \ 
    77   h-basic.h \ 
    78   h-define.h h-type.h h-system.h h-config.h 
    79  
    80 INCS = \ 
    81   angband.h \ 
    82   config.h defines.h types.h externs.h \ 
    83   z-term.h z-rand.h z-util.h z-virt.h z-form.h $(HDRS) 
    84  
    85  
    86 birth.o: birth.c $(INCS) 
    87 cave.o: cave.c $(INCS) 
    88 cmd1.o: cmd1.c $(INCS) 
    89 cmd2.o: cmd2.c $(INCS) 
    90 cmd3.o: cmd3.c $(INCS) 
    91 cmd4.o: cmd4.c $(INCS) 
    92 cmd5.o: cmd5.c $(INCS) script.h 
    93 cmd6.o: cmd6.c $(INCS) script.h 
    94 dungeon.o: dungeon.c $(INCS) 
    95 files.o: files.c $(INCS) 
    96 generate.o: generate.c $(INCS) 
    97 init1.o: init1.c $(INCS) init.h 
    98 init2.o: init2.c $(INCS) init.h script.h 
    99 randart.o: randart.c $(INCS) init.h 
    100 load.o: load.c $(INCS) 
    101 main-cap.o: main-cap.c $(INCS) main.h 
    10250main-gcu.o: main-gcu.c $(INCS) main.h 
    103 main-lsl.o: main-lsl.c $(INCS) main.h 
    104 main-x11.o: main-x11.c $(INCS) main.h 
    105 main-xaw.o: main-xaw.c $(INCS) main.h 
    10651main.o: main.c $(INCS) main.h 
    107 melee1.o: melee1.c $(INCS) 
    108 melee2.o: melee2.c $(INCS) 
    109 monster1.o: monster1.c $(INCS) 
    110 monster2.o: monster2.c $(INCS) 
    111 obj-info.o: obj-info.c $(INCS) 
    112 object1.o: object1.c $(INCS) 
    113 object2.o: object2.c $(INCS) 
    114 save.o: save.c $(INCS) 
    115 script.o: script.c $(INCS) script.h 
    116 spells1.o: spells1.c $(INCS) 
    117 spells2.o: spells2.c $(INCS) 
    118 store.o: store.c $(INCS) 
    119 tables.o: tables.c $(INCS) 
    120 use-obj.o: use-obj.c $(INCS) 
    121 util.o: util.c $(INCS) 
    122 variable.o: variable.c $(INCS) 
    123 wizard1.o: wizard1.c $(INCS) 
    124 wizard2.o: wizard2.c $(INCS) script.h 
    125 x-spell.o: x-spell.c $(INCS) 
    126 xtra1.o: xtra1.c $(INCS) script.h 
    127 xtra2.o: xtra2.c $(INCS) 
    128 z-form.o: z-form.c $(HDRS) z-form.h z-util.h z-virt.h 
    129 z-rand.o: z-rand.c $(HDRS) z-rand.h 
    130 z-term.o: z-term.c $(HDRS) z-term.h z-virt.h 
    131 z-util.o: z-util.c $(HDRS) z-util.h 
    132 z-virt.o: z-virt.c $(HDRS) z-virt.h z-util.h 
    133  
  • trunk/src/Makefile.cyg

    r1 r3  
    1212CFLAGS = -Wall -W -pedantic -mno-cygwin -O2 -fno-strength-reduce -DWINDOWS 
    1313 
    14 EXOBJS = \ 
    15         angband.res \ 
    16         birth.o \ 
    17         cave.o \ 
    18         cmd1.o \ 
    19         cmd2.o \ 
    20         cmd3.o \ 
    21         cmd4.o \ 
    22         cmd5.o \ 
    23         cmd6.o \ 
    24         dungeon.o \ 
    25         files.o \ 
    26         generate.o \ 
    27         init1.o \ 
    28         init2.o \ 
    29         load.o \ 
    30         main-win.o \ 
    31         melee1.o \ 
    32         melee2.o \ 
    33         monster1.o \ 
    34         monster2.o \ 
    35         obj-info.o \ 
    36         object1.o \ 
    37         object2.o \ 
    38         randart.o \ 
    39         readdib.o \ 
    40         save.o \ 
    41         spells1.o \ 
    42         spells2.o \ 
    43         store.o \ 
    44         squelch.o \ 
    45         tables.o \ 
    46         util.o \ 
    47         variable.o \ 
    48         wizard1.o \ 
    49         wizard2.o \ 
    50         xtra1.o \ 
    51         xtra2.o \ 
    52         z-form.o \ 
    53         z-rand.o \ 
    54         z-term.o \ 
    55         z-util.o \ 
    56         z-virt.o \ 
    57         script.o \ 
    58         use-obj.o \ 
    59         x-spell.o 
    6014 
    61 HDRS = \ 
    62         h-basic.h \ 
    63         h-define.h h-type.h \ 
    64         h-system.h h-config.h 
    65  
    66  
    67 INCS = \ 
    68         angband.h \ 
    69         config.h defines.h \ 
    70         types.h externs.h \ 
    71         z-term.h z-rand.h \ 
    72         z-util.h z-virt.h \ 
    73         z-form.h $(HDRS) 
     15OBJEXT=.o 
     16include Makefile.inc 
     17EXOBJS = $(BASEOBJS) angband.res main-win.o readdib.o 
    7418 
    7519 
     
    12064# 
    12165 
    122 birth.o: birth.c $(INCS) 
    123         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
     66%.o: %.c $(INCS) 
     67        $(CC) $(CFLAGS) -o $@ -c $< 
    12468 
    125 cave.o: cave.c $(INCS) 
    126         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    127  
    128 cmd1.o: cmd1.c $(INCS) 
    129         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    130  
    131 cmd2.o: cmd2.c $(INCS) 
    132         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    133  
    134 cmd3.o: cmd3.c $(INCS) 
    135         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    136  
    137 cmd4.o: cmd4.c $(INCS) 
    138         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    139  
    140 cmd5.o: cmd5.c $(INCS) script.h 
    141         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    142  
    143 cmd6.o: cmd6.c $(INCS) script.h 
    144         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    145  
    146 dungeon.o: dungeon.c $(INCS) 
    147         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    148  
    149 files.o: files.c $(INCS) 
    150         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    151  
    152 generate.o: generate.c $(INCS) 
    153         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    154  
    155 init1.o: init1.c $(INCS) init.h 
    156         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    157  
    158 init2.o: init2.c $(INCS) init.h script.h 
    159         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    160  
    161 load.o: load.c $(INCS) 
    162         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    163  
    164 main.o: main.c $(INCS) 
    165         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    166  
    167 melee1.o: melee1.c $(INCS) 
    168         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    169  
    170 main-win.o: main-win.c $(INCS) 
    171         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    172  
    173 melee2.o: melee2.c $(INCS) 
    174         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    175  
    176 monster1.o: monster1.c $(INCS) 
    177         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    178  
    179 monster2.o: monster2.c $(INCS) 
    180         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    181  
    182 obj-info.o: obj-info.c $(INCS) 
    183         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    184  
    185 object1.o: object1.c $(INCS) 
    186         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    187  
    188 object2.o: object2.c $(INCS) 
    189         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    190  
    191 randart.o: randart.c $(INCS) init.h 
    192         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    193  
    194 # 
    19569# Note the additional -DNEAR= flag to cope with the 'NEAR' 
    19670# keyword used in readdib.c 
    197 # 
    198  
    19971readdib.o: readdib.c readdib.h 
    20072        $(CC) $(CFLAGS) -DNEAR= $(INCDIRS) -c -o $@ $< 
    201  
    202 save.o: save.c $(INCS) 
    203         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    204  
    205 script.o: script.c $(INCS) script.h 
    206         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    207  
    208 spells1.o: spells1.c $(INCS) 
    209         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    210  
    211 spells2.o: spells2.c $(INCS) 
    212         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    213  
    214 store.o: store.c $(INCS) 
    215         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    216  
    217 squelch.o: squelch.c $(INCS) 
    218         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    219  
    220 tables.o: tables.c $(INCS) 
    221         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    222  
    223 use-obj.o: use-obj.c $(INCS) 
    224         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    225  
    226 util.o: util.c $(INCS) 
    227         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    228  
    229 variable.o: variable.c $(INCS) 
    230         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    231  
    232 wizard1.o: wizard1.c $(INCS) 
    233         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    234  
    235 wizard2.o: wizard2.c $(INCS) script.h 
    236         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    237  
    238 x-spell.o: x-spell.c $(INCS) 
    239         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    240  
    241 xtra1.o: xtra1.c $(INCS) script.h 
    242         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    243  
    244 xtra2.o: xtra2.c $(INCS) 
    245         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    246  
    247 z-form.o: z-form.c $(HDRS) z-form.h z-util.h z-virt.h 
    248         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    249  
    250 z-rand.o: z-rand.c $(HDRS) z-rand.h 
    251         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    252  
    253 z-term.o: z-term.c $(HDRS) z-term.h z-virt.h 
    254         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    255  
    256 z-util.o: z-util.c $(HDRS) z-util.h 
    257         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    258  
    259 z-virt.o: z-virt.c $(HDRS) z-virt.h z-util.h 
    260         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    261  
    262 .c.o: 
    263         $(CC) $(CFLAGS) $(INCDIRS) -c -o $@ $< 
    264  
  • trunk/src/Makefile.dos

    r1 r3  
    1313 
    1414# Objects 
    15 OBJS = \ 
    16   main.o \ 
    17   main-dos.o \ 
    18   main-ibm.o \ 
    19   birth.o \ 
    20   cave.o \ 
    21   cmd1.o \ 
    22   cmd2.o \ 
    23   cmd3.o \ 
    24   cmd4.o \ 
    25   cmd5.o \ 
    26   cmd6.o \ 
    27   dungeon.o \ 
    28   files.o \ 
    29   generate.o \ 
    30   init1.o \ 
    31   init2.o \ 
    32   load.o \ 
    33   melee1.o \ 
    34   melee2.o \ 
    35   monster1.o \ 
    36   monster2.o \ 
    37   obj-info.o \ 
    38   object1.o \ 
    39   object2.o \ 
    40   randart.o \ 
    41   save.o \ 
    42   spells1.o \ 
    43   spells2.o \ 
    44   squelch.o \ 
    45   store.o \ 
    46   tables.o \ 
    47   util.o \ 
    48   variable.o \ 
    49   wizard1.o \ 
    50   wizard2.o \ 
    51   xtra1.o \ 
    52   xtra2.o \ 
    53   z-term.o \ 
    54   z-rand.o \ 
    55   z-form.o \ 
    56   z-virt.o \ 
    57   z-util.o \ 
    58   script.o \ 
    59   use-obj.o \ 
    60   x-spell.o 
     15OBJEXT=.o 
     16include Makefile.inc 
     17OBJS = $(BASEOBJS) main.o main-dos.o main-ibm.o 
    6118 
    6219# Compiler 
  • trunk/src/Makefile.ibm

    r1 r3  
    1313 
    1414# Objects 
    15 OBJS = \ 
    16   main.o \ 
    17   main-ibm.o \ 
    18   birth.o \ 
    19   cave.o \ 
    20   cmd1.o \ 
    21   cmd2.o \ 
    22   cmd3.o \ 
    23   cmd4.o \ 
    24   cmd5.o \ 
    25   cmd6.o \ 
    26   dungeon.o \ 
    27   files.o \ 
    28   generate.o \ 
    29   init1.o \ 
    30   init2.o \ 
    31   load.o \ 
    32   melee1.o \ 
    33   melee2.o \ 
    34   monster1.o \ 
    35   monster2.o \ 
    36   obj-info.o \ 
    37   object1.o \ 
    38   object2.o \ 
    39   randart.o \ 
    40   save.o \ 
    41   spells1.o \ 
    42   spells2.o \ 
    43   squelch.o \ 
    44   store.o \ 
    45   tables.o \ 
    46   util.o \ 
    47   variable.o \ 
    48   wizard1.o \ 
    49   wizard2.o \ 
    50   xtra1.o \ 
    51   xtra2.o \ 
    52   z-term.o \ 
    53   z-rand.o \ 
    54   z-form.o \ 
    55   z-virt.o \ 
    56   z-util.o \ 
    57   script.o \ 
    58   use-obj.o \ 
    59   x-spell.o 
     15OBJEXT=.o 
     16include Makefile.ibm 
     17OBJS = $(BASEOBJS) main.o main-ibm.o 
    6018 
    6119# Compiler 
  • trunk/src/Makefile.in

    r1 r3  
    208208  main-ibm.c main-lsl.c main-mac.c main-sla.c \ 
    209209  main-xxx.c main-crb.c \ 
    210   Makefile.ros Makefile.ami Makefile.bcc Makefile.cyg \ 
    211   Makefile.dos Makefile.emx Makefile.gtk Makefile.ibm \ 
    212   Makefile.lcc Makefile.lsl Makefile.std Makefile.wat \ 
     210  Makefile.ami Makefile.bcc Makefile.cyg \ 
     211  Makefile.dos Makefile.emx Makefile.ibm \ 
     212  Makefile.lcc Makefile.std Makefile.wat \ 
    213213  Makefile.win Makefile.mpw Makefile.osx \ 
    214214  angband.rc angband.ico readdib.c readdib.h \ 
  • trunk/src/Makefile.osx

    r1 r3  
    3939# 
    4040 
    41 SRCS = \ 
    42   z-util.c z-virt.c z-form.c z-rand.c z-term.c \ 
    43   variable.c tables.c util.c cave.c \ 
    44   object1.c object2.c monster1.c monster2.c \ 
    45   xtra1.c xtra2.c spells1.c spells2.c \ 
    46   melee1.c melee2.c save.c files.c \ 
    47   cmd1.c cmd2.c cmd3.c cmd4.c cmd5.c cmd6.c \ 
    48   squelch.c store.c birth.c load.c \ 
    49   wizard1.c wizard2.c obj-info.c \ 
    50   generate.c dungeon.c init1.c init2.c randart.c \ 
    51   main-crb.c \ 
    52   script.c use-obj.c x-spell.c 
     41OBJEXT=.o 
     42include Makefile.inc 
    5343 
    54 OBJS = \ 
    55   z-util.o z-virt.o z-form.o z-rand.o z-term.o \ 
    56   variable.o tables.o util.o cave.o \ 
    57   object1.o object2.o monster1.o monster2.o \ 
    58   xtra1.o xtra2.o spells1.o spells2.o \ 
    59   melee1.o melee2.o save.o files.o \ 
    60   cmd1.o cmd2.o cmd3.o cmd4.o cmd5.o cmd6.o \ 
    61   squelch.o store.o birth.o load.o \ 
    62   wizard1.o wizard2.o obj-info.o \ 
    63   generate.o dungeon.o init1.o init2.o randart.o \ 
    64   main-crb.o \ 
    65   script.o use-obj.o x-spell.o 
     44OBJS = $(BASEOBJS) main-crb.o 
    6645 
    6746CFLAGS = \ 
     
    10584%.o: %.c $(INCS) 
    10685 
    107 cmd5.o: script.h 
    108 cmd6.o: script.h 
    109 init1.o: init.h 
    110 init2.o: init.h script.h 
    11186main-crb.o: osx/osx_tables.h 
    112 randart.o: init.h 
    113 script.o: script.h 
    114 wizard2.o: script.h 
    115 xtra1.o: script.h 
    11687 
    11788z-form.o: z-form.c $(HDRS) z-form.h z-util.h z-virt.h 
  • trunk/src/Makefile.std

    r1 r3  
     1# 
    12# File: Makefile.std 
    2  
    3 # This is not a very "nice" Makefile, but it usually works. 
    4  
    5 
    6 # Note that you may have to make modifications below according 
    7 # to your machine, available libraries, compilation options, 
    8 # and your "visual module" of choice.  This Makefile is intended 
    9 # for use with Unix machines running X11, gtk, (n)curses, termcap, 
    10 # or VT100, Slang, Linux VCS or SVGA library, 
    11 # or possibly for "Atari" or "Amiga" computers with "Curses" ports, 
    12 # see below for more information. 
    13 
    14 # Note that "main-mac.c", the visual module for the Macintosh, 
    15 # must be compiled in a special way, see elsewhere. 
    16 
    17 # Note that "main-win.c", the visual module for Windows, 
    18 # must be compiled in a special way, see elsewhere. 
    19 
    20 # Note that "main-ibm.c", "main-dos.c", and "main-emx.c", 
    21 # the visual modules for various types of IBM-PC computers, 
    22 # must be compiled with special Makefiles, see elsewhere. 
    23 
    24 # Note that "main-ros.c", the visual module for RISC OS, 
    25 # must be compiled with "Makefile.ros", see elsewhere. 
    26 
    27 # Note that "main-ami.c", the visual module for the Amiga, 
    28 # must be compiled with "Makefile.ami", see elsewhere. 
    29 
    30 # If you are able to construct "main-xxx.c" and/or "Makefile.xxx" 
    31 # files for a currently unsupported system, please send them to 
    32 # Robert Ruehlmann < rr9@thangorodrim.net > for inclusion in future 
    33 # versions. 
    34 
    35 # This Makefile comes with "default" dependencies that may be obsolete. 
    36 
    37  
    38  
    39 
    40 # The "source" and "object" files. 
    41 
    42  
    43 SRCS = \ 
    44   z-util.c z-virt.c z-form.c z-rand.c z-term.c \ 
    45   variable.c tables.c util.c cave.c \ 
    46   object1.c object2.c monster1.c monster2.c \ 
    47   xtra1.c xtra2.c spells1.c spells2.c \ 
    48   melee1.c melee2.c save.c files.c \ 
    49   cmd1.c cmd2.c cmd3.c cmd4.c cmd5.c cmd6.c \ 
    50   squelch.c store.c birth.c load.c \ 
    51   wizard1.c wizard2.c obj-info.c \ 
    52   generate.c dungeon.c init1.c init2.c randart.c \ 
    53   main-cap.c main-gcu.c main-x11.c main-xaw.c main.c \ 
    54   main-gtk.c main-lsl.c main-sla.c main-vcs.c main-xpj.c main-lfb.c \ 
    55   maid-x11.c \ 
    56   script.c use-obj.c x-spell.c 
    57  
    58 OBJS = \ 
    59   z-util.o z-virt.o z-form.o z-rand.o z-term.o \ 
    60   variable.o tables.o util.o cave.o \ 
    61   object1.o object2.o monster1.o monster2.o \ 
    62   xtra1.o xtra2.o spells1.o spells2.o \ 
    63   melee1.o melee2.o save.o files.o \ 
    64   cmd1.o cmd2.o cmd3.o cmd4.o cmd5.o cmd6.o \ 
    65   squelch.o store.o birth.o load.o \ 
    66   wizard1.o wizard2.o obj-info.o \ 
    67   generate.o dungeon.o init1.o init2.o randart.o \ 
    68   main-cap.o main-gcu.o main-x11.o main-xaw.o main.o \ 
    69   main-gtk.o main-lsl.o main-sla.o main-vcs.o main-xpj.o main-lfb.o \ 
    70   maid-x11.o \ 
    71   script.o use-obj.o x-spell.o 
    72  
    73  
    74 ## 
    75 ## Following are some "system" definitions 
    76 ## 
    77 ## No changes are needed to compile a version that will run on both 
    78 ## X11 and Curses, in debugging mode, with maximal warnings, on many 
    79 ## normal Unix machines of the Sun OS variety (non-solaris). 
    80 ## 
    81 ## To use an "alternative" definition, simply "modify" (or "replace") 
    82 ## the definition below with one that you like.  For example, you can 
    83 ## change the compiler to "cc", or remove the "debugging" options, or 
    84 ## remove the X11 or Curses support, etc, as desired. 
    85 ## 
    86 ## With X11, XAW or GTK, you can add -D"USE_XPJ" to CFLAGS to get the 
    87 ## 3d-projection module "xpj". 
    88 ## 
    89 ## See also "config.h" and "h-config.h" for important information. 
    90 ## 
    91 ## Some "examples" are given below, they can be used by simply 
    92 ## removing the FIRST column of "#" signs from the "block" of lines 
    93 ## you wish to use, and commenting out "standard" block below. 
    94 ## 
    95 ## This is not intended to be a "good" Makefile, just a "simple" one. 
    96 ## 
    97  
    98  
    99 
    100 # This is my compiler of choice, it seems to work most everywhere. 
    101 
     3# Standard makefile for Angband. 
     4
     5# This makefile probably requires GNU make. 
     6
     7# This makefile is intended for use with Unix machines running X11, gtk, 
     8# (n)curses, termcap, or VT100, Slang, Linux VCS or SVGA library.  You can 
     9# choose what systems below. 
     10
     11# You can also place your alterations to a file in the src/ directory called  
     12# "config", in which case that file will override what is specified here. 
     13
     14# If you used to use Makefile.gtk or Makefile.lsl, then just change the below 
     15# SYS_gtk or SYS_lsl option to "true", and set the others to "false". 
     16
     17 
     18#### Things you should, or could, change #### 
     19 
     20# What systems to try. 
     21
     22# By default, this tries to compile both the X11 and "curses" terminal mode 
     23# ports in the same executable. 
     24 
     25SYS_x11 = true 
     26SYS_gcu = true 
     27SYS_xaw = false 
     28SYS_gtk = false 
     29SYS_cap = false 
     30SYS_lsl = false 
     31SYS_sla = false 
     32SYS_vcs = false  # Linux only, AFAIK 
     33SYS_lfb = false  # Linux only 
     34SYS_xpj = false  # Still experimental, and requires X11/Xaw/GTK to be enabled 
     35 
     36# Basic compiler stuff 
    10237CC = gcc 
    103  
    104  
    105 
    106 # Standard version (see main-x11.c and main-gcu.c) 
    107 
    108 # This version supports both "X11" and "curses" in a single executable. 
     38CFLAGS = -Wall -O2 -g -fno-strength-reduce 
     39 
     40 
     41#### Things you probably shouldn't change, unless there is a problem #### 
     42 
     43# Import user prefs 
     44-include config 
     45 
     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 
     59uname = $(shell uname) 
     60 
     61# Disable non-Linux ports on non-Linux 
     62ifneq ($(uname),Linux) 
     63  SYS_lfb = false 
     64 
     65# Enable mkstemp() also 
     66else 
     67  CFLAGS += -DHAVE_MKSTEMP 
     68endif 
     69 
     70# Disable XPJ without X11/Xaw/GTK 
     71ifeq ($(SYS_x11),false) 
     72  ifeq ($(SYS_gtk),false) 
     73    ifeq ($(SYS_xaw),false) 
     74      SYS_xpj = false 
     75    endif 
     76  endif 
     77endif 
     78 
     79 
     80#### System definitions #### 
     81 
     82
     83# Support main-x11.c 
    10984# 
    11085# You may have to add various X11 include/library directories to the 
    111 # "CFLAGS", if your machine places files in a weird location. 
    112 
    113 # You may be able to remove "-ltermcap" on some machines (ex: Solaris). 
    114 
    115 # You may have to replace "-lcurses" with "-lncurses" to use the 
    116 # "new curses" library instead of the "old curses" library, and 
    117 # you may have to add "-I/usr/include/ncurses" to the "CFLAGS". 
     86# "CFLAGS", if your machine places files in a weird location, for example 
     87# " -I/usr/X11R6/include", or "-L/usr/X11R6/lib" to LIBS. 
     88
     89ifeq ($(SYS_x11),true) 
     90  CFLAGS += -DUSE_X11 
     91  LIBS += -lX11 
     92endif 
     93 
     94 
     95
     96# Support main-gcu.c 
     97
     98# If this fails, try replacing "-lncurses" with "-lcurses -ltermcap", 
     99# and removing "-DUSE_NCURSES". 
    118100# 
    119101# See "main-gcu.c" and "config.h" for some optional "curses" defines, 
    120102# including "USE_GETCH" and "USE_CURS_SET".  Note that "config.h" will 
    121103# attempt to "guess" at many of these flags based on your system. 
    122 
    123 #CFLAGS = -Wall -O1 -pipe -g -D"USE_X11" -D"USE_GCU" 
    124 #LIBS = -lX11 -lcurses -ltermcap 
    125  
    126  
    127 ## 
    128 ## Variation -- Only support "main-x11.c" (not "main-gcu.c") 
    129 ## 
    130 #CFLAGS = -Wall -O1 -pipe -g -D"USE_X11" 
    131 #LIBS = -lX11 
    132  
    133  
    134 ## 
    135 ## Variation -- Only support "main-gcu.c" (not "main-x11.c") 
    136 ## 
    137 #CFLAGS = -Wall -O1 -pipe -g -D"USE_GCU" 
    138 #LIBS = -lcurses -ltermcap 
    139  
    140  
    141 ## 
    142 ## Variation -- Use "main-xaw.c" instead of "main-x11.c" 
    143 ## 
    144 #CFLAGS = -Wall -O1 -pipe -g -D"USE_XAW" -D"USE_GCU" 
    145 #LIBS = -lXaw -lXmu -lXt -lX11 -lcurses -ltermcap 
    146  
    147  
    148 ## 
    149 ## Variation -- Use "main-gtk.c" instead of "main-x11.c" 
    150 ## Note: gtk-config adds GTK and X11 includes and libraries as appropriate. 
    151 ## 
    152 #CFLAGS = -Wall -O `gtk-config --cflags` -g -D"USE_GTK" -D"USE_GCU" 
    153 #LIBS = `gtk-config --libs` -lcurses -ltermcap 
    154  
    155  
    156 ## 
    157 ## Variation -- Use "main-cap.c" instead of "main-gcu.c" 
    158 ## 
    159 #CFLAGS = -Wall -O1 -pipe -g -D"USE_X11" -D"USE_CAP" 
    160 #LIBS = -lX11 -ltermcap 
    161  
    162  
    163 ## 
    164 ## Variation -- Only work on simple vt100 terminals 
    165 ## 
    166 #CFLAGS = -Wall -O1 -pipe -g -D"USE_CAP" -D"USE_HARDCODE" 
    167  
    168  
    169 ## 
    170 ## Variation -- compile for Linux 
    171 ## 
    172 ## Allows the use of Angband in the console using ncurses, 
    173 ## as well as under X11. 
    174 ## 
    175 CFLAGS = -I/usr/X11R6/include -I/usr/include/ncurses -Wall \ 
    176          -O2 -fno-strength-reduce \ 
    177          -D"USE_LFB" -D"USE_X11" -D"USE_GCU" -D"USE_NCURSES" -g 
    178 LIBS = -L/usr/X11R6/lib -lXaw -lXext -lSM -lICE -lXmu -lXt -lX11 -lncurses 
    179  
    180  
    181 ## 
    182 ## Variation -- compile for Linux 
    183 ## 
    184 ## Allows the use of Angband in the console using curses. 
    185 ## 
    186 #CFLAGS = -Wall -O2 -fno-strength-reduce -pipe -D"USE_GCU" 
    187 #LIBS = -lcurses 
    188  
    189  
    190 ## 
    191 ## Variation -- compile for Linux 
    192 ## 
    193 ## Allows the use of Angband in X11 using the Athena Widget set. 
    194 ## 
    195 #CFLAGS = -Wall -O2 -fno-strength-reduce -pipe -g -D"USE_XAW" 
    196 #LIBS = -L/usr/X11R6/lib -lXaw -lXext -lSM -lICE -lXmu -lXt -lX11 
    197  
     104#  
     105# You may have to add " -I/usr/include/ncurses" to CFLAGS. 
     106
     107ifeq ($(SYS_gcu),true)  
     108  CFLAGS += -DUSE_GCU -DUSE_NCURSES 
     109  LIBS += -lncurses 
     110endif 
     111 
     112 
     113
     114# Support main-xaw.c 
     115
     116ifeq ($(SYS_xaw),true) 
     117  CFLAGS += -DUSE_XAW 
     118  LIBS += -lXaw -lXext -lSM -lICE -lXmu -lXt -lX11 
     119endif 
     120 
     121 
     122
     123# Support main-gtk.c 
     124
     125# Note: gtk-config adds GTK and X11 includes and libraries as appropriate. 
     126
     127ifeq ($(SYS_gtk),true) 
     128  CFLAGS += `gtk-config --cflags` -DUSE_GTK 
     129  LIBS += `gtk-config --libs` 
     130endif 
     131 
     132 
     133
     134# Support main-cap.c 
     135
     136# If you want this to work on simple vt100 terminals, add " -DUSE_HARDCODE" 
     137# to CFLAGS. 
     138
     139ifeq ($(SYS_cap),true) 
     140  CFLAGS += -DUSE_CAP 
     141  LIBS += -ltermcap 
     142endif 
     143 
     144 
     145
     146# Support main-lsl.c 
     147
     148ifeq ($(SYS_lsl),true) 
     149  CFLAGS += -DUSE_LSL 
     150  LIBS += -lz -lvgagl -lvga 
     151endif 
     152 
     153 
     154
     155# Support main-vcs.c 
     156
     157ifeq ($(SYS_vcs),true) 
     158  CFLAGS += -DUSE_VCS 
     159endif 
     160 
     161 
     162
     163# Support main-sla.c 
     164
     165ifeq ($(SYS_sla),true) 
     166  CFLAGS += -DUSE_SLA -I/usr/include/slang 
     167  LIBS += -lslang 
     168endif 
     169 
     170 
     171
     172# Support main-lfb.c 
     173
     174ifeq ($(SYS_lfb),true) 
     175  CFLAGS += -DUSE_LFB 
     176endif 
     177 
     178 
     179
     180# Support main-xpj.c 
     181
     182ifeq ($(SYS_xpj),true) 
     183  CFLAGS += -DUSE_XPJ 
     184endif 
     185 
     186 
     187#### Old definitions, unchanged since at least 2000 #### 
    198188 
    199189## 
     
    211201## Variation -- compile for Solaris 
    212202## 
    213 #CFLAGS = -Wall -O1 -pipe -g -D"USE_X11" -D"USE_GCU" -D"SOLARIS" 
     203#CFLAGS = -D"USE_X11" -D"USE_GCU" -D"SOLARIS" 
    214204#LIBS = -lX11 -lsocket -lcurses 
    215205 
     
    218208## Variation -- compile for SGI Indigo runnig Irix 
    219209## 
    220 #CFLAGS = -Wall -O1 -pipe -g -D"USE_X11" -D"USE_GCU" -D"SGI" 
     210#CFLAGS = -D"USE_X11" -D"USE_GCU" -D"SGI" 
    221211#LIBS = -lX11 -lcurses -ltermcap -lsun 
    222212 
     
    234224## Variation -- compile for Interactive Unix (ISC) systems 
    235225## 
    236 #CFLAGS = -Wall -O1 -pipe -g -D"USE_X11" -D"USE_GCU" -D"ISC" 
     226#CFLAGS = -D"USE_X11" -D"USE_GCU" -D"ISC" 
    237227#LIBS = -lX11 -lcurses -lnsl_s -linet -lcposix 
    238228 
     
    241231## Variation -- Support fat binaries under NEXTSTEP 
    242232## 
    243 #CFLAGS = -Wall -O1 -pipe -g -D"USE_GCU" -arch m68k -arch i386 
     233#CFLAGS = -D"USE_GCU" -arch m68k -arch i386 
    244234#LIBS = -lcurses -ltermcap 
    245235 
    246236 
    247 ## 
    248 ## Variation -- Support Linux + SVGA library 
    249 ## 
    250 #CFLAGS = -Wall -O2 -fno-strength-reduce -D"USE_LSL" 
    251 #LIBS = -lz -lvgagl -lvga 
    252  
    253  
    254 ## 
    255 ## Variation -- Support Linux "vcs" (Virtual Console memory) module 
    256 ## 
    257 #CFLAGS = -Wall -O2 -fno-strength-reduce -D"USE_VCS" 
    258 #LIBS = 
    259  
    260  
    261 ## 
    262 ## Variation -- Support S-Lang library 
    263 ## 
    264 #CFLAGS = -Wall -O2 -fno-strength-reduce -D"USE_SLA" -I/usr/include/slang 
    265 #LIBS = -lslang 
    266  
    267  
    268 
    269 # Default target. 
    270 
    271 all: angband 
    272  
    273  
    274 
    275 # Install the game. 
    276 
    277  
    278 install: angband 
    279         cp angband .. 
    280  
    281  
    282 
     237 
     238#### Targets and objects ##### 
     239 
     240# Set a target here 
     241default: angband 
     242 
     243# Makefile.inc contains an up-to-date set of object files to compile, so 
     244# we include it 
     245OBJEXT=.o 
     246include Makefile.inc 
     247 
     248OBJS = $(BASEOBJS) \ 
     249  main-cap.o main-gcu.o main-x11.o main-xaw.o main.o \ 
     250  main-gtk.o main-lsl.o main-sla.o main-vcs.o main-xpj.o \ 
     251  main-lfb.o maid-x11.o 
     252 
     253 
     254
     255# Targets 
     256
     257 
    283258# Build the "Angband" program 
    284 # 
    285  
    286259angband: $(OBJS) 
    287260        $(CC) $(CFLAGS) $(LDFLAGS) -o angband $(OBJS) $(LIBS) 
    288261 
    289  
    290 
     262# Install the game. 
     263install: ../angband 
     264 
     265../angband: angband 
     266        cp angband .. 
     267 
    291268# Clean up old junk 
    292 # 
    293  
    294269clean: 
    295270        -rm -f *.o angband 
    296271 
    297  
    298 # 
    299272# Generate dependencies automatically 
    300 # 
    301  
    302273depend: 
    303274        makedepend -D__MAKEDEPEND__ $(SRCS) 
    304275 
    305276 
    306  
    307 
    308 # Hack -- some file dependencies 
    309 
    310  
    311 HDRS = \ 
    312   h-basic.h \ 
    313   h-define.h h-type.h h-system.h h-config.h 
    314  
    315 INCS = \ 
    316   angband.h \ 
    317   config.h defines.h types.h externs.h \ 
    318   z-term.h z-rand.h z-util.h z-virt.h z-form.h $(HDRS) 
    319  
    320  
    321 birth.o: birth.c $(INCS) 
    322 cave.o: cave.c $(INCS) 
    323 cmd1.o: cmd1.c $(INCS) 
    324 cmd2.o: cmd2.c $(INCS) 
    325 cmd3.o: cmd3.c $(INCS) 
    326 cmd4.o: cmd4.c $(INCS) 
    327 cmd5.o: cmd5.c $(INCS) script.h 
    328 cmd6.o: cmd6.c $(INCS) script.h 
    329 dungeon.o: dungeon.c $(INCS) 
    330 files.o: files.c $(INCS) 
    331 generate.o: generate.c $(INCS) 
    332 init1.o: init1.c $(INCS) init.h 
    333 init2.o: init2.c $(INCS) init.h script.h 
    334 load.o: load.c $(INCS) 
     277# Some file dependencies 
     278%.o: %.c $(INCS) 
     279        $(CC) $(CFLAGS) -o $@ -c $< 
     280 
    335281maid-x11.o: maid-x11.c $(INCS) maid-x11.h 
    336282main-cap.o: main-cap.c $(INCS) main.h 
     
    345291main-lfb.o: main-lfb.c $(INCS) main.h 
    346292main.o: main.c $(INCS) main.h 
    347 melee1.o: melee1.c $(INCS) 
    348 melee2.o: melee2.c $(INCS) 
    349 monster1.o: monster1.c $(INCS) 
    350 monster2.o: monster2.c $(INCS) 
    351 obj-info.o: obj-info.c $(INCS) 
    352 object1.o: object1.c $(INCS) 
    353 object2.o: object2.c $(INCS) 
    354 randart.o: randart.c $(INCS) init.h 
    355 save.o: save.c $(INCS) 
    356 script.o: script.c $(INCS) script.h 
    357 spells1.o: spells1.c $(INCS) 
    358 spells2.o: spells2.c $(INCS) 
    359 squelch.o: squelch.c $(INCS) 
    360 store.o: store.c $(INCS) 
    361 tables.o: tables.c $(INCS) 
    362 use-obj.o: use-obj.c $(INCS) 
    363 util.o: util.c $(INCS) 
    364 variable.o: variable.c $(INCS) 
    365 wizard1.o: wizard1.c $(INCS) 
    366 wizard2.o: wizard2.c $(INCS) script.h 
    367 x-spell.o: x-spell.c $(INCS) 
    368 xtra1.o: xtra1.c $(INCS) script.h 
    369 xtra2.o: xtra2.c $(INCS) 
    370 z-form.o: z-form.c $(HDRS) z-form.h z-util.h z-virt.h 
    371 z-rand.o: z-rand.c $(HDRS) z-rand.h 
    372 z-term.o: z-term.c $(HDRS) z-term.h z-virt.h 
    373 z-util.o: z-util.c $(HDRS) z-util.h 
    374 z-virt.o: z-virt.c $(HDRS) z-virt.h z-util.h