1#ident "@(#)rules.sps	1.16 18/08/16 "
2###########################################################################
3# Written 2005-2013 by J. Schilling
4###########################################################################
5#
6# Rules for wrapping around other make systems
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###########################################################################
23PTARGET=	$(TARGET)
24SRCFILE=	$(TARGET)
25###########################################################################
26
27_INSMODEI=	$(_UNIQ)$(INSMODE)
28__INSMODEI=	$(_INSMODEI:$(_UNIQ)=$(INSMODEF))
29INSMODEI=	$(__INSMODEI:$(_UNIQ)%=%)
30
31#all:		$(SRCFILE)
32
33###########################################################################
34include		$(SRCROOT)/$(RULESDIR)/sub.htm
35include		$(SRCROOT)/$(RULESDIR)/rules.clr
36#include		$(SRCROOT)/$(RULESDIR)/rules.ins
37include		$(SRCROOT)/$(RULESDIR)/rules.tag
38include		$(SRCROOT)/$(RULESDIR)/rules.hlp
39include		$(SRCROOT)/$(RULESDIR)/dummy.dep
40include		$(SRCROOT)/$(RULESDIR)/rules.tpk
41###########################################################################
42
43all: $(ARCHDIR)/config.status $(POSTCONFIG)
44	cd $(ARCHDIR)/; "$(MAKE)" $(MAKEMACS) $(MAKEOPTS) $@
45
46install: all
47	cd $(ARCHDIR)/; DESTDIR=$(DEST_DIR) "$(MAKE)" $(MAKEMACS) $(MAKEOPTS) DESTDIR=$(DEST_DIR) $@
48
49#
50# Hack until the <mach>-<os>-*cc.rul files are updated
51#
52_HCC_COM=	$(OARCH:%-gcc=gcc)
53HCC_COM=	$(_HCC_COM:%-cc=cc)
54
55_XCC_COM=	$(_UNIQ)$(CC_COM)
56__XCC_COM=	$(_XCC_COM:$(_UNIQ)=$(HCC_COM))
57XCC_COM=	$(__XCC_COM:$(_UNIQ)%=%)
58
59_CONF_SCRIPT=	$(_UNIQ)$(CONF_SCRIPT)
60__CONF_SCRIPT=	$(_CONF_SCRIPT:$(_UNIQ)=configure)
61CONFSCRIPT=	$(__CONF_SCRIPT:$(_UNIQ)%=%)
62
63#
64# Note: $(___CONF_SCR:$(_UNIQ)=:) is not accepted by Sun make
65# because of a parser bug. We thus use "true".
66#
67COLON=:
68_CONF_SCR=	$(CONFSCRIPT:none=)
69__CONF_SCR=	$(_CONF_SCR:%=../../$(SRC_DIR)/%)
70___CONF_SCR=	$(_UNIQ)$(__CONF_SCR)
71____CONF_SCR=	$(___CONF_SCR:$(_UNIQ)=true)
72PCONFSCRIPT=	$(____CONF_SCR:$(_UNIQ)%=%)
73
74_LNDIR_PRG=	$(_UNIQ)$(LNDIR_PRG)
75__LNDIR_PRG=	$(_LNDIR_PRG:$(_UNIQ)=:)
76LNDIRPRG=	$(__LNDIR_PRG:$(_UNIQ)%=%)
77
78#$(ARCHDIR)/config.status: $(SRC_DIR)/$(CONFSCRIPT)
79
80			# Expands to: $(SRC_DIR)/$(CONFSCRIPT) is non-empty
81$(ARCHDIR)/config.status: $(_CONF_SCR:%=$(SRC_DIR)/%)
82	mkdir -p $(ARCHDIR)/; cd $(ARCHDIR)/; \
83	$(LNDIRPRG) ../../$(SRC_DIR)/; \
84	CC="$(XCC_COM)" CFLAGS="$(C_FLAGS) $(CFLAGS)" MAKE="$(MAKE)" $(MAKEMACS) $(PCONFSCRIPT) $(CONF_OPTS) && \
85	( [ ! -f config.status ] && touch config.status || : )
86