Changeset 12

Show
Ignore:
Timestamp:
03/25/07 14:47:24 (2 years ago)
Author:
pmac
Message:

Default dependencies broken in some files.
Makefile.inc specifies a target, so it needs to be included after
the default target.

Files:

Legend:

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

    r3 r12  
    1111PDCURSES_LIB = ../../pdcurses/lib/pdcurses.a 
    1212 
    13 OBJEXT=.o 
    14 include Makefile.inc 
    1513OBJS = $(BASEOBJS) main-gcu.o main.o 
    1614 
     
    1917LIBS = $(PDCURSES_LIB) 
    2018 
     19all: angband 
    2120 
     21OBJEXT=.o 
     22include Makefile.inc 
    2223 
    2324#  
  • trunk/src/Makefile.cyg

    r3 r12  
    1212CFLAGS = -Wall -W -pedantic -mno-cygwin -O2 -fno-strength-reduce -DWINDOWS 
    1313 
    14  
    15 OBJEXT=.o 
    16 include Makefile.inc 
    1714EXOBJS = $(BASEOBJS) angband.res main-win.o readdib.o 
    18  
    1915 
    2016# 
     
    2218# 
    2319 
     20# must precede include 
     21all: angband 
    2422 
    25 default: angband 
     23OBJEXT=.o 
     24include Makefile.inc 
     25 
    2626 
    2727install: angband movebin cleanobjs 
  • trunk/src/Makefile.dos

    r3 r12  
    1212# 
    1313 
    14 # Objects 
    15 OBJEXT=.o 
    16 include Makefile.inc 
    17 OBJS = $(BASEOBJS) main.o main-dos.o main-ibm.o 
    1814 
    1915# Compiler 
     
    2723LIBS = -lpc -lalleg 
    2824 
     25OBJS = $(BASEOBJS) main.o main-dos.o main-ibm.o 
    2926 
    3027# 
    3128# Targets 
    3229# 
     30all: angband.exe 
     31        @echo All done.  Use 'make install' to install. 
    3332 
    34 default: angband.exe 
     33# Objects 
     34OBJEXT=.o 
     35include Makefile.inc 
     36 
    3537 
    3638install: angband.exe 
    3739        copy angband.exe .. 
    38  
    39 all: angband.exe 
    40         @echo All done.  Use 'make install' to install. 
    41  
    4240 
    4341# 
  • trunk/src/Makefile.ibm

    r5 r12  
    1212# 
    1313 
    14 # Objects 
    15 OBJEXT=.o 
    16 include Makefile.inc 
    17 OBJS = $(BASEOBJS) main.o main-ibm.o 
    1814 
    1915# Compiler 
     
    2622LIBS = -lpc 
    2723 
     24OBJS = $(BASEOBJS) main.o main-ibm.o 
    2825 
    2926# 
     
    3128# 
    3229 
    33 default: angband.exe 
     30all: angband.exe 
     31        @echo All done.  Use 'make install' to install. 
     32 
     33# Objects 
     34OBJEXT=.o 
     35include Makefile.inc 
    3436 
    3537install: angband.exe 
    3638        copy angband.exe .. 
    37  
    38 all: angband.exe 
    39         @echo All done.  Use 'make install' to install. 
    4039 
    4140 
  • trunk/src/Makefile.osx

    r10 r12  
    6363OBJEXT = .o 
    6464include Makefile.inc 
    65  
    66  
    6765 
    6866 
  • trunk/src/Makefile.std

    r6 r12  
    1 # 
    21# File: Makefile.std 
    32# Standard makefile for Angband. 
     
    2524# module. 
    2625 
    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  
    38  
    39 # Basic compiler stuff 
    40 CC = gcc 
    41 CFLAGS = -Wall -O2 -fno-strength-reduce 
    42 EXE = angband  # Executable name 
    43  
    44  
    45 #### Things you probably shouldn't change, unless there is a problem #### 
    46  
    47 # Import user prefs 
    48 -include config 
    49  
    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 
    55 uname = $(shell uname) 
    56  
    57 # Enable linux-specific modules, if requested. 
    58 ifeq ($(uname),Linux) 
    59   CFLAGS += -DHAVE_MKSTEMP $(SYS_lsl)$(SYS_lfb)$(SYS_vcs) 
    60 endif 
    61  
    62  
    63  
    64 #### System definitions #### 
    65  
    66 
    67 # Support main-x11.c 
    68 
     26 
     27 
     28# support X11 (main-x11.c) 
    6929# You may have to add various X11 include/library directories to the 
    7030# "CFLAGS", if your machine places files in a weird location, for example 
    7131# " -I/usr/X11R6/include", or "-L/usr/X11R6/lib" to LIBS. 
    72 
    73 ifneq ($(SYS_x11),) 
    74   LIBS += -lX11 
     32SYS_x11 = -DUSE_X11 -lX11 
     33 
     34 
     35# support curses console mode (main-gcu.c) 
     36# If this fails, try the alternate below 
     37SYS_gcu = -DUSE_GCU -DUSE_NCURSES -lncurses 
     38#SYS_gcu = -DUSE_GCU -lcurses -ltermcap 
     39 
     40# support Xaw motif (main-xaw.c) 
     41#SYS_xaw = -DUSE_XAW -lXaw -lXext -lSM -lICE -lXmu -lXt -lX11 
     42 
     43# Support gtk alternative x11 (main-gtk.c) 
     44#SYS_gtk = $(shell gtk-config --cflags) -DUSE_GTK $(shell gtk-config --libs) 
     45 
     46 
     47 
     48# Linux specific flags (appended conditionally below) 
     49 
     50# support raw console  (main-lfb.c) 
     51SYS_lfb = -DUSE_LFB 
     52
     53# support linux in VGA mode (main-lsl.c) 
     54#SYS_lsl = -DUSE_LSL -lz -lvgagl -lvga 
     55 
     56 
     57# Experimental. requires X11/Xaw/GTK to be enabled (main-xpj.c) 
     58#SYS_xpj = -DUSE_xpj 
     59 
     60 
     61 
     62# Old raw tty protocols that may not work 
     63# With curses support, all are effectively superceded by USE_GCU 
     64 
     65# use direct termio on 8bit color-depth screen (main-vcs.c) 
     66#SYS_vcs = -DUSE_VCS 
     67 
     68# Unix 'slang' (Also available on OS/2) (main-sla.c) 
     69#SYS_sla = -DUSE_SLA -I/usr/include/slang -lslang 
     70 
     71# primitive termcap emulation of a vt100 (slow and unreliable) (main-cap.c) 
     72# -DUSE_HARDCODE in the unlikely event you are using a VT100 without curses 
     73#SYS_cap = -DUSE_CAP -ltermcap 
     74 
     75 
     76# linux-specific modules are appended below 
     77 
     78MODULES = $(SYS_x11) $(SYS_gcu) $(SYS_xaw) $(SYS_gtk) $(SYS_xpj) $(SYS_sla) $(SYS_cap) 
     79 
     80MCFLAGS = $(patsubst -l%,,$(MODULES)) 
     81MLFLAGS = $(patsubst -D%,,$(patsubst -I%,, $(MODULES))) 
     82 
     83 
     84 
     85# Basic compiler stuff 
     86 
     87# Add additional search directives here 
     88# Example: -I/usr/X11R6/include -I/usr/include/ncurses 
     89INCLUDES = 
     90# Example: -L/usr/X11R6/lib 
     91LFLAGS = 
     92 
     93CC = gcc 
     94CFLAGS = -Wall $(OPT) -fno-strength-reduce $(MCFLAGS) $(INCLUDES) 
     95LIBS = $(LFLAGS) $(MLFLAGS) 
     96 
     97X11OBJS = maid-x11.o main-x11.o main-xaw.o main-gtk.o main-xpj.o 
     98MAINOBJS = $(X11OBJS) main-cap.o main-gcu.o main-gtk.o main-sla.o $(LINUXOBJ) 
     99OBJS = $(BASEOBJS) $(MAINOBJS) 
     100 
     101 
     102ifeq ($(OPT),) 
     103OPT = -O2 
    75104endif 
    76105 
    77  
    78 
    79 # Support main-gcu.c 
    80 
    81 # If this fails, try replacing "-lncurses" with "-lcurses -ltermcap", 
    82 # and removing "-DUSE_NCURSES" 
    83 
    84 # See "main-gcu.c" and "config.h" for some optional "curses" defines, 
    85 # including "USE_GETCH" and "USE_CURS_SET".  Note that "config.h" will 
    86 # attempt to "guess" at many of these flags based on your system. 
    87 #  
    88 # You may have to add " -I/usr/include/ncurses" to CFLAGS. 
    89 
    90 ifneq ($(SYS_gcu),)  
    91   LIBS += -lncurses 
    92 endif 
    93  
    94  
    95 
    96 # Support main-xaw.c 
    97 
    98 ifneq ($(SYS_xaw),) 
    99   LIBS += -lXaw -lXext -lSM -lICE -lXmu -lXt -lX11 
    100 endif 
    101  
    102  
    103 
    104 # Support main-gtk.c 
    105 
    106 # Note: gtk-config adds GTK and X11 includes and libraries as appropriate. 
    107 
    108 ifneq ($(SYS_gtk),) 
    109   LIBS += `gtk-config --libs` 
    110 endif 
    111  
    112 
    113 # Support main-lsl.c 
    114 
    115 ifneq ($(SYS_lsl),) 
    116   LIBS += -lz -lvgagl -lvga 
    117 endif 
    118  
    119 
    120 # Support main-sla.c 
    121 
    122 ifneq ($(SYS_sla),) 
    123   LIBS += -lslang 
     106# Version info 
     107VERSION = 3_0_7s3 
     108# Name of the game 
     109EXE = angband 
     110 
     111 
     112#### Things you probably shouldn't change, unless there is a problem #### 
     113 
     114# Import user prefs 
     115# If you don't want to edit this file, put your module redefinitions 
     116# and build flags in "./config" 
     117-include config 
     118 
     119 
     120uname = $(shell uname) 
     121 
     122# Enable linux-specific modules, if requested. 
     123ifeq ($(uname),Linux) 
     124  MODULES += $(SYS_lsl) $(SYS_lfb) $(SYS_vcs) 
     125  LINUXOBJS = main-lsl.o main-vcs.o main-lfb.o 
     126  CFLAGS += -DHAVE_MKSTEMP 
    124127endif 
    125128 
     
    169172 
    170173 
    171  
    172174#### Targets and objects ##### 
    173175 
    174 default: angband 
    175  
    176 # Include the set of object files, and add platform files 
     176# Set a target here 
     177default: $(EXE) 
     178 
     179# Makefile.inc contains an up-to-date set of object files to compile, so 
     180# we include it 
    177181OBJEXT=.o 
    178182include Makefile.inc 
    179 OBJS = $(BASEOBJS) \ 
    180   main-cap.o main-gcu.o main-x11.o main-xaw.o main.o \ 
    181   main-gtk.o main-lsl.o main-sla.o main-vcs.o main-xpj.o \ 
    182   main-lfb.o maid-x11.o 
    183  
    184  
    185 # Build Angband 
    186 angband: $(OBJS) 
     183 
     184 
     185
     186# Targets 
     187
     188 
     189# Build the "Angband" program 
     190$(EXE): $(OBJS) 
    187191        $(CC) $(CFLAGS) $(LDFLAGS) -o $(EXE) $(OBJS) $(LIBS) 
    188192 
     
    190194install: ../$(EXE) 
    191195 
     196 
    192197../$(EXE): $(EXE) 
    193         cp $(EXE) ../ 
     198        cp $(EXE) .. 
    194199 
    195200# Clean up old junk 
    196201clean: 
    197         -rm -f *.o angband 
     202        -rm -f *.o $(EXE) 
     203 
     204# make a distribution 
     205DIRS = lib/apex lib/bone lib/data lib/edit lib/file lib/help lib/info \ 
     206                lib/pref lib/save lib/user lib/xtra/sound lib/xtra/graf lib/xtra/font 
     207 
     208TMPDIR = ./$(EXE)$(VERSION) 
     209dist: 
     210        @-rm -rf $(TMPDIR) 
     211        @echo making directories... 
     212        @for i in $(DIRS) ; do mkdir -p $(TMPDIR)/$$i ; done 
     213        @echo copying files... 
     214        @cp ../lib/edit/*.txt $(TMPDIR)/lib/edit 
     215        @cp ../lib/file/*.txt $(TMPDIR)/lib/file 
     216        @cp ../lib/help/*.txt ../lib/help/*.hlp $(TMPDIR)/lib/help 
     217        @cp ../lib/pref/*.prf $(TMPDIR)/lib/pref 
     218        @cp ../lib/xtra/font/*.txt $(TMPDIR)/lib/xtra/font 
     219        @echo attempting to install sound and graphics 
     220        @-cp ../lib/xtra/sound/*.wav $(TMPDIR)/lib/xtra/sound 
     221        @-cp ../lib/xtra/graf/*.bmp $(TMPDIR)/lib/xtra/graf 
     222        @cp $(EXE) $(TMPDIR) 
     223        tar czf ../$(EXE)$(VERSION).tgz $(TMPDIR) 
     224        rm -rf $(TMPDIR) 
     225 
     226 
     227#  Verify module arguments 
     228args: 
     229        @echo CFLAGS = $(CFLAGS) 
     230        @echo LIBS = $(LIBS) 
     231 
    198232 
    199233# Generate dependencies automatically 
     
    203237 
    204238# Some file dependencies 
    205 %.o: %.c $(INCS) 
     239%.o: %.c 
    206240        $(CC) $(CFLAGS) -o $@ -c $< 
    207241 
    208 maid-x11.o: maid-x11.c $(INCS) maid-x11.h 
    209 main-cap.o: main-cap.c $(INCS) main.h 
    210 main-gcu.o: main-gcu.c $(INCS) main.h 
    211 main-gtk.o: main-gtk.c $(INCS) main.h maid-x11.h 
    212 main-lsl.o: main-lsl.c $(INCS) main.h 
    213 main-sla.o: main-sla.c $(INCS) main.h 
    214 main-vcs.o: main-vcs.c $(INCS) main.h 
    215 main-x11.o: main-x11.c $(INCS) main.h maid-x11.h 
    216 main-xaw.o: main-xaw.c $(INCS) main.h maid-x11.h 
    217 main-xpj.o: main-xpj.c $(INCS) main.h maid-x11.h 
    218 main-lfb.o: main-lfb.c $(INCS) main.h 
    219 main.o: main.c $(INCS) main.h 
     242# X11 dependencies 
     243$(X11OBJS) : $(INCS) maid-x11.h main.h 
     244 
     245# Basic dependencies for main-xxx.c, main.c 
     246$(MAINOBJS) : main.h $(INCS) 
     247