summaryrefslogtreecommitdiff
path: root/mnv/src/xxd/Make_vms.mms
blob: 34f80466ea57e4279d8aba90843321a56327a75b (plain)
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
# VMS MM[KS] makefile for XXD
# tested with MMK and MMS as well.
#
# Maintained by Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
#               2025-05-24  Steven M. Schweda <sms@antinode.info>
#
######################################################################
#
# Edit the lines in the Configuration section below to select.
#
# To build: use the following command line:
#
#	mms/descrip=Make_vms.mms
#	  or if you use mmk
#	mmk/descrip=Make_vms.mms
#
# To cleanup: mms/descrip=Make_vms.mms clean 
#
######################################################################
# Configuration section.
######################################################################
# Uncomment if want a debug version. Resulting executable is DMNV.EXE
######################################################################
# DEBUG = YES

######################################################################
# End of configuration section.
#
# Please, do not change anything below without programming experience.
######################################################################

# Define old MMK architecture macros when using MMS.
#
######################################################################
# Architecture identification and product destination selection.
# Define old MMK architecture macros when using MMS.
#
.IFDEF MMS$ARCH_NAME            # MMS$ARCH_NAME
ALPHA_X_ALPHA = 1
IA64_X_IA64 = 1
VAX_X_VAX = 1
X86_64_X_X86_64 = 1
.IFDEF ARCH                         # ARCH
ARCH_NAME = $(ARCH)
.ELSE                               # ARCH
ARCH_NAME = $(MMS$ARCH_NAME)
.ENDIF                              # ARCH
.IFDEF $(ARCH_NAME)_X_ALPHA         # $(ARCH_NAME)_X_ALPHA
__ALPHA__ = 1
.ENDIF                              # $(ARCH_NAME)_X_ALPHA
.IFDEF $(ARCH_NAME)_X_IA64          # $(ARCH_NAME)_X_IA64
__IA64__ = 1
.ENDIF                              # $(ARCH_NAME)_X_IA64
.IFDEF $(ARCH_NAME)_X_VAX           # $(ARCH_NAME)_X_VAX
__VAX__ = 1
.ENDIF                              # $(ARCH_NAME)_X_VAX
.IFDEF $(ARCH_NAME)_X_X86_64        # $(ARCH_NAME)_X_X86_64
__X86_64__ = 1
.ENDIF                              # $(ARCH_NAME)_X_X86_64
.ELSE                           # MMS$ARCH_NAME
.IFDEF __MMK__                      # __MMK__
.IFDEF ARCH                             # ARCH
.IFDEF __$(ARCH)__                          # __$(ARCH)__
.ELSE                                       # __$(ARCH)__
__$(ARCH)__ = 1
.ENDIF                                      # __$(ARCH)__                      
.ENDIF                                  # ARCH
.ENDIF                              # __MMK__
.ENDIF                          # MMS$ARCH_NAME
#
# Combine command-line VAX C compiler macros.
#
.IFDEF VAXC                     # VAXC
VAXC_OR_FORCE_VAXC = 1
.ELSE                           # VAXC
.IFDEF FORCE_VAXC                   # FORCE_VAXC
VAXC_OR_FORCE_VAXC = 1
.ENDIF                              # FORCE_VAXC
.ENDIF                          # VAXC
#
# Analyze architecture-related and option macros.
# (Sense x86_64 before IA64 for old MMK and x86_64 cross tools.)
#
.IFDEF __X86_64__               # __X86_64__
DECC = 1
DESTM = X86_64
.ELSE                           # __X86_64__
.IFDEF __IA64__                     # __IA64__
DECC = 1
DESTM = IA64
.ELSE                               # __IA64__
.IFDEF __ALPHA__                        # __ALPHA__
DECC = 1
DESTM = ALPHA
.ELSE                                   # __ALPHA__
.IFDEF __VAX__                              # __VAX__
.IFDEF VAXC_OR_FORCE_VAXC                       # VAXC_OR_FORCE_VAXC
DESTM = VAXV
.ELSE                                           # VAXC_OR_FORCE_VAXC
DECC = 1
DESTM = VAX
.ENDIF                                          # VAXC_OR_FORCE_VAXC
.ELSE                                       # __VAX__
DESTM = UNK
UNK_DEST = 1
.ENDIF                                      # __VAX__
.ENDIF                                  # __ALPHA__
.ENDIF                              # __IA64__
.ENDIF                          # __X86_64__

.IFDEF PROD                     # PROD
DEST = $(PROD)
.ELSE                           # PROD
DEST = $(DESTM)
.ENDIF                          # PROD

.FIRST
.IFDEF __MMK__                  # __MMK__
	@ write sys$output ""
