File: make.com

package info (click to toggle)
xpuzzles 7.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 14,208 kB
  • sloc: ansic: 94,274; makefile: 7,477; sh: 3,221
file content (261 lines) | stat: -rw-r--r-- 7,412 bytes parent folder | download | duplicates (4)
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
$ save_verify='f$verify(0)
$! set ver
$!
$!      Compile and link for xrubik
$!
$! USAGE:
$! @make [debug clobber clean]
$!       debug : compile with debugger switch
$!       clean : clean all except executable
$!       clobber : clean all
$!
$! If you have
$!              XVMSUTILS library (VMS6.2 or lower)
$!              XPM library
$!              Mesa GL library
$! insert the correct directory instead of X11:
$ xvmsutilsf="X11:XVMSUTILS.OLB"
$ xpmf="SYS$LIBRARY:LIBXPM.OLB"
$ glf="GL:LIBMESAGL.OLB"
$ glf_share="GL:LIBMESAGL.EXE"
$ gluf="GL:LIBMESAGLU.OLB"
$ gluf_share="GL:LIBMESAGLU.EXE"
$!
$! Already assumes DEC C on Alpha.
$! Assume VAX C on VAX.
$ decc=0
$! Assume DEC C on VAX.
$! decc=1
$!
$! if sound<>0 sound capability is included (only available on Alpha)
$! from vms_amd.c and vms_amd.h
$ sound=1
$! sound=0
$!
$ QUOTE = """""""""
$ QUOTE = QUOTE + QUOTE + QUOTE
$ move = "MOVESOUND=" + QUOTE + "[]move.au" + QUOTE
$ scorepath = "SCOREPATH=" + QUOTE + "[]" + QUOTE
$ scorefile = "SCOREFILE=" + QUOTE + "rubik.scores" + QUOTE
$ logpath = "LOGPATH=" + QUOTE + "[]" + QUOTE
$ logfile = "LOGFILE=" + QUOTE + "rubik.log" + QUOTE
$ defread=="''move'"
$ defscore=="''scorepath',''scorefile'"
$ deflog=="''logpath',''logfile'"
$!
$! NOTHING SHOULD BE MODIFIED BELOW
$!
$ if p1 .eqs. "CLEAN" then goto Clean
$ if p1 .eqs. "CLOBBER" then goto Clobber
$!
$ axp=f$getsyi("HW_MODEL") .ge. 1024
$ sys_ver=f$edit(f$getsyi("version"),"compress")
$ if f$extract(0,1,sys_ver) .nes. "V"
$ then
$   type sys$input
This script will assume that the operating system version is at least V7.0.
$!
$   sys_ver="V7.0"
$ endif
$ sys_maj=0+f$extract(1,1,sys_ver)
$ if sys_maj .lt. 7
$ then
$   xvmsutils=f$search("''xvmsutilsf'") .nes. ""
$ endif
$ xpm=f$search("''xpmf'") .nes. ""
$ gl=f$search("''glf'") .nes. ""
$ gl_share=f$search("''glf_share'") .nes. ""
$ glu=f$search("''gluf'") .nes. ""
$ glu_share=f$search("''gluf_share'") .nes. ""
$ mmov=f$search("''mmovf'") .nes. ""
$!
$!
$! Create .opt file
$ close/nolog optf
$ open/write optf xrubik.opt
$!
$ defs=="VMS"
$ defs=="''defs',HAVE_MOTIF"
$ if xpm then defs=="''defs',HAVE_XPM"
$ if gl .or. gl_share then defs=="''defs',HAVE_OPENGL,HAVE_GLBINDTEXTURE"
$ if mmov .and. sound
$ then
$   defs=="''defs',HAS_MMOV"
$   if f$search("MMOV.DIR") .eqs. ""
$   then
$     create/dir [.mmov]
$     set def [.mmov]
$     copy SYS$COMMON:[SYSHLP.EXAMPLES.MMOV.COMMON]*.* []
$! spawn included to avoid unwanted redefinition of logicals
$     spawn @build_common
$     copy SYS$COMMON:[SYSHLP.EXAMPLES.MMOV.VIDEO]readavi.c []
$     spaw @[-]mmov
$     set def [-]
$   endif
$ endif
$ if axp .and. sound then defs=="''defs',USE_VMSPLAY"
$ if sys_maj .lt. 7
$ then
$   if xvmsutils then defs=="''defs',USE_XVMSUTILS"
$ else
$   defs=="''defs',SRAND=srand48,LRAND=lrand48,MAXRAND=2147483648.0"
$ endif
$ defs=="''defread',''defscore',''deflog',''defs'"
$!
$!
$! Establish the Compiling Environment
$!
$! Set compiler command
$ if axp
$ then
$   cc=="cc/standard=vaxc/define=(''defs')"
$ else
$   if decc
$   then
$     cc=="cc/decc/standard=vaxc/define=(''defs')"
$   else ! VAX C
$     cc=="cc/define=(''defs')"
$   endif
$ endif
$ if p1 .eqs. "DEBUG" .or. p2 .eqs. "DEBUG" .or. p3 .eqs. "DEBUG"
$ then
$   if axp
$   then
$     cc=="cc/deb/noopt/standard=vaxc/define=(''defs')/list"
$   else
$     if decc
$     then
$       cc=="cc/deb/noopt/decc/standard=vaxc/define=(''defs')/list"
$     else ! VAX C
$       cc=="cc/deb/noopt/define=(''defs')/list"
$     endif
$   endif
$   link=="link/deb"
$ endif
$!
$ if axp .or. .not. decc
$ then
$   define/nolog sys sys$library
$ endif
$!
$ write sys$output "Compiling xrubik with ''defs'"
$ call make Rubik.obj  "cc Rubik.c"  Rubik.c RubikP.h Rubik.h xwin.h file.h timer.h rngs.h sound.h
$ call make RubikS.obj  "cc RubikS.c"  RubikS.c RubikP.h Rubik.h
$ call make RubikU.obj  "cc RubikU.c"  RubikU.c RubikP.h Rubik.h
$ call make Rubik2d.obj  "cc Rubik2d.c"  Rubik2d.c RubikP.h Rubik.h Rubik2dP.h Rubik2d.h xwin.h
$ call make Rubik3d.obj  "cc Rubik3d.c"  Rubik3d.c RubikP.h Rubik.h Rubik3dP.h Rubik3d.h xwin.h
$ if gl .or. gl_share
$ then
$   call make RubikGL.obj  "cc RubikGL.c"  RubikGL.c RubikP.h Rubik.h RubikGLP.h RubikGL.h
$ endif
$ call make xwin.obj  "cc xwin.c"  xwin.c xwin.h
$ call make file.obj  "cc file.c"  file.c file.h
$ call make timer.obj  "cc timer.c"  timer.c timer.h
$ call make rngs.obj  "cc rngs.c"  rngs.c rngs.h
$ if axp .and. sound
$ then
$   call make sound.obj  "cc sound.c"  sound.c sound.h file.h vms_amd.h
$   call make vms_amd.obj  "cc vms_amd.c"  vms_amd.c vms_amd.h
$ else
$   call make sound.obj  "cc sound.c"  sound.c sound.h file.h
$ endif
$ call make xrubik.obj  "cc xrubik.c"  xrubik.c Rubik.h xwin.h file.h version.h
$!
$! Get libraries
$ if xpm then write optf "''xpmf'/lib"
$ if gl then write optf "''glf'/lib"
$ if gl_share then write optf "''glf_share'/share"
$ if glu then write optf "''gluf'/lib"
$ if glu_share then write optf "''gluf_share'/share"
$ if sys_maj .lt. 7
$ then
$   if xvmsutils then write optf "''xvmsutilsf'/lib"
$ endif
$! if .not. axp then write optf "sys$library:vaxcrtl/lib"
$ write optf "sys$library:vaxcrtl/lib"
$ if mmov
$ then
$   write optf "[.mmov]vms_mmov.obj"
$   write optf "[.mmov]readavi.obj"
$   write optf "[.mmov]commonlib.olb/lib"
$   write optf "sys$library:mmov.olb/lib"
$   write optf "sys$share:cma$open_rtl.exe/share"
$ endif
$ if axp then write optf "sys$library:ucx$ipc_shr/share"
$ if axp then write optf "sys$share:decw$xextlibshr/share"
$ if axp then write optf "sys$share:decw$xtlibshrr5/share"
$ if .not. axp then write optf "sys$library:ucx$ipc/lib"
$! write optf "sys$share:decw$dxmlibshr/share"
$ write optf "sys$share:decw$xmlibshr12/share"
$ write optf "sys$share:decw$xlibshr/share"
$ close optf
$!
$! LINK
$ write sys$output "Linking xrubik"
$ link/map xrubik/opt
$!
$ if mmov
$ then
$   write sys$output "NOTE:"
$   write sys$output "Sound files are played only when the user has the SYSNAM"
$   write sys$output "as an authorized privilege"
$ endif
$ set noverify
$ exit
$!
$Clobber:      ! Delete executables, Purge directory and clean up object files
$!                and listings
$ delete/noconfirm/log xrubik.exe;*
$!
$Clean:        ! Purge directory, clean up object files and listings
$ close/nolog optf
$ purge
$ delete/noconfirm/log *.lis;*
$ delete/noconfirm/log *.obj;*
$ delete/noconfirm/log *.opt;*
$ delete/noconfirm/log *.map;*
$!
$ exit
$!
! SUBROUTINE TO CHECK DEPENDENCIES
$ make: subroutine
$   v='f$verify(0)
$!   p1       What we are trying to make
$!   p2       Command to make it
$!   p3 - p8  What it depends on
$
$   if (f$extract(0,3,p2) .eqs. "cc ") then write optf "''p1'"
$   if (f$extract(0,3,p2) .eqs. "CC ") then write optf "''p1'"
$
$   if f$search(p1) .eqs. "" then goto MakeIt
$   time=f$cvtime(f$file(p1,"RDT"))
$   arg=3
$Loop:
$   argument=p'arg
$   if argument .eqs. "" then goto Exit
$   el=0
$Loop2:
$   file=f$element(el," ",argument)
$   if file .eqs. " " then goto Endl
$   afile=""
$Loop3:
$   ofile=afile
$   afile=f$search(file)
$   if afile .eqs. "" .or. afile .eqs. ofile then goto NextEl
$   if f$cvtime(f$file(afile,"RDT")) .gts. time then goto MakeIt
$   goto Loop3
$NextEL:
$   el=el+1
$   goto Loop2
$EndL:
$   arg=arg+1
$   if arg .le. 8 then goto Loop
$   goto Exit
$
$MakeIt:
$   set verify
$   'p2
$   vv='f$verify(0)
$Exit:
$   if v then set verify
$ endsubroutine