1#ident @(#)rules.inc	1.13 21/07/11
2###########################################################################
3# Written 1999-2021 by J. Schilling
4###########################################################################
5#
6# Rules for creating include files (usually found in .../incs/machdir)
7#
8###########################################################################
9# Copyright (c) J. Schilling
10###########################################################################
11# The contents of this file are subject to the terms of the
12# Common Development and Distribution License, Version 1.0 only
13# (the "License").  You may not use this file except in compliance
14# with the License.
15#
16# See the file CDDL.Schily.txt in this distribution for details.
17# A copy of the CDDL is also available via the Internet at
18# http://www.opensource.org/licenses/cddl1.txt
19#
20# When distributing Covered Code, include this CDDL HEADER in each
21# file and include the License file CDDL.Schily.txt from this distribution.
22###########################################################################
23#_EXEEXT=	$(EXEEXT)	# Do not install as xxx.h.exe
24_XEXEEXT=	$(XEXEEXT)
25###########################################################################
26include		$(SRCROOT)/$(RULESDIR)/rules.obj
27###########################################################################
28
29PTARGET=	$(OINCSDIR)/$(TARGET)
30PTARGETC=	$(ARCHDIR)/$(TARGETC)
31PTARGETCX=	$(ARCHDIR)/$(TARGETC)$(_EXEEXT)
32
33_INSMODEI=	$(_UNIQ)$(INSMODE)
34__INSMODEI=	$(_INSMODEI:$(_UNIQ)=$(INSMODEF))
35INSMODEI=	$(__INSMODEI:$(_UNIQ)%=%)
36
37__LD_OUTPUT_OPTION=	$(_UNIQ)$(LD_OUTPUT_OPTION)
38___LD_OUTPUT_OPTION=	$(__LD_OUTPUT_OPTION:$(_UNIQ)=-o $@)
39_LD_OUTPUT_OPTION=	$(___LD_OUTPUT_OPTION:$(_UNIQ)%=%)
40
41LIBS_PATH += $(LIBS_PATH_STATIC)
42
43all:		$(PTARGETCX) $(PTARGET)
44
45###########################################################################
46# We used to use $(LDCC) $(_LD_OUTPUT_OPTION) $(POFILES) $(LDFLAGS) $(LDLIBS)
47# but the compiler on z/OS does not like $(LDFLAGS) after $(POFILES).
48###########################################################################
49$(PTARGETCX):	$(OFILES) $(SRCLIBS)
50		$(LDCC) $(_LD_OUTPUT_OPTION) $(LDFLAGS) $(POFILES) $(LDLIBS)
51#
52# If calling "$(PTARGETC)$(_XEXEEXT)" fails, this may be a cross compilation,
53# so retry to run the command under control of "$(CONFIG_RMTCALL)".
54#
55# We previously had;
56# $(PTARGET):	$(OINCSDIR) $(PTARGETCX)
57# but that caused $(PTARGET) not only to depend on the existence but also
58# on the time stamp of the directory $(OINCSDIR), that could change.
59# Since rules.top contains a rule to create $(OINCSDIR), we may safely assume
60# that $(OINCSDIR) exists before we create $(PTARGET)
61#
62$(PTARGET):	$(PTARGETCX)
63		$(NOECHO)echo "	==> GENERATING include file \"$@\""; \
64		$(PTARGETC)$(_XEXEEXT) > $@ || \
65		$(CONFIG_RMTCALL) $(PTARGETC)$(_XEXEEXT) > $@
66
67###########################################################################
68include		$(SRCROOT)/$(RULESDIR)/sub.htm
69include		$(SRCROOT)/$(RULESDIR)/rules.clr
70include		$(SRCROOT)/$(RULESDIR)/rules.ins
71include		$(SRCROOT)/$(RULESDIR)/rules.tag
72include		$(SRCROOT)/$(RULESDIR)/rules.hlp
73include		$(SRCROOT)/$(RULESDIR)/rules.dep
74###########################################################################
75