File: make.com

package info (click to toggle)
saoimage 1.19-5
  • links: PTS
  • area: main
  • in suites: slink
  • size: 3,256 kB
  • ctags: 3,610
  • sloc: ansic: 36,050; makefile: 215; sh: 11
file content (97 lines) | stat: -rw-r--r-- 2,089 bytes parent folder | download | duplicates (5)
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
$!-------------------------------------------------------------------------
$!
$! MAKE.COM - Build SAOimage Button library
$!
$!	Parameters:
$!		P1	null	Compile and update all sources
$!			xxx	Source module - compile and update library
$!		P2	options	CC compiler options
$!
$!-------------------------------------------------------------------------
$
$
$ gosub BUILD_SETUP
$
$ if p1 .eqs. ""     then goto BUILD_ALL
$
$ gosub COMPILE_MODULE
$ exit
$
$
$BUILD_SETUP:
$
$ set noon
$
$ define/nolog  c$include     [-.hfiles],decw$include,decc$library_include
$ define/nolog  vaxc$include  c$include
$ define/nolog  X11           decw$include
$ define/nolog  sys           decc$library_include
$
$ compile := cc/stand=vaxc/extern_model=common_block/shared_globals -
  /nested_incl/define=(IMTOOL)/nodebug/optimize
$ libname := libbtn.olb
$ makefile:= make.lst
$
$ return
$
$
$COMPILE_MODULE:
$
$ p1 = p1 - ".C"
$ compile 'p1' 'p2' 'make_options'
$ library/log 'libname' 'p1'
$
$ return
$
$
$BUILD_ALL:
$
$ if f$search(libname) .eqs. "" then library/create 'libname'
$
$ open/read make_input 'makefile'
$
$ReadLoop:
$ read/end=ReadEOF/err=CLEANUP make_input line
$ first = f$extract(0,1,line)
$ if first .nes. "!" .and. first .nes. "#"
$ then
$	make_options = f$extract(f$locate("/",line),f$length(line),line)
$
$	p1  = f$edit(line,"UPCASE") - ".C" - make_options
$	p1s = p1 + ".C"
$	p1o = p1 + ".OBJ"
$	if f$search(p1s) .eqs. ""
$	then
$		write sys$output p1s + " not found!"
$		goto ReadLoop
$	endif
$	if f$search(p1o) .eqs. "" then goto Recompile
$
$	srcdate = f$file_attributes(p1s,"RDT")
$	objdate = f$file_attributes(p1o,"RDT")
$	bin_srcdate = f$cvtime(srcdate)
$	bin_objdate = f$cvtime(objdate)
$
$	if bin_srcdate .les. bin_objdate
$	then
$		write sys$output "Up-to-date... " + p1
$		goto ReadLoop
$	endif
$Recompile:
$	write sys$output "Compiling... " + p1
$
$ p1 = p1 - ".C"
$ compile 'p1' 'p2' 'make_options'
$ library/log 'libname' 'p1'
$
$ endif
$ goto ReadLoop
$
$ReadEOF:
$ close make_input
$ exit
$
$
$CLEANUP:
$ if f$logical("MAKE_INPUT") .nes. "" then close make_input
$ exit