1#ident @(#)r-make.obj	1.10 18/08/16
2###########################################################################
3# Written 1996 by J. Schilling
4###########################################################################
5#
6# Object building rules for gmake
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# This defines a rule that compiles source files from current directory and
24# puts the resultant objects directly into $(ARCHDIR),
25# to allow concurrent compilation on different platforms.
26# Object file names are constructed from $(CFILES) and $(C++FILES).
27###########################################################################
28ARCHDIRX=		$(ARCHDIR)/
29___C++OFILES=		$(C++FILES:%.C=$(ARCHDIR)/%.$o)
30__C++OFILES=		$(___C++OFILES:%.cc=$(ARCHDIR)/%.$o)
31_C++OFILES=		$(__C++OFILES:%.cpp=$(ARCHDIR)/%.$o)
32C++OFILES=		$(_C++OFILES:%.cxx=$(ARCHDIR)/%.$o)
33C++POFILES=		$(C++OFILES)
34OFILES=			$(CFILES:%.c=$(ARCHDIR)/%.$o)	$(C++OFILES)
35POFILES=		$(CFILES:%.c=$(ARCHDIR)/%.$o)	$(C++POFILES)
36###########################################################################
37__COMPILE.c=		$(_UNIQ)$(COMPILE.c)
38___COMPILE.c=		$(__COMPILE.c:$(_UNIQ)=$(CCCC) $(C_FLAGS) $(CFLAGS) $(CPP_FLAGS) $(CPPFLAGS) -c)
39_COMPILE.c=		$(___COMPILE.c:$(_UNIQ)%=%)
40
41__COMPILE.cc=		$(_UNIQ)$(COMPILE.cc)
42___COMPILE.cc=		$(__COMPILE.cc:$(_UNIQ)=$(CC++) $(C++FLAGS) $(CCFLAGS) $(CPP_FLAGS) $(CPPFLAGS) -c)
43_COMPILE.cc=		$(___COMPILE.cc:$(_UNIQ)%=%)
44
45__OUTPUT_OPTION=	$(_UNIQ)$(OUTPUT_OPTION)
46___OUTPUT_OPTION=	$(__OUTPUT_OPTION:$(_UNIQ)=-o $@)
47_OUTPUT_OPTION=		$(___OUTPUT_OPTION:$(_UNIQ)%=%)
48###########################################################################
49
50$(ARCHDIR)/%.$o: %.c
51			$(_COMPILE.c) $(_OUTPUT_OPTION) $<  $(CC_OUTPUT_FILTER)
52$(ARCHDIR)/%.$o: %.C
53			$(_COMPILE.cc) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER)
54$(ARCHDIR)/%.$o: %.cc
55			$(_COMPILE.cc) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER)
56$(ARCHDIR)/%.$o: %.cpp
57			$(_COMPILE.cc) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER)
58$(ARCHDIR)/%.$o: %.cxx
59			$(_COMPILE.cc) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER)
60###########################################################################
61