.ENDIF                          # __MMK__
#
# Create destination directory.
	@ write sys$output "Destination: [.$(DEST)]"
	@ write sys$output ""
	@ if (f$search( "$(DEST).DIR;1") .eqs. "") then -
         create /directory [.$(DEST)]
#
# Compiler setup

# Optimization.  The .c.obj rule will override this for specific modules
# where the VAX C compilers hang.   See VAX_NOOPTIM_LIST, below.
OPTIMIZE= /optim

.IFDEF __VAX__                  # __VAX__

# List of modules for which "Compaq C V6.4-005 on OpenVMS VAX V7.3"
# hangs.  Add more as needed (plus-separated).
VAX_NOOPTIM_LIST = blowfish+regexp+sha256

# Compiler command.
# Default: CC /DECC.  On non-VAX, or VAX with only DEC C installed,
# /DECC is harmless.  If both DEC C and VAX C are installed, and VAX C
# was selected as the default, then /DECC must be specified explicitly. 
# If both are installed, and DEC C is the default, but VAX C is desired,
# then define FORCE_VAXC to get VAX C (CC /VAXC).  If only VAX C is
# installed, then define VAXC to get (plain) CC.

.IFDEF DECC                         # DECC
CC_DEF = cc /decc
PREFIX = /prefix=all
.ELSE                               # DECC
.IFDEF FORCE_VAXC                       # FORCE_VAXC
CC_DEF = cc /vaxc
.ELSE                                   # FORCE_VAXC
CC_DEF = cc
.ENDIF                                  # FORCE_VAXC
.ENDIF                              # DECC
.ELSE                           # __VAX__

# Not VAX, therefore DEC C (/PREFIX).

CC_DEF = cc /decc
PREFIX  = /prefix=all

# These floating-point options are the defaults on IA64 and x86_64.
# This makes Alpha consistent.
FLOAT   = /float = ieee_float /ieee_mode = denorm_results

# Large-file support.  Unavailable on VAX and very old Alpha.  To
# disable, define NOLARGE.
.IFDEF NOLARGE
.ELSE
LARGE_DEF = , "_LARGEFILE"
.ENDIF # NOLARGE [ELSE]
.ENDIF                          # __VAX__ [ELSE]

.IFDEF VAXC_OR_FORCE_VAXC       # VAXC_OR_FORCE_VAXC
.ELSE                           # VAXC_OR_FORCE_VAXC
CCVER = YES     # Unreliable with VAX C.
.ENDIF                          # VAXC_OR_FORCE_VAXC [ELSE]

CDEFS = VMS $(LARGE_DEF)
DEFS = /define = ($(CDEFS))

.IFDEF LIST                     # LIST
LIST_OPT = /list=[.$(DEST)] /show=(all, nomessages)
.ENDIF                          # LIST

.IFDEF DEBUG                    # DEBUG
TARGET  =  [.$(DEST)]dxxd.exe
CFLAGS  = /debug/noopt$(PREFIX) $(LIST_OPT) /cross_reference/include=[]
LDFLAGS = /debug
.ELSE                           # DEBUG
TARGET  =  [.$(DEST)]xxd.exe
CFLAGS  = $(OPTIMIZE) $(PREFIX) $(LIST_OPT) /include=[]

LDFLAGS =
.ENDIF                          # DEBUG [ELSE]

CC = $(CC_DEF) $(CFLAGS)

LD_DEF  = link

.SUFFIXES : .obj .c

SOURCES	= xxd.c
OBJ_BASE = xxd.obj
OBJ     = [.$(DEST)]$(OBJ_BASE)

.c.obj :
	$(CC) $(DEFS) $< /object = $@

$(TARGET) : $(OBJ)
        -@ def_dev_dir_orig = f$environment( "default")
	-@ target_name_type = -
         f$parse( "$(TARGET)", , , "NAME", "SYNTAX_ONLY")+ -
         f$parse( "$(TARGET)", , , "TYPE", "SYNTAX_ONLY")
	-@ set default [.$(DEST)]
	$(LD_DEF) $(LDFLAGS) /exe = 'target_name_type' $(OBJ_BASE)
	-@ set default 'def_dev_dir_orig'

clean :
	-@ if (f$search( "[.$(DEST)]*.*") .nes. "") then -
         delete /noconfirm [.$(DEST)]*.*;*
	-@ if (f$search( "$(DEST).DIR") .nes. "") then -
         set protection = w:d $(DEST).DIR;*
	-@ if (f$search( "$(DEST).DIR") .nes. "") then -
         delete /noconfirm $(DEST).DIR;*

help :
        mcr sys$disk:$(TARGET) -h

version :
        mcr sys$disk:$(TARGET) -v


[.$(DEST)]xxd.obj : xxd.c