File: rules.top

package info (click to toggle)
sformat 3.4-1
  • links: PTS
  • area: main
  • in suites: potato, slink
  • size: 2,056 kB
  • ctags: 3,432
  • sloc: ansic: 20,874; makefile: 98; sh: 95
file content (195 lines) | stat: -rw-r--r-- 6,691 bytes parent folder | download | duplicates (4)
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
#ident "@(#)rules.top	1.12 97/04/27 "
###########################################################################
# Written 1996 by J. Schilling
###########################################################################
#
# Rules that should be included at top of every Makefile
#
###########################################################################
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
###########################################################################
#
# Global definitions:
#
# Define magic unique cookie
#
###########################################################################
_UNIQ= .XxZzy-

###########################################################################
#
# Standard (automatic) makeprog identification
#
# Each make program should define a macro: MAKE_NAME for identification.
# MAKE_NAME in this case is a built in macro like MAKE or MAKEFLAGS.
# Currently only 'smake' implements this feature.
#
###########################################################################
_MAKEPROG=	$(_UNIQ)$(MAKE_NAME)
__MAKEPROG=	$(_MAKEPROG:$(_UNIQ)=$(MAKEPROG))
XMAKEPROG=	$(__MAKEPROG:$(_UNIQ)%=%)

include		$(SRCROOT)/$(RULESDIR)/mk-$(XMAKEPROG).id

###########################################################################
#
# Standard (automatic) os identification
#
###########################################################################
include		$(SRCROOT)/$(RULESDIR)/os-$(OSNAME).id

###########################################################################
#
# Global os definitions
#
###########################################################################
include		$(SRCROOT)/$(RULESDIR)/os-$(O_ARCH).def

###########################################################################
#
# Some global project definitions that may be overwritten in 'Defaults'
#
###########################################################################
CWARNOPTS=	$(CWOPTS)

###########################################################################
#
# Global project definitions
#
###########################################################################
DEF_ROOT=	$(SRCROOT)
DEF_DIR=	DEFAULTS

_DEFAULTSROOT=	$(_UNIQ)$(DEFAULTSROOT)
__DEFAULTSROOT=	$(_DEFAULTSROOT:$(_UNIQ)=$(DEF_ROOT))
DEFLTSROOT=	$(__DEFAULTSROOT:$(_UNIQ)%=%)

_DEFAULTSDIR=	$(_UNIQ)$(DEFAULTSDIR)
__DEFAULTSDIR=	$(_DEFAULTSDIR:$(_UNIQ)=$(DEF_DIR))
DEFLTSDIR=	$(__DEFAULTSDIR:$(_UNIQ)%=%)

include		$(DEFLTSROOT)/$(DEFLTSDIR)/Defaults

###########################################################################
#
# Get curent directory name
#
###########################################################################
_DIRNAME=	$(_UNIQ)$(DIRNAME)
__DIRNAME=	$(_DIRNAME:$(_UNIQ)=...)
CURDIR=		$(__DIRNAME:$(_UNIQ)%=%)

###########################################################################
#
# Standard UNIX compiler name for use as architecture name.
#
# (this is not necessarily the name the compiler is called by)
# This is now defined in $(DEFAULTSROOT)/Defaults
# If not ... use 'cc'
#
###########################################################################
DEFCCOM_DEF=	cc

_DEFCCOM=	$(_UNIQ)$(DEFCCOM)
__DEFCCOM=	$(_DEFCCOM:$(_UNIQ)=$(DEFCCOM_DEF))
CCOM_DEF=	$(__DEFCCOM:$(_UNIQ)%=%)

_CCOM=		$(_UNIQ)$(CCOM)
__CCOM=		$(_CCOM:$(_UNIQ)=$(CCOM_DEF))
C_ARCH=		$(__CCOM:$(_UNIQ)%=%)

###########################################################################
#
# Standard default include directories
#
###########################################################################
DEFINCDIRS_DEF=	$(SRCROOT)/include

_INCDIRS=	$(_UNIQ)$(DEFINCDIRS)
__INCDIRS=	$(_INCDIRS:$(_UNIQ)=$(DEFINCDIRS_DEF))
INCDIRS=	$(__INCDIRS:$(_UNIQ)%=%)

###########################################################################
#
# Build $(ARCHDIR) which occupies a central role in the whole
# make file system. ARCHDIR is used as a sub directory name to keep
# platform dependent files on different places.
#
# It is built from:
#	- processor type
#	- operating system
#	- compiler identification
#
# A possible name could be:
#	mc68020-sunos4-cc
#
###########################################################################
KARCH_DEF=	$(K_ARCH)
MARCH_DEF=	$(M_ARCH)
PARCH_DEF=	$(P_ARCH)

KARCH=		K_ARCH

_MARCH=		$(_UNIQ)$(ARCH)
__MARCH=	$(_MARCH:$(_UNIQ)=$(MARCH_DEF))
MARCH=		$(__MARCH:$(_UNIQ)%=%)

_PARCH=		$(_UNIQ)$(ARCH)
__PARCH=	$(_PARCH:$(_UNIQ)=$(PARCH_DEF))
PARCH=		$(__PARCH:$(_UNIQ)%=%)

#OARCH=		$(MARCH)$(-O_ARCH)-$(C_ARCH)
OARCH=		$(PARCH)$(-O_ARCH)-$(C_ARCH)
XARCH=		$(K_ARCH)$(-O_ARCH)-$(C_ARCH)
.print:
	echo $(XP_ARCH) $(P_ARCH)

###########################################################################
#
# All generated files are placed directly into this subdirectory.
# This includes e.g. yacc output (.c & .h files).
# SUBARCH is used if a object is conditional compiled in multiple ways.
#
###########################################################################
OARCHDIR=	OBJ/$(OARCH)
ARCHDIR=	OBJ/$(OARCH)$(SUBARCHDIR)$(SUBARCH)

###########################################################################
OLIBSDIR=	$(SRCROOT)/libs/$(OARCH)
OINCSDIR=	$(SRCROOT)/incs/$(OARCH)

###########################################################################
# Location for targets:
#
# - all						: see appropriate rules
# - clean, clobber, distclean, relink, rmtarget	: rules.clr
# - install, ibins				: rules.ins
# - depend					: rules.dep
# - tags, TAGS					: tules.tag
#
###########################################################################
ALLTARGETS=	all clean clobber distclean install ibins depend \
		TAGS tags rmtarget relink

###########################################################################
#
# Include platform dependent macros for C-language here.
#
# If a project needs other languages too, additional rules may be defined.
# These additional rules should be placed in a file that uses a hierarchy
# similar to rules.top and mey be called e.g. yacc.top.
#
###########################################################################
include		$(SRCROOT)/$(RULESDIR)/$(XARCH).rul