File: Makefile.top

package info (click to toggle)
glhack 1.2-8.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,744 kB
  • sloc: ansic: 208,571; cpp: 13,139; yacc: 2,005; makefile: 1,152; lex: 377; sh: 121; awk: 89; sed: 11
file content (147 lines) | stat: -rw-r--r-- 4,533 bytes parent folder | download | duplicates (22)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#	NetHack Makefile (VMS) - top level for making & installing everything.
#	SCCS Id: @(#)Makefile.top	3.4	2003/05/19

#  Copy this file to <top>Makefile.; edit the appropriate values for
#  GAMEDIR ("playground" location) and GAMEOWNER (UIC or identifier
#  for the owner of playground files).

#	usage:	mms all,install
#	  or	mms no_tools,all,install
#	  or substitute freeware `MMK' for Digital's `MMS'.

MAKE	= $(MMS)
CD	= set default
ECHO	= write sys$output
EXEC	= @
NOOP	= continue		# don't do anything interesting
TOUCH	= set file/truncate	# multiple files per $(TOUCH), but no creation
# support directories, relative to 'top'
DAT = [.dat]
DOC = [.doc]
SRC = [.src]
TOP = [-]	# relative to the others
UTL = [.util]
VMS = [.sys.vms]

GAMEDIR =			# defaults to [.play]
GAMEOWNER =			# defaults to installer's UIC
# these are the distributed values in [.include]vmsconf.h
#GAMEDIR = DISK$USERS:[GAMES.NETHACK.3-4-2.PLAY]
#GAMEOWNER = NHWIZARD

# just about everything, except installation
all :	program utilities data dlb_data documentation
      @ $(ECHO) "all code and data is now up to date."

program :
	$(CD) $(SRC)
	$(MAKE)$(MAKEFLAGS) all
      @ $(CD) $(TOP)
utilities :
	$(CD) $(UTL)
	$(MAKE)$(MAKEFLAGS) all
      @ $(CD) $(TOP)
data :
	$(CD) $(DAT)
	$(MAKE)$(MAKEFLAGS) all
      @ $(CD) $(TOP)
documentation :
	$(CD) $(DOC)
	$(MAKE)$(MAKEFLAGS) all
      @ $(CD) $(TOP)

install :	program all_data make_directories create_writeable_files update
      @ $(ECHO) "installation is now complete."

# assume there're no active games in progress
update	:	place_readonly_files place_executable place_vms_support
      @ open/Write f tmp-update.com;
      @ write f "$ set noon"
      @ write f "$ if p1.eqs."""" then  p1 = f$trnlnm(""HACKDIR"")"
      @ write f "$ if p1.eqs."""" then  p1 = ""[.play]"""
      @ write f "$ old_default = f$environ(""DEFAULT"")"
      @ write f "$ set default 'p1'"
      @ write f\
 "$ if f$search(""*.*;-2"").nes."""" then  set file/prot=(s:rwed,o:rwed) *.*;-2"
      @ write f\
 "$ if f$search(""*.*;-1"").nes."""" then  set file/prot=(s:rwed,o:rwed) *.*;-1"
      @ write f "$ if f$search(""*.*;-1"").nes."""" then  purge"
      @ write f "$! if f$search(""bones*.*"").nes."""" then  $(TOUCH) bones*.*"
      @ write f "$! if f$search(""[.save]*"").nes."""" then  $(TOUCH) [.save]*"
      @ write f "$ set default 'old_default'"
      @ write f "$ exit"
      @ close f
      - $(EXEC)tmp-update.com; $(GAMEDIR)  !purge old version
      @ delete tmp-update.com; 
      @ $(ECHO) "playground files updated."

Guidebook :
	$(CD) $(DOC)
	$(MAKE)$(MAKEFLAGS) Guidebook
      @ $(CD) $(TOP)
manpages :
	$(CD) $(DOC)
	$(MAKE)$(MAKEFLAGS) manpages
      @ $(CD) $(TOP)

all_data : data dlb_data
      @ $(NOOP)

dlb_data :
	$(EXEC)$(VMS)install.com "$(GAMEDIR)" "$(GAMEOWNER)" dlb

make_directories :
	$(EXEC)$(VMS)install.com "$(GAMEDIR)" "$(GAMEOWNER)" directories

create_writeable_files :
	$(EXEC)$(VMS)install.com "$(GAMEDIR)" "$(GAMEOWNER)" writeable_files

place_readonly_files :
	$(EXEC)$(VMS)install.com "$(GAMEDIR)" "$(GAMEOWNER)" readonly_files

place_executable :
	$(EXEC)$(VMS)install.com "$(GAMEDIR)" "$(GAMEOWNER)" executable

place_vms_support :
	$(EXEC)$(VMS)install.com "$(GAMEDIR)" "$(GAMEOWNER)" termcap
	$(EXEC)$(VMS)install.com "$(GAMEDIR)" "$(GAMEOWNER)" procedure
	$(EXEC)$(VMS)install.com "$(GAMEDIR)" "$(GAMEOWNER)" documentation


# 'make no_tools' should be done first if you don't have the appropriate
# tools to process the parser and scanner for the special level and
# dungeon compilers; doing so will copy distributed, pre-processed files
# from [.sys.share] to [.util].  If you _do_ have the tools, be sure to
# edit [.util]Makefile so that it uses the right ones.
no_tools :
	$(CD) $(UTL)
	$(MAKE)$(MAKEFLAGS) no_yacc
	$(MAKE)$(MAKEFLAGS) no_lex
      @ $(CD) $(TOP)


# 'make clean' removes all the .obj files, but leaves around all the executables
# and compiled data files.
clean :
	$(CD) $(SRC)
      - $(MAKE)$(MAKEFLAGS) clean
      @ $(CD) $(TOP)
	$(CD) $(UTL)
      - $(MAKE)$(MAKEFLAGS) clean
      @ $(CD) $(TOP)

# 'make spotless' returns the source tree to near-distribution condition.
# it removes .obj files, executables, and compiled data files.
spotless :
	$(CD) $(SRC)
      - $(MAKE)$(MAKEFLAGS) spotless
      @ $(CD) $(TOP)
	$(CD) $(UTL)
      - $(MAKE)$(MAKEFLAGS) spotless
      @ $(CD) $(TOP)
	$(CD) $(DAT)
      - $(MAKE)$(MAKEFLAGS) spotless
      @ $(CD) $(TOP)
	$(CD) $(DOC)
      - $(MAKE)$(MAKEFLAGS) spotless
      @ $(CD) $(TOP)