OSDN Git Service

shrink mine
[nethackexpress/trunk.git] / sys / vms / Makefile.top
1 #       NetHack Makefile (VMS) - top level for making & installing everything.
2 #       SCCS Id: @(#)Makefile.top       3.4     2003/05/19
3
4 #  Copy this file to <top>Makefile.; edit the appropriate values for
5 #  GAMEDIR ("playground" location) and GAMEOWNER (UIC or identifier
6 #  for the owner of playground files).
7
8 #       usage:  mms all,install
9 #         or    mms no_tools,all,install
10 #         or substitute freeware `MMK' for Digital's `MMS'.
11
12 MAKE    = $(MMS)
13 CD      = set default
14 ECHO    = write sys$output
15 EXEC    = @
16 NOOP    = continue              # don't do anything interesting
17 TOUCH   = set file/truncate     # multiple files per $(TOUCH), but no creation
18 # support directories, relative to 'top'
19 DAT = [.dat]
20 DOC = [.doc]
21 SRC = [.src]
22 TOP = [-]       # relative to the others
23 UTL = [.util]
24 VMS = [.sys.vms]
25
26 GAMEDIR =                       # defaults to [.play]
27 GAMEOWNER =                     # defaults to installer's UIC
28 # these are the distributed values in [.include]vmsconf.h
29 #GAMEDIR = DISK$USERS:[GAMES.NETHACK.3-4-2.PLAY]
30 #GAMEOWNER = NHWIZARD
31
32 # just about everything, except installation
33 all :   program utilities data dlb_data documentation
34       @ $(ECHO) "all code and data is now up to date."
35
36 program :
37         $(CD) $(SRC)
38         $(MAKE)$(MAKEFLAGS) all
39       @ $(CD) $(TOP)
40 utilities :
41         $(CD) $(UTL)
42         $(MAKE)$(MAKEFLAGS) all
43       @ $(CD) $(TOP)
44 data :
45         $(CD) $(DAT)
46         $(MAKE)$(MAKEFLAGS) all
47       @ $(CD) $(TOP)
48 documentation :
49         $(CD) $(DOC)
50         $(MAKE)$(MAKEFLAGS) all
51       @ $(CD) $(TOP)
52
53 install :       program all_data make_directories create_writeable_files update
54       @ $(ECHO) "installation is now complete."
55
56 # assume there're no active games in progress
57 update  :       place_readonly_files place_executable place_vms_support
58       @ open/Write f tmp-update.com;
59       @ write f "$ set noon"
60       @ write f "$ if p1.eqs."""" then  p1 = f$trnlnm(""HACKDIR"")"
61       @ write f "$ if p1.eqs."""" then  p1 = ""[.play]"""
62       @ write f "$ old_default = f$environ(""DEFAULT"")"
63       @ write f "$ set default 'p1'"
64       @ write f\
65  "$ if f$search(""*.*;-2"").nes."""" then  set file/prot=(s:rwed,o:rwed) *.*;-2"
66       @ write f\
67  "$ if f$search(""*.*;-1"").nes."""" then  set file/prot=(s:rwed,o:rwed) *.*;-1"
68       @ write f "$ if f$search(""*.*;-1"").nes."""" then  purge"
69       @ write f "$! if f$search(""bones*.*"").nes."""" then  $(TOUCH) bones*.*"
70       @ write f "$! if f$search(""[.save]*"").nes."""" then  $(TOUCH) [.save]*"
71       @ write f "$ set default 'old_default'"
72       @ write f "$ exit"
73       @ close f
74       - $(EXEC)tmp-update.com; $(GAMEDIR)  !purge old version
75       @ delete tmp-update.com; 
76       @ $(ECHO) "playground files updated."
77
78 Guidebook :
79         $(CD) $(DOC)
80         $(MAKE)$(MAKEFLAGS) Guidebook
81       @ $(CD) $(TOP)
82 manpages :
83         $(CD) $(DOC)
84         $(MAKE)$(MAKEFLAGS) manpages
85       @ $(CD) $(TOP)
86
87 all_data : data dlb_data
88       @ $(NOOP)
89
90 dlb_data :
91         $(EXEC)$(VMS)install.com "$(GAMEDIR)" "$(GAMEOWNER)" dlb
92
93 make_directories :
94         $(EXEC)$(VMS)install.com "$(GAMEDIR)" "$(GAMEOWNER)" directories
95
96 create_writeable_files :
97         $(EXEC)$(VMS)install.com "$(GAMEDIR)" "$(GAMEOWNER)" writeable_files
98
99 place_readonly_files :
100         $(EXEC)$(VMS)install.com "$(GAMEDIR)" "$(GAMEOWNER)" readonly_files
101
102 place_executable :
103         $(EXEC)$(VMS)install.com "$(GAMEDIR)" "$(GAMEOWNER)" executable
104
105 place_vms_support :
106         $(EXEC)$(VMS)install.com "$(GAMEDIR)" "$(GAMEOWNER)" termcap
107         $(EXEC)$(VMS)install.com "$(GAMEDIR)" "$(GAMEOWNER)" procedure
108         $(EXEC)$(VMS)install.com "$(GAMEDIR)" "$(GAMEOWNER)" documentation
109
110
111 # 'make no_tools' should be done first if you don't have the appropriate
112 # tools to process the parser and scanner for the special level and
113 # dungeon compilers; doing so will copy distributed, pre-processed files
114 # from [.sys.share] to [.util].  If you _do_ have the tools, be sure to
115 # edit [.util]Makefile so that it uses the right ones.
116 no_tools :
117         $(CD) $(UTL)
118         $(MAKE)$(MAKEFLAGS) no_yacc
119         $(MAKE)$(MAKEFLAGS) no_lex
120       @ $(CD) $(TOP)
121
122
123 # 'make clean' removes all the .obj files, but leaves around all the executables
124 # and compiled data files.
125 clean :
126         $(CD) $(SRC)
127       - $(MAKE)$(MAKEFLAGS) clean
128       @ $(CD) $(TOP)
129         $(CD) $(UTL)
130       - $(MAKE)$(MAKEFLAGS) clean
131       @ $(CD) $(TOP)
132
133 # 'make spotless' returns the source tree to near-distribution condition.
134 # it removes .obj files, executables, and compiled data files.
135 spotless :
136         $(CD) $(SRC)
137       - $(MAKE)$(MAKEFLAGS) spotless
138       @ $(CD) $(TOP)
139         $(CD) $(UTL)
140       - $(MAKE)$(MAKEFLAGS) spotless
141       @ $(CD) $(TOP)
142         $(CD) $(DAT)
143       - $(MAKE)$(MAKEFLAGS) spotless
144       @ $(CD) $(TOP)
145         $(CD) $(DOC)
146       - $(MAKE)$(MAKEFLAGS) spotless
147       @ $(CD) $(TOP)