1#ident @(#)r-smake.obj 2.2 18/08/16 2########################################################################### 3# Written 1996 by J. Schilling 4########################################################################### 5# 6# Object building rules for smake 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.OBJDIR: $(ARCHDIR) 38########################################################################### 39__COMPILE.c= $(_UNIQ)$(COMPILE.c) 40___COMPILE.c= $(__COMPILE.c:$(_UNIQ)=$(CCCC) $(C_FLAGS) $(CFLAGS) $(CPP_FLAGS) $(CPPFLAGS) -c) 41_COMPILE.c= $(___COMPILE.c:$(_UNIQ)%=%) 42 43__COMPILE.cc= $(_UNIQ)$(COMPILE.cc) 44___COMPILE.cc= $(__COMPILE.cc:$(_UNIQ)=$(CC++) $(C++FLAGS) $(CCFLAGS) $(CPP_FLAGS) $(CPPFLAGS) -c) 45_COMPILE.cc= $(___COMPILE.cc:$(_UNIQ)%=%) 46 47__OUTPUT_OPTION= $(_UNIQ)$(OUTPUT_OPTION) 48___OUTPUT_OPTION= $(__OUTPUT_OPTION:$(_UNIQ)=-o $@) 49_OUTPUT_OPTION= $(___OUTPUT_OPTION:$(_UNIQ)%=%) 50########################################################################### 51 52$(ARCHDIR)/%.$o: %.c 53 $(_COMPILE.c) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER) 54$(ARCHDIR)/%.$o: %.C 55 $(_COMPILE.cc) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER) 56$(ARCHDIR)/%.$o: %.cc 57 $(_COMPILE.cc) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER) 58$(ARCHDIR)/%.$o: %.cpp 59 $(_COMPILE.cc) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER) 60$(ARCHDIR)/%.$o: %.cxx 61 $(_COMPILE.cc) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER) 62 63#$(ARCHDIR)/%.$o: %.c 64# $(CCCC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c 65 66########################################################################### 67